[INFER] RegisterAllocation::synced should account for parentRegs, bug 646060.
authorBrian Hackett <bhackett1024@gmail.com>
Tue, 29 Mar 2011 21:15:51 -0700
changeset 74868 d1599f5fc1fcb4866b9dd41cbd76327fd6668613
parent 74867 453c2dcce09ef0ec9cd060ee3eb10783ef4b6a93
child 74869 56deeacefaefba0649bb17a5b3b21f9af156954c
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
bugs646060
milestone2.0b13pre
[INFER] RegisterAllocation::synced should account for parentRegs, bug 646060.
js/src/jit-test/tests/jaeger/bug646060.js
js/src/methodjit/FrameState.h
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/jaeger/bug646060.js
@@ -0,0 +1,8 @@
+function f0(i) {
+  switch(i) {
+  case "a":
+  case { TITLE: false, VERSION: false }('test')
+ : 
+  }
+}
+try { new TestCase(SECTION, 'switch statement', f0("a"), "ab*"); } catch (e) {}
--- a/js/src/methodjit/FrameState.h
+++ b/js/src/methodjit/FrameState.h
@@ -1211,16 +1211,18 @@ struct RegisterAllocation {
 
     void setParentRegs(Registers regs) {
         parentRegs = regs;
     }
 
     Registers getParentRegs() { return parentRegs; }
 
     bool synced() {
+        if (parentRegs.freeMask != 0)
+            return false;
         for (unsigned i = 0; i < Registers::TotalAnyRegisters; i++) {
             if (assigned(AnyRegisterID::fromRaw(i)))
                 return false;
         }
         return true;
     }
 
     void clearLoops() {