[PATCH] D49946: Fix crash in bounds checking

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 30 12:56:22 PDT 2018


eugenis added inline comments.


================
Comment at: lib/Transforms/Instrumentation/BoundsChecking.cpp:159
+  SmallVector<std::pair<Instruction *, Value *>, 4> TrapInfo;
+  for (Instruction *Inst : WorkList) {
+    Value *Or = nullptr;
----------------
The loop over worklist can be replaced with a loop over instructions(F).

It would work because we no longer create new basic blocks in the loop, and new instructions are added before the current iterator position, so they will not be observed in the following iterations.


https://reviews.llvm.org/D49946





More information about the llvm-commits mailing list