Skip to content

Commit

Permalink
bin2llvmir/decoderL fix #335.
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterMatula committed Jun 20, 2018
1 parent 1da7146 commit 1a0bff2
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/bin2llvmir/optimizations/decoder/decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1421,13 +1421,7 @@ void Decoder::handleDelaySlotLikely(
assert(_c2l->getDelaySlot(res.capstoneInsn->id));
assert(_c2l->getDelaySlot(res.capstoneInsn->id) == 1);

assert(isa<BranchInst>(res.branchCall->getNextNode()));
assert(cast<BranchInst>(res.branchCall->getNextNode())->isConditional());

// TODO: This assumes that the pseudo cond branch was solved and cond
// branch created, but we should handle likely ds even if it was not.
//
auto* br = cast<BranchInst>(res.branchCall->getNextNode());
auto* br = dyn_cast<BranchInst>(res.branchCall->getNextNode());
if (br && br->isConditional())
{
auto* nextBb = br->getParent()->getNextNode();
Expand Down Expand Up @@ -1455,6 +1449,11 @@ void Decoder::handleDelaySlotLikely(

_likelyBb2Target.emplace(newBb, target);
}
else
{
// TODO: This assumes that the pseudo cond branch was solved and cond
// branch created, but we should handle likely ds even if it was not.
}
}

void Decoder::resolvePseudoCalls()
Expand Down

0 comments on commit 1a0bff2

Please sign in to comment.