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

Unified Diff: runtime/vm/simulator_mips.cc

Issue 13489008: Fixes a bug in MIPS simulator runtime call handling. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
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
« runtime/tests/vm/vm.status ('K') | « runtime/tests/vm/vm.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/simulator_mips.cc
===================================================================
--- runtime/vm/simulator_mips.cc (revision 20905)
+++ runtime/vm/simulator_mips.cc (working copy)
@@ -289,7 +289,11 @@
while (!done) {
if (last_pc != sim_->get_pc()) {
last_pc = sim_->get_pc();
- Disassembler::Disassemble(last_pc, last_pc + Instr::kInstrSize);
+ if (Simulator::IsIllegalAddress(last_pc)) {
+ OS::Print("pc is out of bounds: 0x%"Px"\n", last_pc);
+ } else {
+ Disassembler::Disassemble(last_pc, last_pc + Instr::kInstrSize);
+ }
}
char* line = ReadLine("sim> ");
if (line == NULL) {
@@ -904,8 +908,8 @@
set_fregister(static_cast<FRegister>(i), zap_dvalue);
}
- // Return.
- set_pc(saved_ra);
+ // Return. Subtract to account for pc_ increment after return.
+ set_pc(saved_ra - Instr::kInstrSize);
}
} else {
SimulatorDebugger dbg(this);
@@ -984,10 +988,10 @@
ASSERT(instr->RsField() != instr->RdField());
ASSERT(!delay_slot_);
// Format(instr, "jalr'hint 'rd, rs");
+ set_register(instr->RdField(), pc_ + 2*Instr::kInstrSize);
uword next_pc = get_register(instr->RsField());
ExecuteDelaySlot();
// Set return address to be the instruction after the delay slot.
- set_register(instr->RdField(), pc_ + Instr::kInstrSize);
pc_ = next_pc - Instr::kInstrSize; // Account for regular PC increment.
break;
}
« runtime/tests/vm/vm.status ('K') | « runtime/tests/vm/vm.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698