[PATCH] D34563: [ubsan] Disable the object-size check at -O0

via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 23 13:59:57 PDT 2017


Good point, it makes sense to hand users a warning when they explicitly enable -fsanitize=object-size at -O0. I've added in the diagnostic. PTAL.



vedant

> On Jun 23, 2017, at 1:05 PM, Justin Bogner <mail at justinbogner.com> wrote:
> 
>> +++ test/Driver/fsanitize-object-size.c
>> @@ -0,0 +1,25 @@
>> +// Check that the object size check is disabled at -O0.
>> +//
>> +// RUN: %clang -target x86_64-linux-gnu -fsanitize=object-size %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OSIZE
>> +// RUN: %clang -target x86_64-linux-gnu -fsanitize=object-size %s -O0 -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OSIZE
> 
> This isn't great - the user explicitly opted in to object-size but they
> don't get it. We should either diagnose this and behave as is, or just
> enable the sanitizer even though it's not effective for forwards
> compatibility.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170623/20d47c7f/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: disable-object-size-check-O0.diff
Type: application/octet-stream
Size: 13751 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170623/20d47c7f/attachment-0001.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170623/20d47c7f/attachment-0003.html>


More information about the cfe-commits mailing list