From 401a009b4e020048f24d05e81bddead8cb4b0eac 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 000000000000..6cba63ec4fd4 --- /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 3061c3f16378..1b262d7d26e1 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