Skip to content

Commit b6c9d5c

Browse files
committed
fix(bcf): Issue that use of undeclared identifier 'valueEscapes'
1 parent d5c7d33 commit b6c9d5c

File tree

1 file changed

+14
-0
lines changed
  • llvm-project/llvm/lib/Passes/Obfuscation

1 file changed

+14
-0
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,20 @@ bool llvm::toObfuscate(bool flag, Function *f,
164164
return false;
165165
}
166166

167+
// Fix use of undeclared identifier 'valueEscapes'
168+
static bool valueEscapes(const Instruction &Inst) {
169+
if (!Inst.getType()->isSized())
170+
return false;
171+
172+
const BasicBlock *BB = Inst.getParent();
173+
for (const User *U : Inst.users()) {
174+
const Instruction *UI = cast<Instruction>(U);
175+
if (UI->getParent() != BB || isa<PHINode>(UI))
176+
return true;
177+
}
178+
return false;
179+
}
180+
167181
/** LLVM\llvm\lib\Transforms\Scalar\Reg2Mem.cpp
168182
* @brief 修复PHI指令和逃逸变量
169183
*

0 commit comments

Comments
 (0)