Closed Bug 1444416 Opened 7 years ago Closed 7 years ago

MOZ_CAN_RUN_SCRIPT doesn't work at all with references.

Categories

(Developer Infrastructure :: Source Code Analysis, defect)

3 Branch
defect
Not set
normal

Tracking

(firefox61 fixed)

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

The following test fails: MOZ_CAN_RUN_SCRIPT void test2_parent8() { RefCountedBase* t = new RefCountedBase; (*t).method_test(); // expected-error {{arguments must all be strong refs or parent parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument)}} }
Assignee: nobody → emilio
Comment on attachment 8957667 [details] Bug 1444416: Make bindings generate appropriate MOZ_KnownLive wrappers. https://reviewboard.mozilla.org/r/226590/#review232460 ::: dom/bindings/Codegen.py:7424 (Diff revision 1) > a.type.isDOMString()): > arg = CGWrapper(arg, pre="NonNullHelper(", post=")") > + > + # If it's an object, let the static analysis know it's alive for > + # the duration of the call. > + if a.type.isObject() or a.type.isGeckoInterface(): Why do you need the isObject() check? I don't think it makes sense, because MOZ_KnownLive only applies to refcounted stuff. So just the isGeckoInterface() check, please. r=me with that.
Attachment #8957667 - Flags: review?(bzbarsky) → review+
Comment on attachment 8957623 [details] Bug 1444416: Handle references in the "can run script" checker. https://reviewboard.mozilla.org/r/226506/#review232896 LGTM, thanks :-)
Attachment #8957623 - Flags: review?(nika) → review+
Comment on attachment 8957628 [details] Bug 1444416: Make the diagnostic point to the bogus argument. https://reviewboard.mozilla.org/r/226516/#review232898
Attachment #8957628 - Flags: review?(nika) → review+
Pushed by ecoal95@gmail.com: https://hg.mozilla.org/integration/autoland/rev/6416568ad06b Handle references in the "can run script" checker. r=mystor https://hg.mozilla.org/integration/autoland/rev/4d8dcb700d09 Make the diagnostic point to the bogus argument. r=mystor https://hg.mozilla.org/integration/autoland/rev/e1e268860e38 Make bindings generate appropriate MOZ_KnownLive wrappers. r=bz
Version: Version 3 → 3 Branch
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: