Skip to content
Snippets Groups Projects
Commit edc6fe11 authored by Alessandro Di Federico's avatar Alessandro Di Federico
Browse files

`JTM::setCFGForm`: ignore indirect calls

parent 00f7016c
No related branches found
No related tags found
No related merge requests found
...@@ -1237,6 +1237,12 @@ void JumpTargetManager::setCFGForm(CFGForm NewForm) { ...@@ -1237,6 +1237,12 @@ void JumpTargetManager::setCFGForm(CFGForm NewForm) {
if (auto *FunctionCall = TheModule.getFunction("function_call")) { if (auto *FunctionCall = TheModule.getFunction("function_call")) {
for (User *U : FunctionCall->users()) { for (User *U : FunctionCall->users()) {
auto *Call = cast<CallInst>(U); auto *Call = cast<CallInst>(U);
// Ignore indirect calls
// TODO: why this is needed is unclear
if (isa<ConstantPointerNull>(Call->getArgOperand(0)))
continue;
auto *Terminator = cast<TerminatorInst>(nextNonMarker(Call)); auto *Terminator = cast<TerminatorInst>(nextNonMarker(Call));
assert(Terminator->getNumSuccessors() == 1); assert(Terminator->getNumSuccessors() == 1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment