diff options
author | mikaelholmen <mikael.holmen@ericsson.com> | 2024-03-13 09:58:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-13 09:58:47 +0100 |
commit | 2d62ce4bebe484f7c6855b9ef479e9b398595df9 (patch) | |
tree | a0fe5a85d132b13b2def88f839e785a0c015eb65 /llvm/lib/Analysis/ValueTracking.cpp | |
parent | 676c495195748e8ab2755b62153a718a53f7dae9 (diff) | |
download | llvm-2d62ce4bebe484f7c6855b9ef479e9b398595df9.zip llvm-2d62ce4bebe484f7c6855b9ef479e9b398595df9.tar.gz llvm-2d62ce4bebe484f7c6855b9ef479e9b398595df9.tar.bz2 |
[ValueTracking] Remove faulty dereference of "InsertBefore" (#85034)
In 2fe81edef6f
[NFC][RemoveDIs] Insert instruction using iterators in Transforms/
we changed
if (*req_idx != *i)
return FindInsertedValue(I->getAggregateOperand(), idx_range,
- InsertBefore);
+ *InsertBefore);
}
but there is no guarantee that is InsertBefore is non-empty at that
point,
which we e.g can see in the added testcase.
Instead just pass on the optional InsertBefore in the recursive call to
FindInsertedValue, as we do at several other places already.
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r-- | llvm/lib/Analysis/ValueTracking.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index 371ad41..8a4a2c4f9 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -5709,7 +5709,7 @@ llvm::FindInsertedValue(Value *V, ArrayRef<unsigned> idx_range, // looking for, then. if (*req_idx != *i) return FindInsertedValue(I->getAggregateOperand(), idx_range, - *InsertBefore); + InsertBefore); } // If we end up here, the indices of the insertvalue match with those // requested (though possibly only partially). Now we recursively look at |