Index: runtime/vm/simulator_arm64.cc |
diff --git a/runtime/vm/simulator_arm64.cc b/runtime/vm/simulator_arm64.cc |
index ac6fe18793d7ac90b766cb5dfc224e8604cf30a6..cdbf5ce4128aae196e7dcf15a177c87ef1dbb49a 100644 |
--- a/runtime/vm/simulator_arm64.cc |
+++ b/runtime/vm/simulator_arm64.cc |
@@ -900,6 +900,7 @@ void Simulator::set_register( |
Instr* instr, Register reg, int64_t value, R31Type r31t) { |
// Register is in range. |
ASSERT((reg >= 0) && (reg < kNumberOfCpuRegisters)); |
+ ASSERT(instr == NULL || reg != R18); // R18 is globally reserved on iOS. |
if ((reg != R31) || (r31t != R31IsZR)) { |
registers_[reg] = value; |
// If we're setting CSP, make sure it is 16-byte aligned. In truth, CSP |
@@ -1650,24 +1651,24 @@ void Simulator::DoRedirectedCall(Instr* instr) { |
// Zap caller-saved registers, since the actual runtime call could have |
// used them. |
- set_register(instr, R2, icount_); |
- set_register(instr, R3, icount_); |
- set_register(instr, R4, icount_); |
- set_register(instr, R5, icount_); |
- set_register(instr, R6, icount_); |
- set_register(instr, R7, icount_); |
- set_register(instr, R8, icount_); |
- set_register(instr, R9, icount_); |
- set_register(instr, R10, icount_); |
- set_register(instr, R11, icount_); |
- set_register(instr, R12, icount_); |
- set_register(instr, R13, icount_); |
- set_register(instr, R14, icount_); |
- set_register(instr, R15, icount_); |
- set_register(instr, IP0, icount_); |
- set_register(instr, IP1, icount_); |
- set_register(instr, R18, icount_); |
- set_register(instr, LR, icount_); |
+ set_register(NULL, R2, icount_); |
+ set_register(NULL, R3, icount_); |
+ set_register(NULL, R4, icount_); |
+ set_register(NULL, R5, icount_); |
+ set_register(NULL, R6, icount_); |
+ set_register(NULL, R7, icount_); |
+ set_register(NULL, R8, icount_); |
+ set_register(NULL, R9, icount_); |
+ set_register(NULL, R10, icount_); |
+ set_register(NULL, R11, icount_); |
+ set_register(NULL, R12, icount_); |
+ set_register(NULL, R13, icount_); |
+ set_register(NULL, R14, icount_); |
+ set_register(NULL, R15, icount_); |
+ set_register(NULL, IP0, icount_); |
+ set_register(NULL, IP1, icount_); |
+ set_register(NULL, R18, icount_); |
+ set_register(NULL, LR, icount_); |
// TODO(zra): Zap caller-saved fpu registers. |