[PATCH] D15798: Fix for Bug 24852 (crash with -debug -instcombine)

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 6 15:00:21 PST 2016


joker.eph added a comment.

You can use bugpoint to reduce the size of the code (I expect one basic block and 3 instructions to be enough).  For the metadata, you'll need only the one attached to the faulty instruction.

However, as Duncan said, I don't think this is the test we want and a simple C++ unitest seems less fragile to assert that "we can print a value that has no parent but has a metadata ".


================
Comment at: lib/IR/AsmWriter.cpp:3157
@@ -3156,3 +3156,3 @@
     Out << Separator;
-    if (Kind < MDNames.size()) {
+    if (TheModule && Kind < MDNames.size()) {
       Out << "!";
----------------
thanm wrote:
> joker.eph wrote:
> > Why do you need `TheModule` here?
> TheModule is a null pointer in the case where the instruction has no parent BB.
This does not answer my question. Why do you need this check *here*? A few lines above, `TheModule` was dereferenced, it makes sense. Here it does not seem to be the case.


http://reviews.llvm.org/D15798





More information about the llvm-commits mailing list