sv-benchmarks
sv-benchmarks copied to clipboard
Undefined behavior in termination-memory-linkedlists
I believe there can be signed integer underflow in termination-memory-linkedlists/cll_by_lseg-alloca_false-termination.c.i. In main
0 is passed as n
to new_cll
, hence -1 is passed to new_lseg
as n
which is recursively called with n = n - 1
. As there is no condition stopping the recursion in this case, there can be integer underflow which leads to undefined behavior. Can somebody please confirm this issue?
@dbeyer I am not sure how to fix this issue. Can somebody have a look at this benchmark, please?