mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 816046 - Intermittent "Assertion failure: key.kind != CrossCompartmentKey::StringWrapper r=billm
--HG-- extra : rebase_source : e57dc40bbd5648cabcaf2805b984e921577989f5
This commit is contained in:
parent
f934392869
commit
e0b573304b
@ -337,7 +337,22 @@ JSCompartment::wrap(JSContext *cx, Value *vp, JSObject *existing)
|
||||
if (!wrapped)
|
||||
return false;
|
||||
vp->setString(wrapped);
|
||||
return crossCompartmentWrappers.put(orig, *vp);
|
||||
if (!crossCompartmentWrappers.put(orig, *vp))
|
||||
return false;
|
||||
|
||||
if (str->compartment()->isGCMarking()) {
|
||||
/*
|
||||
* All string wrappers are dropped when collection starts, but we
|
||||
* just created a new one. Mark the wrapped string to stop it being
|
||||
* finalized, because if it was then the pointer in this
|
||||
* compartment's wrapper map would be left dangling.
|
||||
*/
|
||||
JSString *tmp = str;
|
||||
MarkStringUnbarriered(&rt->gcMarker, &tmp, "wrapped string");
|
||||
JS_ASSERT(tmp == str);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
RootedObject obj(cx, &vp->toObject());
|
||||
|
Loading…
Reference in New Issue
Block a user