From 1b58fc7bc1a0e32c7334ba18c9a079483434730c Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Thu, 4 Oct 2012 12:35:03 -0700 Subject: [PATCH] Revert "Bug 797496 - Ignore hidden PC even with try notes. r=luke" This reverts changeset 3b7a134bc3aa. --- js/src/jit-test/tests/basic/bug797496.js | 8 ----- js/src/jsopcode.cpp | 40 ++++++++++++------------ 2 files changed, 20 insertions(+), 28 deletions(-) delete mode 100644 js/src/jit-test/tests/basic/bug797496.js diff --git a/js/src/jit-test/tests/basic/bug797496.js b/js/src/jit-test/tests/basic/bug797496.js deleted file mode 100644 index e33f3dbd9eb..00000000000 --- a/js/src/jit-test/tests/basic/bug797496.js +++ /dev/null @@ -1,8 +0,0 @@ -// |jit-test| error: TypeError -var set = Set(['a']); -var n = 5; -for (let v of set) { - if (n === 0) - break; - let g = set(Set(0xffffffff, n), 1); -} diff --git a/js/src/jsopcode.cpp b/js/src/jsopcode.cpp index e602132ae14..a58c06cb55d 100644 --- a/js/src/jsopcode.cpp +++ b/js/src/jsopcode.cpp @@ -6436,27 +6436,31 @@ ReconstructPCStack(JSContext *cx, JSScript *script, jsbytecode *target, jsbyteco continue; } + if (!script->hasTrynotes()) { + /* Use the normal pc count if continue after the goto */ + hpcdepth = unsigned(-1); + continue; + } + /* * If we do not follow a goto we look for another mean to continue * at the next PC. */ - if (script->hasTrynotes()) { - JSTryNote *tn = script->trynotes()->vector; - JSTryNote *tnEnd = tn + script->trynotes()->length; - for (; tn != tnEnd; tn++) { - jsbytecode *start = script->main() + tn->start; - jsbytecode *end = start + tn->length; - if (start < pc && pc <= end && end <= target) - break; - } + JSTryNote *tn = script->trynotes()->vector; + JSTryNote *tnEnd = tn + script->trynotes()->length; + for (; tn != tnEnd; tn++) { + jsbytecode *start = script->main() + tn->start; + jsbytecode *end = start + tn->length; + if (start < pc && pc <= end && end <= target) + break; + } - if (tn != tnEnd) { - pcdepth = tn->stackDepth; - hpcdepth = unsigned(-1); - oplen = 0; - pc = script->main() + tn->start + tn->length; - continue; - } + if (tn != tnEnd) { + pcdepth = tn->stackDepth; + hpcdepth = unsigned(-1); + oplen = 0; + pc = script->main() + tn->start + tn->length; + continue; } /* @@ -6465,10 +6469,6 @@ ReconstructPCStack(JSContext *cx, JSScript *script, jsbytecode *target, jsbyteco */ if (JSOp(*(pc + oplen)) == JSOP_THROWING) hpcdepth = pcdepth + 2; - else - /* Use the normal pc count if continue after the goto */ - hpcdepth = unsigned(-1); - continue; }