Bug 463239 - JS_SetTrap alters code execution. r=brendan.

This commit is contained in:
Jason Orendorff
2009-02-18 18:31:09 -06:00
parent 72f32aade4
commit b2756732fe
5 changed files with 49 additions and 36 deletions

View File

@@ -138,9 +138,7 @@ js_GetIndexFromBytecode(JSContext *cx, JSScript *script, jsbytecode *pc,
JSOp op;
uintN span, base;
op = (JSOp)*pc;
if (op == JSOP_TRAP)
op = JS_GetTrapOpcode(cx, script, pc);
op = js_GetOpcode(cx, script, pc);
JS_ASSERT(js_CodeSpec[op].length >= 1 + pcoff + UINT16_LEN);
/*
@@ -5211,9 +5209,7 @@ ReconstructPCStack(JSContext *cx, JSScript *script, jsbytecode *target,
LOCAL_ASSERT(script->main <= target && target < script->code + script->length);
pcdepth = 0;
for (pc = script->main; pc < target; pc += oplen) {
op = (JSOp) *pc;
if (op == JSOP_TRAP)
op = JS_GetTrapOpcode(cx, script, pc);
op = js_GetOpcode(cx, script, pc);
cs = &js_CodeSpec[op];
oplen = cs->length;
if (oplen < 0)
@@ -5233,7 +5229,7 @@ ReconstructPCStack(JSContext *cx, JSScript *script, jsbytecode *target,
jmpoff = js_GetSrcNoteOffset(sn, 0);
if (pc + jmpoff < target) {
pc += jmpoff;
op = (JSOp) *pc;
op = js_GetOpcode(cx, script, pc);
JS_ASSERT(op == JSOP_GOTO || op == JSOP_GOTOX);
cs = &js_CodeSpec[op];
oplen = cs->length;