Skip to content

Commit

Permalink
Protect vp from garbage collection, since GC could nest under several…
Browse files Browse the repository at this point in the history
… of the calls here. bug 390222, r+sr=jst
  • Loading branch information
mrbkap@gmail.com committed Jul 31, 2007
1 parent 1aa6596 commit 4b4cd4b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions js/src/xpconnect/src/XPCCrossOriginWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,13 @@ XPC_XOW_GetOrSetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp,
return JS_TRUE;
}

XPCCallContext ccx(JS_CALLER, cx);
if (!ccx.IsValid()) {
return ThrowException(NS_ERROR_FAILURE, cx);
}

AUTO_MARK_JSVAL(ccx, vp);

JSObject *wrappedObj = GetWrappedObject(cx, obj);
if (!wrappedObj) {
return ThrowException(NS_ERROR_ILLEGAL_VALUE, cx);
Expand Down

0 comments on commit 4b4cd4b

Please sign in to comment.