diff options
Diffstat (limited to 'llvm/lib/Analysis/Loads.cpp')
-rw-r--r-- | llvm/lib/Analysis/Loads.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/Loads.cpp b/llvm/lib/Analysis/Loads.cpp index b461c41..425f368 100644 --- a/llvm/lib/Analysis/Loads.cpp +++ b/llvm/lib/Analysis/Loads.cpp @@ -174,14 +174,14 @@ static bool isDereferenceableAndAlignedPointer( // information for values that cannot be freed in the function. // TODO: More precisely check if the pointer can be freed between assumption // and use. - if (CtxI && !V->canBeFreed()) { + if (CtxI && AC && !V->canBeFreed()) { /// Look through assumes to see if both dereferencability and alignment can /// be proven by an assume if needed. RetainedKnowledge AlignRK; RetainedKnowledge DerefRK; bool IsAligned = V->getPointerAlignment(DL) >= Alignment; if (getKnowledgeForValue( - V, {Attribute::Dereferenceable, Attribute::Alignment}, AC, + V, {Attribute::Dereferenceable, Attribute::Alignment}, *AC, [&](RetainedKnowledge RK, Instruction *Assume, auto) { if (!isValidAssumeForContext(Assume, CtxI, DT)) return false; |