LLVM stack overflow fix

This commit is contained in:
Nekotekina 2015-03-24 18:17:53 +03:00
parent a342de6143
commit ec8519b969
3 changed files with 17 additions and 15 deletions

View file

@ -2019,14 +2019,14 @@ void Compiler::HACK(u32 index) {
CreateBranch(nullptr, lr_i32, false, true);
}
// copied from Compiler::SC()
auto ret_i1 = Call<bool>("PollStatus", m_poll_status_function, m_state.args[CompileTaskState::Args::State]);
auto cmp_i1 = m_ir_builder->CreateICmpEQ(ret_i1, m_ir_builder->getInt1(true));
auto then_bb = GetBasicBlockFromAddress(m_state.current_instruction_address, "then_true");
auto merge_bb = GetBasicBlockFromAddress(m_state.current_instruction_address, "merge_true");
m_ir_builder->CreateCondBr(cmp_i1, then_bb, merge_bb);
m_ir_builder->SetInsertPoint(then_bb);
m_ir_builder->CreateRet(m_ir_builder->getInt32(0xFFFFFFFF));
m_ir_builder->SetInsertPoint(merge_bb);
//auto ret_i1 = Call<bool>("PollStatus", m_poll_status_function, m_state.args[CompileTaskState::Args::State]);
//auto cmp_i1 = m_ir_builder->CreateICmpEQ(ret_i1, m_ir_builder->getInt1(true));
//auto then_bb = GetBasicBlockFromAddress(m_state.current_instruction_address, "then_true");
//auto merge_bb = GetBasicBlockFromAddress(m_state.current_instruction_address, "merge_true");
//m_ir_builder->CreateCondBr(cmp_i1, then_bb, merge_bb);
//m_ir_builder->SetInsertPoint(then_bb);
//m_ir_builder->CreateRet(m_ir_builder->getInt32(0xFFFFFFFF));
//m_ir_builder->SetInsertPoint(merge_bb);
}
void Compiler::SC(u32 lev) {
@ -6087,7 +6087,9 @@ BranchType ppu_recompiler_llvm::GetBranchTypeFromInstruction(u32 instruction) {
} else if (field2 == 528) {
type = lk ? BranchType::FunctionCall : BranchType::LocalBranch;
}
} else if (field1 == 1 && (instruction & EIF_PERFORM_BLR)) {
type = BranchType::Return;
}
return type;
}