1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00

[CFLGraph] Fix a crash due to missing handling of freeze

https://reviews.llvm.org/D85534#2636321
This commit is contained in:
Juneyoung Lee 2021-03-21 02:14:06 +09:00
parent c789b50f4d
commit 4bb78e2cb0

View File

@ -284,6 +284,13 @@ template <typename CFLAA> class CFLGraphBuilder {
addAssignEdge(Src, &Inst); addAssignEdge(Src, &Inst);
} }
void visitFreezeInst(FreezeInst &Inst) {
// Accessing freeze(ptr) is equivalent to accessing ptr.
// The former raises UB iff latter raises UB.
auto *Src = Inst.getOperand(0);
addAssignEdge(Src, &Inst);
}
void visitBinaryOperator(BinaryOperator &Inst) { void visitBinaryOperator(BinaryOperator &Inst) {
auto *Op1 = Inst.getOperand(0); auto *Op1 = Inst.getOperand(0);
auto *Op2 = Inst.getOperand(1); auto *Op2 = Inst.getOperand(1);