mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 584882: Don't attempt to compute this for dummy frames. r=jorendorff
This commit is contained in:
parent
aa649b9ff3
commit
c7dbe5a681
@ -1238,7 +1238,10 @@ JS_GetFrameCallObject(JSContext *cx, JSStackFrame *fp)
|
||||
JS_PUBLIC_API(JSObject *)
|
||||
JS_GetFrameThis(JSContext *cx, JSStackFrame *fp)
|
||||
{
|
||||
return fp->getThisObject(cx);
|
||||
if (fp->isDummyFrame())
|
||||
return NULL;
|
||||
else
|
||||
return fp->getThisObject(cx);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(JSFunction *)
|
||||
|
@ -68,6 +68,7 @@ enum JSFrameFlags {
|
||||
JSFRAME_YIELDING = 0x40, /* js_Interpret dispatched JSOP_YIELD */
|
||||
JSFRAME_GENERATOR = 0x80, /* frame belongs to generator-iterator */
|
||||
JSFRAME_OVERRIDE_ARGS = 0x100, /* overridden arguments local variable */
|
||||
JSFRAME_DUMMY = 0x200, /* frame is a dummy frame */
|
||||
|
||||
JSFRAME_SPECIAL = JSFRAME_DEBUGGER | JSFRAME_EVAL
|
||||
};
|
||||
@ -222,7 +223,7 @@ struct JSStackFrame
|
||||
return !!(flags & JSFRAME_FLOATING_GENERATOR);
|
||||
}
|
||||
|
||||
bool isDummyFrame() const { return !script && !fun; }
|
||||
bool isDummyFrame() const { return !!(flags & JSFRAME_DUMMY); }
|
||||
};
|
||||
|
||||
namespace js {
|
||||
@ -510,6 +511,7 @@ js_MeterSlotOpcode(JSOp op, uint32 slot);
|
||||
inline JSObject *
|
||||
JSStackFrame::getThisObject(JSContext *cx)
|
||||
{
|
||||
JS_ASSERT(!isDummyFrame());
|
||||
if (flags & JSFRAME_COMPUTED_THIS)
|
||||
return &thisv.toObject();
|
||||
if (!js::ComputeThisFromArgv(cx, argv))
|
||||
|
@ -490,6 +490,7 @@ SetupFakeFrame(JSContext *cx, ExecuteFrameGuard &frame, JSFrameRegs ®s, JSObj
|
||||
PodZero(fp); // fp->fun and fp->script are both NULL
|
||||
fp->argv = vp + 2;
|
||||
fp->scopeChain = obj->getGlobal();
|
||||
fp->flags = JSFRAME_DUMMY;
|
||||
|
||||
regs.pc = NULL;
|
||||
regs.sp = fp->slots();
|
||||
|
Loading…
Reference in New Issue
Block a user