From 47783251743e8f3c20b6144ad1f0bf6e77a7b31b Mon Sep 17 00:00:00 2001 From: Andreas Gal Date: Mon, 11 May 2009 17:25:38 -0700 Subject: [PATCH] Ensure that cx->interpState is always accurate by maintaing a stack (490776, r=jorendorff). --- js/src/jstracer.cpp | 5 ++--- js/src/jstracer.h | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/src/jstracer.cpp b/js/src/jstracer.cpp index 3eb9692c7c4..be317f4197c 100644 --- a/js/src/jstracer.cpp +++ b/js/src/jstracer.cpp @@ -4312,6 +4312,7 @@ js_ExecuteTree(JSContext* cx, Fragment* f, uintN& inlineCallCount, JS_ASSERT(!tm->tracecx); tm->tracecx = cx; + state->prev = cx->interpState; cx->interpState = state; debug_only(fflush(NULL);) @@ -4325,9 +4326,7 @@ js_ExecuteTree(JSContext* cx, Fragment* f, uintN& inlineCallCount, AUDIT(traceTriggered); -#ifdef DEBUG - cx->interpState = NULL; -#endif + cx->interpState = state->prev; JS_ASSERT(lr->exitType != LOOP_EXIT || !lr->calldepth); tm->tracecx = NULL; diff --git a/js/src/jstracer.h b/js/src/jstracer.h index 150d80db5b2..893c7222689 100644 --- a/js/src/jstracer.h +++ b/js/src/jstracer.h @@ -385,6 +385,7 @@ struct InterpState #ifdef EXECUTE_TREE_TIMER uint64 startTime; #endif + InterpState* prev; /* * Used by _FAIL builtins; see jsbuiltins.h. The builtin sets the