[all-commits] [llvm/llvm-project] 2d62ce: [ValueTracking] Remove faulty dereference of "Inse...

mikaelholmen via All-commits all-commits at lists.llvm.org
Wed Mar 13 01:59:09 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2d62ce4bebe484f7c6855b9ef479e9b398595df9
      https://github.com/llvm/llvm-project/commit/2d62ce4bebe484f7c6855b9ef479e9b398595df9
  Author: mikaelholmen <mikael.holmen at ericsson.com>
  Date:   2024-03-13 (Wed, 13 Mar 2024)

  Changed paths:
    M llvm/lib/Analysis/ValueTracking.cpp
    A llvm/test/Analysis/Lint/crash_empty_iterator.ll

  Log Message:
  -----------
  [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.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list