Ensure inputs to unboxes are lowered (bug 694422, r=sstangl).
authorDavid Anderson <danderson@mozilla.com>
Thu, 13 Oct 2011 16:29:03 -0700
changeset 78977 e575614bb8884aceeabfaec798f5bd42fe7e8e0a
parent 78976 1e6e025df3d12b363ded3daf890d8708f698e40b
child 78978 7658d0234f1983a813fddec9f86a95906be245b2
push idunknown
push userunknown
push dateunknown
reviewerssstangl
bugs694422
milestone10.0a1
Ensure inputs to unboxes are lowered (bug 694422, r=sstangl).
js/src/ion/x86/Lowering-x86.cpp
--- a/js/src/ion/x86/Lowering-x86.cpp
+++ b/js/src/ion/x86/Lowering-x86.cpp
@@ -121,20 +121,20 @@ LIRGeneratorX86::visitBox(MBox *box)
 bool
 LIRGeneratorX86::visitUnbox(MUnbox *unbox)
 {
     // An unbox on x86 reads in a type tag (either in memory or a register) and
     // a payload. Unlike most instructions conusming a box, we ask for the type
     // second, so that the result can re-use the first input.
     MDefinition *inner = unbox->getOperand(0);
 
+    if (!ensureDefined(inner))
+        return false;
+
     if (unbox->type() == MIRType_Double) {
-        if (!ensureDefined(inner))
-            return false;
-
         LUnboxDouble *lir = new LUnboxDouble;
         if (unbox->fallible() && !assignSnapshot(lir, unbox->bailoutKind()))
             return false;
         if (!useBox(lir, LUnboxDouble::Input, inner))
             return false;
         return define(lir, unbox);
     }