[PATCH] -fcatch-undefined-behavior with trapping implementation

Chad Rosier mcrosier at apple.com
Mon Jan 28 15:58:30 PST 2013


All,
The attached patch implements the -fcatch-undefined-behavior flag using a trapping implementation; this is much more inline with the original implementation (i.e., pre-Ubsan) and does not require run-time library support.

I've added a the 'undefined-trap' SANITIZER_GROUP that includes all the sanitizers which have low overhead, no ABI or address space layout implications, only catch undefined behavior, *and* do not require run-time library support.  This group should be used in conjunction with the new -fsanitize-undefined-trap-on-error flag.  Thus, the trapping implementation can be invoked using either '-fcatch-undefined-behavior' or '-fsanitize=undefined-trap -fsanitize-undefined-trap-on-error'.  Per a discussion between Richard, Chandler, and I, we are going to continue deprecating the -fcatch-undefined-behavior flag, but don't expect the flag to be removed until after a few releases.

Please take a look.

Thanks to Richard for a great deal of feedback prior to my submission to the list.

  Chad

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fcatch-undefined-behavior.patch
Type: application/octet-stream
Size: 26673 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130128/c50e1f2b/attachment.obj>


More information about the cfe-commits mailing list