Closed Bug 865308 Opened 12 years ago Closed 12 years ago

GC: More rooting work in XPConnect

Categories

(Core :: XPConnect, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla23

People

(Reporter: jonco, Assigned: jonco)

References

Details

Attachments

(1 file)

Attached patch Proposed changes (deleted) — Splinter Review
Fix most of the remaining rooting hazards reported in XPConnect by the static analysis. Refactor GetContextFromObject() in XPCWrappedJSClass.cpp to take a pointer to the wrapper rather than the object so that the latter is not on the stack over calls that can possible GC.
Attachment #741374 - Flags: review?(bobbyholley+bmo)
Comment on attachment 741374 [details] [diff] [review] Proposed changes Review of attachment 741374 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/xpconnect/src/XPCWrappedJSClass.cpp @@ +493,5 @@ > NS_OK == aPtr->QueryInterface(NS_GET_IID(WrappedJSIdentity), &result) && > result == WrappedJSIdentity::GetSingleton(); > } > > // NB: This returns null unless there's nothing on the JSContext stack. This comment needs updating. ::: js/xpconnect/wrappers/AccessCheck.cpp @@ +363,3 @@ > return false; > > + if (!JSVAL_IS_STRING(desc.value())) { Might as make that desc.value().isString() while you're at it. @@ +366,5 @@ > EnterAndThrow(cx, wrapper, "property must be a string"); > return false; > } > > + JSString *str = JSVAL_TO_STRING(desc.value()); .toString().
Attachment #741374 - Flags: review?(bobbyholley+bmo) → review+
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: