[PATCH] ubsan: add 'UndefinedBehaviorSanitizer' to messages

Ben Boeckel ben.boeckel+llvm at kitware.com
Sat Nov 8 21:32:07 PST 2014


Updates messages to contain the sanitizer which triggered the message. There's a part which is a little nasty (strcmp() to see if 'bool' or 'enum' is the trigger sanitizer), but can be addressed by patching TypeDescriptor to have a flag for 'bool' (not done here).

http://reviews.llvm.org/D5629

Files:
  lib/ubsan/ubsan_diag.cc
  lib/ubsan/ubsan_diag.h
  lib/ubsan/ubsan_handlers.cc
  lib/ubsan/ubsan_handlers_cxx.cc
  test/ubsan/TestCases/Float/cast-overflow.cpp
  test/ubsan/TestCases/Integer/add-overflow.cpp
  test/ubsan/TestCases/Integer/div-overflow.cpp
  test/ubsan/TestCases/Integer/div-zero.cpp
  test/ubsan/TestCases/Integer/incdec-overflow.cpp
  test/ubsan/TestCases/Integer/mul-overflow.cpp
  test/ubsan/TestCases/Integer/negate-overflow.cpp
  test/ubsan/TestCases/Integer/no-recover.cpp
  test/ubsan/TestCases/Integer/shift.cpp
  test/ubsan/TestCases/Integer/sub-overflow.cpp
  test/ubsan/TestCases/Integer/uadd-overflow.cpp
  test/ubsan/TestCases/Integer/uincdec-overflow.cpp
  test/ubsan/TestCases/Integer/umul-overflow.cpp
  test/ubsan/TestCases/Integer/usub-overflow.cpp
  test/ubsan/TestCases/Misc/bool.cpp
  test/ubsan/TestCases/Misc/bounds.cpp
  test/ubsan/TestCases/Misc/deduplication.cpp
  test/ubsan/TestCases/Misc/enum.cpp
  test/ubsan/TestCases/Misc/missing_return.cpp
  test/ubsan/TestCases/Misc/nonnull-arg.cpp
  test/ubsan/TestCases/Misc/nonnull.cpp
  test/ubsan/TestCases/Misc/unreachable.cpp
  test/ubsan/TestCases/Misc/vla.c
  test/ubsan/TestCases/TypeCheck/Function/function.cpp
  test/ubsan/TestCases/TypeCheck/misaligned.cpp
  test/ubsan/TestCases/TypeCheck/null.cpp
  test/ubsan/TestCases/TypeCheck/vptr-virtual-base.cpp
  test/ubsan/TestCases/TypeCheck/vptr.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5629.15956.patch
Type: text/x-patch
Size: 51473 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141109/dd33e6ff/attachment.bin>


More information about the llvm-commits mailing list