Skip to content

Commit

Permalink
bfc unsupport InvokeInst
Browse files Browse the repository at this point in the history
  • Loading branch information
Dragon committed Aug 30, 2017
1 parent 42f732c commit ae0e5ac
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions lib/Transforms/Obfuscation/BogusControlFlow.cpp
Expand Up @@ -138,14 +138,26 @@ namespace {
}
// If fla annotations
if(toObfuscate(flag,&F,"bcf")) {
bogus(F);
doF(*F.getParent());
return true;
if (isInvoke(&F)) {
bogus(F);
doF(*F.getParent());
return true;
}
}

return false;
} // end of runOnFunction()

bool isInvoke(Function *f) {
for (Function::iterator i = f->begin(); i != f->end(); ++i) {
BasicBlock *bb = &*i;
if (isa<InvokeInst>(bb->getTerminator())) {
return false;
}
}
return true;
}

void bogus(Function &F) {
// For statistics and debug
++NumFunction;
Expand Down

0 comments on commit ae0e5ac

Please sign in to comment.