Index: src/x64/lithium-x64.cc |
diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc |
index 394637cf3da6e46d6d587245240c62cf28c4ade0..d9c2f95f42b878e39bbf69ac5856eaecfe2debbe 100644 |
--- a/src/x64/lithium-x64.cc |
+++ b/src/x64/lithium-x64.cc |
@@ -683,8 +683,12 @@ LInstruction* LChunkBuilder::AssignPointerMap(LInstruction* instr) { |
LUnallocated* LChunkBuilder::TempRegister() { |
LUnallocated* operand = |
new(zone()) LUnallocated(LUnallocated::MUST_HAVE_REGISTER); |
- operand->set_virtual_register(allocator_->GetVirtualRegister()); |
- if (!allocator_->AllocationOk()) Abort("Not enough virtual registers."); |
+ int vreg = allocator_->GetVirtualRegister(); |
+ if (!allocator_->AllocationOk()) { |
+ Abort("Out of virtual registers while trying to allocate temp register."); |
+ return NULL; |
+ } |
+ operand->set_virtual_register(vreg); |
return operand; |
} |