Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Unified Diff: src/lithium-allocator.h

Issue 12684014: Merged r13946 into 3.16 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.16
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/lithium-ia32.cc ('k') | src/lithium-allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lithium-allocator.h
diff --git a/src/lithium-allocator.h b/src/lithium-allocator.h
index 2953550ae8e879742ed19d0c4a9bba6cfc5bf5af..c7d910a0c4a7336ac55f28019220ed4261fb64a0 100644
--- a/src/lithium-allocator.h
+++ b/src/lithium-allocator.h
@@ -426,8 +426,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_++;
}
« no previous file with comments | « src/ia32/lithium-ia32.cc ('k') | src/lithium-allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698