[PATCH] D28494: Make `@llvm.objectsize` more conservative with null pointers.

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 21 11:36:24 PST 2017


arsenm added inline comments.


================
Comment at: lib/Analysis/MemoryBuiltins.cpp:602-603
 ObjectSizeOffsetVisitor::visitConstantPointerNull(ConstantPointerNull&) {
+  if (NullIsUnknownSize)
+    return unknown();
   return std::make_pair(Zero, Zero);
----------------
I think this will do the wrong thing with non-0 address spaces


================
Comment at: test/Transforms/InstCombine/objsize.ll:268
+  ret i32 %1
+}
----------------
Should add some tests with another address space to make sure it isn't treating 0 as an invalid pointer


https://reviews.llvm.org/D28494





More information about the llvm-commits mailing list