Index: runtime/vm/assembler_arm.cc |
=================================================================== |
--- runtime/vm/assembler_arm.cc (revision 45353) |
+++ runtime/vm/assembler_arm.cc (working copy) |
@@ -3387,7 +3387,8 @@ |
const uword top_address = heap->TopAddress(space); |
LoadImmediate(temp_reg, top_address); |
ldr(instance_reg, Address(temp_reg)); |
- AddImmediate(instance_reg, instance_size); |
+ // TODO(koda): Protect against unsigned overflow here. |
+ AddImmediateSetFlags(instance_reg, instance_reg, instance_size); |
// instance_reg: potential next object start. |
const uword end_address = heap->EndAddress(space); |
@@ -3434,8 +3435,8 @@ |
Heap::Space space = heap->SpaceForAllocation(cid); |
LoadImmediate(temp1, heap->TopAddress(space)); |
ldr(instance, Address(temp1, 0)); // Potential new object start. |
- AddImmediate(end_address, instance, instance_size); |
- b(failure, VS); |
+ AddImmediateSetFlags(end_address, instance, instance_size); |
+ b(failure, CS); // Branch if unsigned overflow. |
// Check if the allocation fits into the remaining space. |
// instance: potential new object start. |