File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -6615,10 +6615,15 @@ const Value *llvm::getUnderlyingObjectAggressive(const Value *V) {
6615
6615
SmallPtrSet<const Value *, 8 > Visited;
6616
6616
SmallVector<const Value *, 8 > Worklist;
6617
6617
Worklist.push_back (V);
6618
- const Value *Object = nullptr , *FirstObject = nullptr ;
6618
+ const Value *Object = nullptr ;
6619
+ // Used as fallback if we can't find a common underlying object through
6620
+ // recursion.
6621
+ bool First = true ;
6622
+ const Value *FirstObject = getUnderlyingObject (V);
6619
6623
do {
6620
6624
const Value *P = Worklist.pop_back_val ();
6621
- P = getUnderlyingObject (P);
6625
+ P = First ? FirstObject : getUnderlyingObject (P);
6626
+ First = false ;
6622
6627
6623
6628
if (!FirstObject)
6624
6629
FirstObject = P;
You can’t perform that action at this time.
0 commit comments