summaryrefslogtreecommitdiff
path: root/include/llvm/Analysis/AliasSetTracker.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Analysis/AliasSetTracker.h')
-rw-r--r--include/llvm/Analysis/AliasSetTracker.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/llvm/Analysis/AliasSetTracker.h b/include/llvm/Analysis/AliasSetTracker.h
index 5d11b22c6eed9..eac97501c759c 100644
--- a/include/llvm/Analysis/AliasSetTracker.h
+++ b/include/llvm/Analysis/AliasSetTracker.h
@@ -121,7 +121,10 @@ class AliasSet : public ilist_node<AliasSet> {
AliasSet *Forward;
/// All instructions without a specific address in this alias set.
- std::vector<AssertingVH<Instruction> > UnknownInsts;
+ /// In rare cases this vector can have a null'ed out WeakVH
+ /// instances (can happen if some other loop pass deletes an
+ /// instruction in this list).
+ std::vector<WeakVH> UnknownInsts;
/// Number of nodes pointing to this AliasSet plus the number of AliasSets
/// forwarding to it.
@@ -171,7 +174,7 @@ class AliasSet : public ilist_node<AliasSet> {
Instruction *getUnknownInst(unsigned i) const {
assert(i < UnknownInsts.size());
- return UnknownInsts[i];
+ return cast_or_null<Instruction>(UnknownInsts[i]);
}
public: