[PATCH] D125781: [llvm-dva] 06 - Warning and internal options

Pavel Samolysov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 2 09:43:48 PDT 2022


psamolysov added inline comments.


================
Comment at: llvm/unittests/DebugInfo/LogicalView/WarningInternalTest.cpp:52-54
+  if (Iter != AddressToLineData.begin())
+    Iter = std::prev(Iter);
+  return (Iter != AddressToLineData.end()) ? Iter->second : nullptr;
----------------
Here could be a bug: if `AddressToLineData.upper_bound(Address)` returns `AddressToLineData.end()`, `AddressToLineData.end()` is definitely not equal to `AddressToLineData.begin()`, `Iter` changes it's value to an element previous to the `end` and the check `Iter != AddressToLineData.end()` is forever be true.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125781/new/

https://reviews.llvm.org/D125781



More information about the llvm-commits mailing list