Fixing LR argument for indirect branches.

This commit is contained in:
Ben Vanik 2013-10-19 19:59:09 -07:00
parent 10c69cfaf2
commit e842a6614a
2 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,6 @@ void _cdecl XeTrap(
void* _cdecl XeIndirectBranch( void* _cdecl XeIndirectBranch(
xe_ppc_state_t* state, uint64_t target, uint64_t br_ia) { xe_ppc_state_t* state, uint64_t target, uint64_t br_ia) {
// TODO(benvanik): track this statistic - this path is very slow! // TODO(benvanik): track this statistic - this path is very slow!
XEASSERT(target != 0xBEBEBEBE);
Processor* processor = state->processor; Processor* processor = state->processor;
void* target_ptr = processor->GetFunctionPointer((uint32_t)target); void* target_ptr = processor->GetFunctionPointer((uint32_t)target);
// target_ptr will be null when the given target is not a function. // target_ptr will be null when the given target is not a function.

View File

@ -1131,6 +1131,7 @@ int X64Emitter::GenerateIndirectionBranch(uint32_t cia, GpVar& target,
// Call target. // Call target.
// void fn(ppc_state*, uint64_t) // void fn(ppc_state*, uint64_t)
c.mov(arg2, imm(cia + 4));
call = c.call(target_ptr); call = c.call(target_ptr);
call->setComment("Indirection branch"); call->setComment("Indirection branch");
call->setPrototype(kX86FuncConvDefault, call->setPrototype(kX86FuncConvDefault,