Index: src/lithium-allocator.h |
diff --git a/src/lithium-allocator.h b/src/lithium-allocator.h |
index 2ca853763e893343bf01315f2dafbfd5018c43d5..0e24d54dc47cc9803f44496b3f6ab484a27124b5 100644 |
--- a/src/lithium-allocator.h |
+++ b/src/lithium-allocator.h |
@@ -427,8 +427,10 @@ class LAllocator BASE_EMBEDDED { |
Zone* zone() const { return zone_; } |
int GetVirtualRegister() { |
- if (next_virtual_register_ > LUnallocated::kMaxVirtualRegisters) { |
+ if (next_virtual_register_ >= LUnallocated::kMaxVirtualRegisters) { |
allocation_ok_ = false; |
+ // Maintain the invariant that we return something below the maximum. |
+ return 0; |
} |
return next_virtual_register_++; |
} |