mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
C++: Fix use-after-cast bug in SimpleRangeAnalysis
Like everywhere else in the range analysis, operands to comparison operators must be considered in their fully-converted form.
This commit is contained in:
@@ -74,7 +74,7 @@ void use_after_cast(unsigned char c)
|
||||
unsigned short c_times_2 = c + c;
|
||||
if ((unsigned char)c_times_2 == 0)
|
||||
{
|
||||
c_times_2; // BUG: upper bound should be 510, not 0
|
||||
c_times_2;
|
||||
}
|
||||
c_times_2; // BUG: upper bound should be 510, not 255
|
||||
c_times_2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user