Commit 56255e04 authored by Karl-Johan Karlsson's avatar Karl-Johan Karlsson
Browse files

[builtins] Fix signed shift overflows in absvti2.c and negvti2.c

When compiling the builtins with the undefined behavior sanitizer and running testcases you end up with the following warning:

UBSan: negvti2.c:22:32: left shift of 1 by 127 places cannot be represented in type 'ti_int' (aka '__int128')
UBSan: absvti2.c:23:23: left shift of 1 by 127 places cannot be represented in type 'ti_int' (aka '__int128')

This can be avoided by doing the shift in a matching unsigned variant of the type.

This is the same kind of fixes that already was done in commit
854686f0

This was found in an out of tree target.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D158816
parent 41985761
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment