[PATCH] D33911: [ubsan] Detect invalid unsigned pointer index expression (compiler-rt)

John Regehr via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 5 13:03:07 PDT 2017


regehr added inline comments.


================
Comment at: test/ubsan/TestCases/Pointer/unsigned-index-expression.cpp:6
+  unsigned long long offset = -1;
+  char *p = (char *)7;
+
----------------
I don't know that it matters too much in practice but it may be better to make p a valid pointer instead of casting 7 into a pointer, which is at best implementation defined behavior.


https://reviews.llvm.org/D33911





More information about the llvm-commits mailing list