[PATCH] D49946: Fix crash in bounds checking

Joel Galenson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 30 08:49:00 PDT 2018


jgalenson added inline comments.


================
Comment at: lib/Transforms/Instrumentation/BoundsChecking.cpp:184
 
-  bool MadeChange = false;
+  SmallVector<std::pair<Value *, BuilderTy>, 4> TrapInfo;
   for (Instruction *Inst : WorkList) {
----------------
eugenis wrote:
> It's very uncommon to store builders in containers. Replace with an instruction pointer.
> 
> TrapInfo can be combined with WorkList, and both loops can be merged in one.
> 
How did you want me to combine TrapInfo with WorkList?  To insert the traps, I need both the original instruction (to create the builder) and the newly-created Or.  I could change Worklist to hold a tuple with an optional Or, but that seems more complicated than using two lists like this.


https://reviews.llvm.org/D49946





More information about the llvm-commits mailing list