mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 935586 - Fix an exact rooting hazard in getIntrinsicValue; r=bhackett
--HG-- extra : rebase_source : eca4c08e60a5583c18a6f1d985ff1a86d19c8a7e
This commit is contained in:
parent
5201dd0149
commit
5072dc5910
@ -529,9 +529,10 @@ class GlobalObject : public JSObject
|
|||||||
bool getIntrinsicValue(JSContext *cx, HandlePropertyName name, MutableHandleValue value) {
|
bool getIntrinsicValue(JSContext *cx, HandlePropertyName name, MutableHandleValue value) {
|
||||||
if (maybeGetIntrinsicValue(name, value.address()))
|
if (maybeGetIntrinsicValue(name, value.address()))
|
||||||
return true;
|
return true;
|
||||||
|
Rooted<GlobalObject*> self(cx, this);
|
||||||
if (!cx->runtime()->cloneSelfHostedValue(cx, name, value))
|
if (!cx->runtime()->cloneSelfHostedValue(cx, name, value))
|
||||||
return false;
|
return false;
|
||||||
RootedObject holder(cx, intrinsicsHolder());
|
RootedObject holder(cx, self->intrinsicsHolder());
|
||||||
RootedId id(cx, NameToId(name));
|
RootedId id(cx, NameToId(name));
|
||||||
return JS_DefinePropertyById(cx, holder, id, value, nullptr, nullptr, 0);
|
return JS_DefinePropertyById(cx, holder, id, value, nullptr, nullptr, 0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user