[PATCH] D36112: [ubsan] Have -fsanitize=vptr emit a null check if -fsanitize=null isn't available

Vedant Kumar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 31 13:43:23 PDT 2017


vsk created this revision.

In r309007, I made -fsanitize=null a hard prerequisite for -fsanitize=vptr. I did not see the need for the two checks to have separate null checking logic for the same pointer. I expected the two checks to either always be enabled together, or to be mutually compatible.

In the mailing list discussion re: r309007 it became clear that that isn't the case. If a codebase is -fsanitize=vptr clean but not -fsanitize=null clean, it's useful to have -fsanitize=vptr emit its own null check. That's what this patch does: with it, -fsanitize=vptr can be used without -fsanitize=null.


https://reviews.llvm.org/D36112

Files:
  docs/ReleaseNotes.rst
  docs/UndefinedBehaviorSanitizer.rst
  include/clang/Basic/DiagnosticDriverKinds.td
  lib/CodeGen/CGExpr.cpp
  lib/Driver/SanitizerArgs.cpp
  test/CodeGenCXX/catch-undef-behavior.cpp
  test/CodeGenCXX/ubsan-type-checks.cpp
  test/Driver/fsanitize.c
  test/Driver/rtti-options.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36112.108988.patch
Type: text/x-patch
Size: 11278 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170731/cbf700be/attachment.bin>


More information about the cfe-commits mailing list