From f85ae576fe7e47e1aa8c0170681b4a6a635789a6 Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Fri, 28 Sep 2012 15:56:29 -0700 Subject: [PATCH] Bug 794286 - ReconstructPcStack, Keep hidden stack depth only when following gotos. r=luke --- js/src/jit-test/tests/basic/bug794286.js | 5 +++++ js/src/jsopcode.cpp | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 js/src/jit-test/tests/basic/bug794286.js diff --git a/js/src/jit-test/tests/basic/bug794286.js b/js/src/jit-test/tests/basic/bug794286.js new file mode 100644 index 00000000000..6cba63ec4fd --- /dev/null +++ b/js/src/jit-test/tests/basic/bug794286.js @@ -0,0 +1,5 @@ +for (var i = 0; i < 1; i++) { + let y + if (undefined) continue + undefined.e +} diff --git a/js/src/jsopcode.cpp b/js/src/jsopcode.cpp index 3061c3f1637..1b262d7d26e 100644 --- a/js/src/jsopcode.cpp +++ b/js/src/jsopcode.cpp @@ -6431,6 +6431,7 @@ ReconstructPCStack(JSContext *cx, JSScript *script, jsbytecode *target, if (0 < jmpoff && pc + jmpoff <= target) { pc += jmpoff; oplen = 0; + /* Use the Hidden pc count if we follow the goto */ if (hpcdepth != unsigned(-1)) { pcdepth = hpcdepth; hpcdepth = unsigned(-1); @@ -6438,8 +6439,11 @@ ReconstructPCStack(JSContext *cx, JSScript *script, jsbytecode *target, continue; } - if (!script->hasTrynotes()) + 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