From 47b45e60e7a57871feb3612c4accc1b40203f04c Mon Sep 17 00:00:00 2001 From: Andreas Gal Date: Thu, 19 Mar 2009 01:07:31 -0700 Subject: [PATCH] Always check operation callback on backwards branches (484035, r=brendan). --- js/src/jsinterp.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/js/src/jsinterp.cpp b/js/src/jsinterp.cpp index 90b333751d3..aa65216da76 100644 --- a/js/src/jsinterp.cpp +++ b/js/src/jsinterp.cpp @@ -2713,12 +2713,14 @@ js_Interpret(JSContext *cx) JS_BEGIN_MACRO \ regs.pc += (n); \ op = (JSOp) *regs.pc; \ - if (op == JSOP_NOP) { \ - op = (JSOp) *++regs.pc; \ - } else if (op == JSOP_LOOP) { \ + if ((n) <= 0) { \ CHECK_BRANCH(); \ - MONITOR_BRANCH(); \ - op = (JSOp) *regs.pc; \ + if (op == JSOP_NOP) { \ + op = (JSOp) *++regs.pc; \ + } else if (op == JSOP_LOOP) { \ + MONITOR_BRANCH(); \ + op = (JSOp) *regs.pc; \ + } \ } \ DO_OP(); \ JS_END_MACRO