Permalink
Browse files

bfc unsupport InvokeInst

  • Loading branch information...
Dragon
Dragon committed Aug 30, 2017
1 parent 42f732c commit ae0e5acd873cd9a8c839a013a635422022fd0d6b
Showing with 15 additions and 3 deletions.
  1. +15 −3 lib/Transforms/Obfuscation/BogusControlFlow.cpp
@@ -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;

0 comments on commit ae0e5ac

Please sign in to comment.