Skip to content

Commit c3cd7c6

Browse files
committed
fix(bcf): Issue that no matching constructor for initialization of 'FCmpInst'
1 parent b210c14 commit c3cd7c6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

llvm-project/llvm/lib/Passes/Obfuscation/BogusControlFlow.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,10 @@ void BogusControlFlowPass::addBogusFlow(BasicBlock *basicBlock, Function &F) {
289289

290290
// The always true condition. End of the first block
291291
Twine *var4 = new Twine("condition");
292+
// FCmpInst *condition =
293+
// new FCmpInst(*basicBlock, FCmpInst::FCMP_TRUE, LHS, RHS, *var4);
292294
FCmpInst *condition =
293-
new FCmpInst(*basicBlock, FCmpInst::FCMP_TRUE, LHS, RHS, *var4);
295+
new FCmpInst(basicBlock, FCmpInst::FCMP_TRUE, LHS, RHS, *var4); // Fix for llvm 19.0.0
294296
DEBUG_WITH_TYPE("gen", errs() << "bcf: Always true condition created\n");
295297

296298
// Jump to the original basic block if the condition is true or
@@ -325,8 +327,10 @@ void BogusControlFlowPass::addBogusFlow(BasicBlock *basicBlock, Function &F) {
325327
originalBB->getTerminator()->eraseFromParent();
326328
// We add at the end a new always true condition
327329
Twine *var6 = new Twine("condition2");
330+
// FCmpInst *condition2 =
331+
// new FCmpInst(*originalBB, CmpInst::FCMP_TRUE, LHS, RHS, *var6);
328332
FCmpInst *condition2 =
329-
new FCmpInst(*originalBB, CmpInst::FCMP_TRUE, LHS, RHS, *var6);
333+
new FCmpInst(originalBB, CmpInst::FCMP_TRUE, LHS, RHS, *var6); // Fix for llvm 19.0.0
330334
BranchInst::Create(originalBBpart2, alteredBB, (Value *)condition2,
331335
originalBB);
332336
DEBUG_WITH_TYPE("gen", errs()

0 commit comments

Comments
 (0)