Bug 517041 - Instead of giving pseudo frames an sp, protect against null sps during GC. r=brendan

This commit is contained in:
Blake Kaplan 2009-09-16 16:13:41 -07:00
parent c39783bcf1
commit f823db9527
2 changed files with 3 additions and 2 deletions

View File

@ -644,7 +644,7 @@ js_watch_set(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
JS_ASSERT(script->length >= JSOP_STOP_LENGTH);
regs.pc = script->code + script->length
- JSOP_STOP_LENGTH;
regs.sp = frame.slots;
regs.sp = NULL;
frame.regs = &regs;
if (fun &&
JSFUN_HEAVYWEIGHT_TEST(fun->flags) &&

View File

@ -2358,11 +2358,12 @@ js_TraceStackFrame(JSTracer *trc, JSStackFrame *fp)
* Don't mark what has not been pushed yet, or what has been
* popped already.
*/
if (fp->regs) {
if (fp->regs && fp->regs->sp) {
nslots = (uintN) (fp->regs->sp - fp->slots);
JS_ASSERT(nslots >= fp->script->nfixed);
} else {
nslots = fp->script->nfixed;
JS_ASSERT_IF(!fp->regs->sp, nslots == 0);
}
TRACE_JSVALS(trc, nslots, fp->slots, "slot");
}