Set newborn to root of object tree created by literal (followup to waterson nsJSEnvironment.cpp fix).

This commit is contained in:
brendan%mozilla.org 2000-05-14 05:38:51 +00:00
Родитель 19ff28a612
Коммит 2cdcef05eb
1 изменённых файлов: 8 добавлений и 0 удалений

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

@ -2105,7 +2105,9 @@ js_Interpret(JSContext *cx, jsval *result)
/* Get immediate argc and find the constructor function. */ /* Get immediate argc and find the constructor function. */
argc = GET_ARGC(pc); argc = GET_ARGC(pc);
#if JS_HAS_INITIALIZERS
do_new: do_new:
#endif
vp = sp - (2 + argc); vp = sp - (2 + argc);
JS_ASSERT(vp >= newsp); JS_ASSERT(vp >= newsp);
@ -3158,6 +3160,12 @@ js_Interpret(JSContext *cx, jsval *result)
case JSOP_ENDINIT: case JSOP_ENDINIT:
if (--fp->sharpDepth == 0) if (--fp->sharpDepth == 0)
fp->sharpArray = NULL; fp->sharpArray = NULL;
/* Re-set the newborn root to the top of this object tree. */
JS_ASSERT(sp - newsp >= 1);
lval = sp[-1];
JS_ASSERT(JSVAL_IS_OBJECT(lval));
cx->newborn[GCX_OBJECT] = JSVAL_TO_GCTHING(lval);
break; break;
case JSOP_INITPROP: case JSOP_INITPROP: