Bug 1119072, Part 10: Work around internal compiler error in VS2015 (js), r=waldo
authorBrian Smith <brian@briansmith.org>
Fri, 09 Jan 2015 01:21:37 -0800
changeset 242313 b6b34b54164e357e2f6d2ac2c4c5c32c03595f35
parent 242312 ce3638e6a65942353a8c56dea78b6079b89bcec8
child 242314 916139e297bdb05128091a2ee73e6a75f64a97dd
push id7677
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 18:11:24 +0000
treeherdermozilla-aurora@f531d838c055 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswaldo
bugs1119072
milestone38.0a1
Bug 1119072, Part 10: Work around internal compiler error in VS2015 (js), r=waldo
js/src/jit/LIR.cpp
--- a/js/src/jit/LIR.cpp
+++ b/js/src/jit/LIR.cpp
@@ -105,17 +105,19 @@ LBlock::init(TempAllocator &alloc)
 
         int numPhis = (phi->type() == MIRType_Value) ? BOX_PIECES : 1;
         for (int i = 0; i < numPhis; i++) {
             void *array = alloc.allocateArray<sizeof(LAllocation)>(numPreds);
             LAllocation *inputs = static_cast<LAllocation *>(array);
             if (!inputs)
                 return false;
 
-            LPhi *lphi = new (&phis_[phiIndex++]) LPhi(phi, inputs);
+            // MSVC 2015 cannot handle "new (&phis_[phiIndex++])"
+            void *addr = &phis_[phiIndex++];
+            LPhi *lphi = new (addr) LPhi(phi, inputs);
             lphi->setBlock(this);
         }
     }
     return true;
 }
 
 const LInstruction *
 LBlock::firstInstructionWithId() const