[PATCH] D50902: [compiler-rt][ubsan] Split Implicit Integer Truncation Sanitizer into unsigned and signed checks

Filipe Cabecinhas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 27 07:54:02 PDT 2018


filcab added inline comments.


================
Comment at: lib/ubsan/ubsan_handlers.h:128
 enum ImplicitConversionCheckKind : unsigned char {
-  ICCK_IntegerTruncation = 0,
+  // Kind 0 was used briefly.
+  ICCK_UnsignedIntegerTruncation = 1,
----------------
We did release an llvm version with that kind, though.

Can you re-add it, with an "... (un)signed..." in the error message (or something better, of course), so we still support files compiled with an older (but released) compiler, please?


================
Comment at: test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation-summary.cpp:10
+  uint8_t t0 = int32_t(-1);
+  // CHECK-NOTYPE: SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior {{.*}}summary.cpp:[[@LINE-1]]:16
+  // CHECK-TYPE: SUMMARY: UndefinedBehaviorSanitizer: implicit-signed-integer-truncation {{.*}}summary.cpp:[[@LINE-2]]:16
----------------
Can't we simply not test on the SUMMARY line (test on the error line) and allow standalone too? I don't see what we gain by restricting the test.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D50902





More information about the llvm-commits mailing list