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

Unified Diff: runtime/vm/intrinsifier_x64.cc

Issue 10917223: Guard against allocation top overflow in ObjectArray_Allocate intrinsic. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: remove debugging changes Created 8 years, 3 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 | « runtime/vm/intrinsifier_ia32.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intrinsifier_x64.cc
diff --git a/runtime/vm/intrinsifier_x64.cc b/runtime/vm/intrinsifier_x64.cc
index d1957cef22d4514fe9cd54acd864b4dda2b7eb29..baae3fcf7fe0fef118d1674d5a09a515d674863e 100644
--- a/runtime/vm/intrinsifier_x64.cc
+++ b/runtime/vm/intrinsifier_x64.cc
@@ -57,10 +57,13 @@ bool Intrinsifier::ObjectArray_Allocate(Assembler* assembler) {
Isolate* isolate = Isolate::Current();
Heap* heap = isolate->heap();
- // RDI: allocation size.
__ movq(RAX, Immediate(heap->TopAddress()));
__ movq(RAX, Address(RAX, 0));
- __ leaq(RCX, Address(RAX, RDI, TIMES_1, 0));
+
+ // RDI: allocation size.
+ __ movq(RCX, RAX);
+ __ addq(RCX, RDI);
+ __ j(CARRY, &fall_through);
// Check if the allocation fits into the remaining space.
// RAX: potential new object start.
« no previous file with comments | « runtime/vm/intrinsifier_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698