Bug 958980 - Stop Debugger from exposing partially initialized JSScripts. r=jorendorff, a=bajaj
☠☠ backed out by 12a33c3fc10b ☠ ☠
authorShu-yu Guo <shu@rfrn.org>
Tue, 21 Jan 2014 10:59:05 -0800
changeset 175963 b1aca8e61c5cf5ed2173616d33bd77aa13a99780
parent 175962 d7c2fcbc1c35656b4757750848f4863eff8c7121
child 175964 1ba6be1ed240ef10c155e6f182ecfb92bd2f634d
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff, bajaj
bugs958980
milestone28.0a2
Bug 958980 - Stop Debugger from exposing partially initialized JSScripts. r=jorendorff, a=bajaj
js/src/vm/Debugger.cpp
--- a/js/src/vm/Debugger.cpp
+++ b/js/src/vm/Debugger.cpp
@@ -2566,17 +2566,20 @@ class Debugger::ScriptQuery {
     }
 
     /*
      * If |script| matches this query, append it to |vector| or place it in
      * |innermostForCompartment|, as appropriate. Set |oom| if an out of memory
      * condition occurred.
      */
     void consider(JSScript *script) {
-        if (oom || script->selfHosted)
+        // We check for presence of script->code() because it is possible that
+        // the script was created and thus exposed to GC, but *not* fully
+        // initialized from fullyInit{FromEmitter,Trivial} due to errors.
+        if (oom || script->selfHosted() || !script->code())
             return;
         JSCompartment *compartment = script->compartment();
         if (!compartments.has(compartment))
             return;
         if (urlCString.ptr()) {
             if (!script->filename() || strcmp(script->filename(), urlCString.ptr()) != 0)
                 return;
         }