Closed Bug 1534383 Opened 6 years ago Closed 6 years ago

Teach the CAN_RUN_SCRIPT analysis that passing MOZ_KnownLive(NonNull<T>) as T& is OK

Categories

(Developer Infrastructure :: Source Code Analysis, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: bzbarsky, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Attached patch Patch for reproducing (deleted) — Splinter Review

STEPS TO REPRODUCE:

  1. Apply the patches from bug 1534370.
  2. Apply the attached patch.
  3. Change the MOZ_CAN_RUN_SCRIPT_BOUNDARY annotation on nsHTMLDocument::ExecCommand to MOZ_CAN_RUN_SCRIPT.
  4. Run the analysis.

EXPECTED RESULTS: Analysis passes.

ACTUAL RESULTS: Analysis fails on the principal argument.

I suspect the liveness guarantee of MOZ_KNOWN_LIVE is not propagating to the result of the conversion operator, which makes sense. What I don't know is how to make this work, exactly...

Maybe I could throw in a NonNullHelper around subjectPrincipal when it's known to be a nonnull, and then MOZ_KnownLive(NonNullHelper(subjectPrincipal)) will work...

The priority flag is not set for this bug.
:sylvestre, could you have a look please?

Flags: needinfo?(sledru)

I don't think we want to do this. I filed bug 1539204 on handling comment 1 specifically.

Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
Flags: needinfo?(sledru)
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: