Bug 510655: set argsobj->private when leaving trace only if created on trace, r=igor

This commit is contained in:
David Mandelin 2009-08-19 11:11:39 -07:00
Родитель 7b74923b54
Коммит f910ba7348
2 изменённых файлов: 19 добавлений и 2 удалений

Просмотреть файл

@ -2630,8 +2630,10 @@ FlushNativeStackFrame(JSContext* cx, unsigned callDepth, JSTraceType* mp, double
for (; n != 0; fp = fp->down) {
--n;
if (fp->callee) {
if (fp->argsobj)
JS_SetPrivate(cx, JSVAL_TO_OBJECT(fp->argsobj), fp);
// fp->argsobj->getPrivate() is NULL iff we created argsobj on trace.
if (fp->argsobj && !JSVAL_TO_OBJECT(fp->argsobj)->getPrivate()) {
JSVAL_TO_OBJECT(fp->argsobj)->setPrivate(fp);
}
/*
* We might return from trace with a different callee object, but it still

Просмотреть файл

@ -0,0 +1,15 @@
// This should not crash (or assert in debug builds).
(function () {
for (b in [0, 0]) {
(eval("\
[this\
for (b in [\
[undefined],\
arguments,\
[undefined]\
])\
]\
"))
}
})()