Bug 666292 - The decompiler does not deserve to use FrameRegsIter (it temporarily clobbers script->code) (r=waldo)

This commit is contained in:
Luke Wagner 2011-06-23 16:41:59 -07:00
parent 0a61156473
commit a6f59ecb7d
2 changed files with 16 additions and 4 deletions

View File

@ -0,0 +1,14 @@
// |jit-test| debug
function f(){
this.zzz.zzz;
for(let d in []);
}
trap(f, 18, '')
try {
f()
} catch(e) {
caught = true;
assertEq(""+e, "TypeError: this.zzz is undefined");
}
assertEq(caught, true);

View File

@ -2090,11 +2090,9 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb, JSOp nextop)
* the bytecode at pc, so we don't decompile more than the error
* expression.
*/
FrameRegsIter iter(cx);
while (!iter.done() && !iter.fp()->isScriptFrame())
++iter;
StackFrame *fp = js_GetScriptedCaller(cx, NULL);
uint32 format = cs->format;
if (((!iter.done() && pc == iter.pc()) ||
if (((fp && pc == fp->pcQuadratic(cx)) ||
(pc == startpc && nuses != 0)) &&
format & (JOF_SET|JOF_DEL|JOF_INCDEC|JOF_FOR|JOF_VARPROP)) {
uint32 mode = JOF_MODE(format);