mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-07 13:24:12 +00:00
Bug 493177 - Browser crashes in loading of certain page.[@ js_Interpret] (r=mrbkap).
This commit is contained in:
parent
9e84859560
commit
5648bbb12a
@ -1847,10 +1847,26 @@ MakeUpvarForEval(JSParseNode *pn, JSCodeGenerator *cg)
|
|||||||
uintN upvarLevel = fun->u.i.script->staticLevel;
|
uintN upvarLevel = fun->u.i.script->staticLevel;
|
||||||
|
|
||||||
JSFunctionBox *funbox = cg->funbox;
|
JSFunctionBox *funbox = cg->funbox;
|
||||||
while (funbox && funbox->level >= upvarLevel) {
|
if (funbox) {
|
||||||
if (funbox->node->pn_dflags & PND_FUNARG)
|
/*
|
||||||
|
* Treat top-level function definitions as escaping (i.e., as funargs),
|
||||||
|
* required since we compile each such top level function or statement
|
||||||
|
* and throw away the AST, so we can't yet see all funarg uses of this
|
||||||
|
* function being compiled (cg->funbox->object). See bug 493177.
|
||||||
|
*/
|
||||||
|
if (funbox->level == fun->u.i.script->staticLevel + 1U &&
|
||||||
|
!(((JSFunction *) funbox->object)->flags & JSFUN_LAMBDA)) {
|
||||||
|
JS_ASSERT(((JSFunction *) funbox->object)->atom);
|
||||||
return true;
|
return true;
|
||||||
funbox = funbox->parent;
|
}
|
||||||
|
|
||||||
|
while (funbox->level >= upvarLevel) {
|
||||||
|
if (funbox->node->pn_dflags & PND_FUNARG)
|
||||||
|
return true;
|
||||||
|
funbox = funbox->parent;
|
||||||
|
if (!funbox)
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JSContext *cx = cg->compiler->context;
|
JSContext *cx = cg->compiler->context;
|
||||||
|
Loading…
Reference in New Issue
Block a user