Skip to content

Commit

Permalink
修复 -fla(控制流平坦化)报错
Browse files Browse the repository at this point in the history
  • Loading branch information
CYRUS-STUDIO committed Dec 21, 2024
1 parent 1082301 commit fb76c7a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 2 additions & 0 deletions llvm/lib/Passes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ add_llvm_component_library(LLVMPasses
ADDITIONAL_HEADER_DIRS
${LLVM_MAIN_INCLUDE_DIR}/llvm
${LLVM_MAIN_INCLUDE_DIR}/llvm/Passes
${LLVM_MAIN_INCLUDE_DIR}/llvm/lib/Passes/Obfuscation
${LLVM_MAIN_INCLUDE_DIR}/llvm/lib/Passes/Obfuscation/compat

DEPENDS
intrinsics_gen
Expand Down
4 changes: 1 addition & 3 deletions llvm/lib/Passes/Obfuscation/Flattening.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ bool FlatteningPass::flatten(Function &F) {
// 非条件跳转
else if(BB->getTerminator()->getNumSuccessors() == 1){
BasicBlock *sucBB = BB->getTerminator()->getSuccessor(0);
if (bEntryBB_isConditional) {
entryBB.getTerminator()->eraseFromParent();
}
BB->getTerminator()->eraseFromParent();
ConstantInt *numCase = swInst->findCaseDest(sucBB);
new StoreInst(numCase, swVarPtr, BB);
BranchInst::Create(returnBB, BB);
Expand Down

0 comments on commit fb76c7a

Please sign in to comment.