[PATCH] D40941: [ubsan] Use pass_object_size info in bounds checks (compiler-rt)

Vedant Kumar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 7 16:27:45 PST 2017


vsk added inline comments.


================
Comment at: test/ubsan/TestCases/Misc/bounds.cpp:9
+int get_int(int *const p __attribute__((pass_object_size(0))), int i) {
+  // CHECK-A-2: bounds.cpp:[[@LINE+1]]:10: runtime error: index 2 out of bounds for type 'int *'
+  return p[i];
----------------
george.burgess.iv wrote:
> Do we need extra `RUN:` lines/CHECK prefixes for these? I thought ubsan runtime errors terminated the program.
We don't -- this test doesn't use ubsan's trapping mode. I'll try not to fat-finger the command to generate diff context next time -- this would've been clearer with the compile line present.


https://reviews.llvm.org/D40941





More information about the cfe-commits mailing list