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

Unified Diff: runtime/vm/assembler_mips.cc

Issue 1096063002: Fix array allocation overflow check on arm/arm64/mips. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 8 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/assembler_arm64.cc ('k') | runtime/vm/intrinsifier_arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_mips.cc
===================================================================
--- runtime/vm/assembler_mips.cc (revision 45353)
+++ runtime/vm/assembler_mips.cc (working copy)
@@ -872,6 +872,7 @@
const uword top_address = heap->TopAddress(space);
LoadImmediate(temp_reg, top_address);
lw(instance_reg, Address(temp_reg));
+ // TODO(koda): Protect against unsigned overflow here.
AddImmediate(instance_reg, instance_size);
// instance_reg: potential next object start.
@@ -914,8 +915,9 @@
LoadImmediate(temp1, heap->TopAddress(space));
lw(instance, Address(temp1, 0)); // Potential new object start.
// Potential next object start.
- AddImmediateDetectOverflow(end_address, instance, instance_size, CMPRES1);
- bltz(CMPRES1, failure); // CMPRES1 < 0 on overflow.
+ AddImmediate(end_address, instance, instance_size);
+ // Branch on unsigned overflow.
+ BranchUnsignedLess(end_address, instance, failure);
// Check if the allocation fits into the remaining space.
// instance: potential new object start.
« no previous file with comments | « runtime/vm/assembler_arm64.cc ('k') | runtime/vm/intrinsifier_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698