[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
Sat Sep 29 06:06:51 PDT 2018


filcab added a comment.

Thanks for working on this,
Filipe



================
Comment at: lib/ubsan/ubsan_handlers.cc:468
+  case ICCK_IntegerTruncation: { // Legacy, no longer used.
+    // Let's figure out what it should be as per the new types, and upgrade.
+    // If both types are unsigned, then it's an unsigned truncation.
----------------
If we can unambiguously know which type of error we should emit, why not have the clang change, but always emit the ICCK_IntegerTruncation check type? Then we'd only get this small chunk of code added to compiler-rt.


================
Comment at: lib/ubsan/ubsan_handlers.h:128
 enum ImplicitConversionCheckKind : unsigned char {
-  ICCK_IntegerTruncation = 0,
+  ICCK_IntegerTruncation = 0, // Legacy, no longer used.
+  ICCK_UnsignedIntegerTruncation = 1,
----------------
Mention that only clang7.0 emitted this. Then we'll know we can get rid of it if we rev up the check version (breaking the ABI anyway).


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D50902





More information about the llvm-commits mailing list