[PATCH] [ubsan] Emit single check for Shl

Will Dietz wdietz2 at illinois.edu
Mon Feb 25 14:40:00 PST 2013


Great, thanks for taking a look.

Didn't know about omitting labels in -Asserts, updated tests
accordingly and committed as r176056.

(After confirming works on an -Asserts build)

Thanks!

~Will

On Mon, Feb 25, 2013 at 3:51 PM, Richard Smith <richard at metafoo.co.uk> wrote:
> On Mon, Feb 25, 2013 at 1:02 PM, Will Dietz <wdietz2 at illinois.edu> wrote:
>>
>> See attached.
>>
>> This is important to avoid warning twice on shifts that fail both
>> checks, like "1 << -1".
>>
>> The branching is done to avoid executing the second check's shift with
>> invalid operands (poisoning the result), especially since we already
>> know the shift is invalid.
>
>
> Thanks, this generally looks good, except that you shouldn't test for labels
> in the IR, since we don't emit them in -Asserts builds.



More information about the cfe-commits mailing list