Skip to content

Commit

Permalink
[CFLGraph] Fix a crash due to missing handling of freeze
Browse files Browse the repository at this point in the history
  • Loading branch information
aqjune committed Mar 20, 2021
1 parent bed9933 commit 319d093
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions llvm/lib/Analysis/CFLGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,13 @@ template <typename CFLAA> class CFLGraphBuilder {
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) {
auto *Op1 = Inst.getOperand(0);
auto *Op2 = Inst.getOperand(1);
Expand Down

0 comments on commit 319d093

Please sign in to comment.