Don't try to recompile scripts when clearing traps during GC, bug 683966.
authorBrian Hackett <bhackett1024@gmail.com>
Sun, 04 Sep 2011 13:33:33 -0700
changeset 76580 aa9f4b139e389262a9e3fcd0583aefe62b20b986
parent 76579 77e9502bd20f3c61a639f6533535a4f763b8d792
child 76581 de64e5ce70bcefff9df456c9e6e7153d2b608afa
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
bugs683966
milestone9.0a1
Don't try to recompile scripts when clearing traps during GC, bug 683966.
js/src/vm/Debugger.cpp
--- a/js/src/vm/Debugger.cpp
+++ b/js/src/vm/Debugger.cpp
@@ -220,17 +220,20 @@ BreakpointSite::clearTrap(JSContext *cx,
         *handlerp = trapHandler;
     if (closurep)
         *closurep = trapClosure;
 
     trapHandler = NULL;
     trapClosure.setUndefined();
     if (enabledCount == 0) {
         *pc = realOpcode;
-        recompile(cx, true);  /* ignore failure */
+        if (!cx->runtime->gcRunning) {
+            /* If the GC is running then the script is being destroyed. */
+            recompile(cx, true);  /* ignore failure */
+        }
         destroyIfEmpty(cx->runtime, e);
     }
 }
 
 void
 BreakpointSite::destroyIfEmpty(JSRuntime *rt, BreakpointSiteMap::Enum *e)
 {
     if (JS_CLIST_IS_EMPTY(&breakpoints) && !trapHandler) {