You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test.c:5:14: warning: possible buffer overflow, pointer '&p[(uint64_t)i]' accesses 4 bytes at offset between 0 and 262140 bytes of local variable 'tab' of size 40 bytes
p[i] = i;
^
The problem comes from the integer promotion rule in C. The comparison i < n actually turns into (unsigned)i < (unsigned)n, which creates temporary variables in the LLVM bitcode:
Using a small integer (e.g,
uint8_t
,int16_t
, etc.) as a loop counter usually results into false positives.For instance:
IKOS returns:
The problem comes from the integer promotion rule in C. The comparison
i < n
actually turns into(unsigned)i < (unsigned)n
, which creates temporary variables in the LLVM bitcode:This results in a lose of precision in the analyzer, similar to #97.
A temporary workaround is to use a relational domain such as dbm or polyhedra.
This false positive appears in our benchmarks:
The text was updated successfully, but these errors were encountered: