diff --git a/lib/Analysis/MemoryBuiltins.cpp b/lib/Analysis/MemoryBuiltins.cpp index dd05c298f6e..a565617f21b 100644 --- a/lib/Analysis/MemoryBuiltins.cpp +++ b/lib/Analysis/MemoryBuiltins.cpp @@ -562,7 +562,7 @@ SizeOffsetType ObjectSizeOffsetVisitor::visitPHINode(PHINode &PHI) { SizeOffsetType ObjectSizeOffsetVisitor::visitSelectInst(SelectInst &I) { SizeOffsetType TrueSide = compute(I.getTrueValue()); SizeOffsetType FalseSide = compute(I.getFalseValue()); - if (TrueSide == FalseSide) + if (bothKnown(TrueSide) && bothKnown(FalseSide) && TrueSide == FalseSide) return TrueSide; return unknown(); }