mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Fix GC hazard when constructing functions, bug 698156.
This commit is contained in:
parent
60d061e5cc
commit
83ca66c7ef
@ -2350,8 +2350,6 @@ js_NewFunction(JSContext *cx, JSObject *funobj, Native native, uintN nargs,
|
||||
funobj = NewFunction(cx, SkipScopeParent(parent), kind);
|
||||
if (!funobj)
|
||||
return NULL;
|
||||
if (native && !funobj->setSingletonType(cx))
|
||||
return NULL;
|
||||
}
|
||||
fun = static_cast<JSFunction *>(funobj);
|
||||
|
||||
@ -2381,6 +2379,9 @@ js_NewFunction(JSContext *cx, JSObject *funobj, Native native, uintN nargs,
|
||||
}
|
||||
fun->atom = atom;
|
||||
|
||||
if (native && !fun->setSingletonType(cx))
|
||||
return NULL;
|
||||
|
||||
return fun;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user