sv-benchmarks icon indicating copy to clipboard operation
sv-benchmarks copied to clipboard

Undefined behavior in termination-memory-linkedlists

Open xvitovs1 opened this issue 6 years ago • 1 comments

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?

xvitovs1 avatar Nov 26 '18 15:11 xvitovs1

@dbeyer I am not sure how to fix this issue. Can somebody have a look at this benchmark, please?

xvitovs1 avatar Dec 03 '18 10:12 xvitovs1