Skip to content

Commit

Permalink
capstone2llvmir: minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterMatula committed Dec 5, 2022
1 parent 528372c commit 66b2930
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/bin2llvmir/providers/abi/arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,19 @@ bool AbiArm::isGeneralPurposeRegister(const llvm::Value* val) const

bool AbiArm::isNopInstruction(cs_insn* insn)
{
cs_arm& insnArm = insn->detail->arm;

// True NOP variants.
//
if (insn->id == ARM_INS_NOP)
{
return true;
}
else if (insn->id == ARM_INS_HINT && insnArm.op_count == 0)
{
return true;
}


return false;
}
Expand Down
6 changes: 4 additions & 2 deletions src/capstone2llvmir/powerpc/powerpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ llvm::Value* Capstone2LlvmIrTranslatorPowerpc_impl::loadRegister(
{
if (r == PPC_REG_INVALID)
{
return nullptr;
// TODO
// return nullptr;
return llvm::UndefValue::get(dstType ? dstType : getDefaultType());
}

llvm::Value* llvmReg = getRegister(r);
Expand Down Expand Up @@ -785,7 +787,7 @@ void Capstone2LlvmIrTranslatorPowerpc_impl::translateClrlwi(cs_insn* i, cs_ppc*
* PPC_INS_CMPW, PPC_INS_CMPWI
* PPC_INS_CMPLD, PPC_INS_CMPLDI
* PPC_INS_CMPLW, PPC_INS_CMPLWI
*
*
* PPC_INS_CMP, PPC_INS_CMPL
*/
void Capstone2LlvmIrTranslatorPowerpc_impl::translateCmp(cs_insn* i, cs_ppc* pi, llvm::IRBuilder<>& irb)
Expand Down

0 comments on commit 66b2930

Please sign in to comment.