HomePhabricator

[analyzer] Add a checker for loss of sign or precision in integral casts.

Description

[analyzer] Add a checker for loss of sign or precision in integral casts.

This new checker tries to find execution paths on which implicit integral casts
cause definite loss of information: a certainly-negative integer is converted
to an unsigned integer, or an integer is definitely truncated to fit into
a smaller type.

Being implicit, such casts are likely to produce unexpected results.

Patch by Daniel Marjamäki!

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

Details

Committed
dergachevAug 17 2016, 9:02 AM
Differential Revision
D13126: New static analyzer checker for loss of sign/precision
Parents
rL278940: Support the DW_AT_noreturn DWARF flag.
Branches
Unknown
Tags
Unknown