[INFER] Recheck script->types before forcing analysis with -a in typeSetThis, bug 639128.
authorBrian Hackett <bhackett1024@gmail.com>
Sat, 05 Mar 2011 17:34:09 -0800
changeset 74717 89f6b05273e846ac63968037a1259c19ae29b712
parent 74716 2f248906118d82d3002e2246a9a3ab352ed39d87
child 74718 855c0198a515534a91ffda1084c015c8cd09f280
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
bugs639128
milestone2.0b12pre
[INFER] Recheck script->types before forcing analysis with -a in typeSetThis, bug 639128.
js/src/jit-test/tests/basic/bug639128.js
js/src/jsinferinlines.h
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/basic/bug639128.js
@@ -0,0 +1,10 @@
+function f(o) { 
+    Object.seal(o); 
+}
+gc();
+if(2 != 2) {
+    g = new f(g);
+}
+with({}) {
+    f({});
+}
--- a/js/src/jsinferinlines.h
+++ b/js/src/jsinferinlines.h
@@ -542,17 +542,17 @@ JSScript::typeSetThis(JSContext *cx, js:
 
     if (!thisTypes()->hasType(type) || analyze) {
         js::types::AutoEnterTypeInference enter(cx);
 
         js::types::InferSpew(js::types::ISpewDynamic, "AddThis: #%u: %s",
                              id(), js::types::TypeString(type));
         thisTypes()->addType(cx, type);
 
-        if (analyze)
+        if (analyze && !types)
             js::types::AnalyzeScriptTypes(cx, this);
 
         return cx->compartment->types.checkPendingRecompiles(cx);
     }
 
     return true;
 }