Skip to content
Commit 82ee16be authored by Vedant Kumar's avatar Vedant Kumar
Browse files

[ubsan] Omit superflous overflow checks for promoted arithmetic (PR20193)

C requires the operands of arithmetic expressions to be promoted if
their types are smaller than an int. Ubsan emits overflow checks when
this sort of type promotion occurs, even if there is no way to actually
get an overflow with the promoted type.

This patch teaches clang how to omit the superflous overflow checks
(addressing PR20193).

Testing: check-clang and check-ubsan.

Differential Revision: https://reviews.llvm.org/D29369

llvm-svn: 296213
parent 65d2e7f7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment