Closed Bug 592184 Opened 14 years ago Closed 14 years ago

TM: XPC_WN_CallMethod has to set the right compartment

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: gwagner, Assigned: gwagner)

References

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(3 files)

Attached file gdb output (deleted) —
No description provided.
Attached patch patch (deleted) — Splinter Review
Attachment #471161 - Flags: review?(mrbkap)
Comment on attachment 471161 [details] [diff] [review] patch >diff -r 18e3ee80322f js/src/jsapi.cpp >--- a/js/src/jsapi.cpp Tue Aug 31 11:48:58 2010 -0700 >+++ b/js/src/jsapi.cpp Wed Sep 01 10:12:02 2010 -0700 >@@ -1186,17 +1186,17 @@ JSAutoEnterCompartment::JSAutoEnterCompa > : cx(cx), compartment(cx->compartment) > { > cx->compartment = newCompartment; > } > > JSAutoEnterCompartment::JSAutoEnterCompartment(JSContext *cx, JSObject *target) > : cx(cx), compartment(cx->compartment) > { >- cx->compartment = target->getCompartment(cx); >+ cx->compartment = target ? target->getCompartment(cx) : cx->runtime->defaultCompartment; This change is not needed any more.
Attached patch patch (deleted) — Splinter Review
Attachment #471161 - Flags: review?(mrbkap)
Attachment #471168 - Flags: review?(mrbkap)
Assignee: general → anygregor
Attachment #471168 - Flags: review?(mrbkap) → review+
Whiteboard: fixed-in-tracemonkey
Blocks: 594455
Depends on: 612408
Comment on attachment 471168 [details] [diff] [review] patch > rv = mSystemPrincipal->GetJSPrincipals(cx, &jsPrincipals); > NS_ENSURE_SUCCESS(rv, rv); > > JSPrincipalsHolder princHolder(mContext, jsPrincipals); > #endif > > nsCOMPtr<nsIXPCScriptable> backstagePass; >@@ -1464,16 +1469,19 @@ mozJSComponentLoader::ImportInto(const n > } > > NS_ASSERTION(mod->global, "Import table contains entry with no global"); > *_retval = mod->global; > > jsval symbols; > if (targetObj) { > JSCLContextHelper cxhelper(this); >+ JSAutoCrossCompartmentCall ac; >+ if (!ac.enter(mContext, mod->global)) >+ return NULL; returning a NULL as a nsresult :(
ouch, sorry. Gregor, want to file a bug and fix this?
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: