Open nhusung opened 1 year ago
I recently had an issue with Adiar, which uses TPIE. Running the example with clang’s undefined behavior sanitizer revealed unsigned overflows when computing offsets in the following method:
https://github.com/thomasmoelhave/tpie/blob/663a2617f8f98bbc90fa0aa484094fd4cff7a49f/tpie/array.h#L56
The overflow happens e.g. in case of n = (size_t) -1. Using ssize_t (i.e. the signed version of size_t) as argument seems to fix the issue.
n = (size_t) -1
ssize_t
size_t
(I don’t know if this issue is related to my original problem, though.)
I recently had an issue with Adiar, which uses TPIE. Running the example with clang’s undefined behavior sanitizer revealed unsigned overflows when computing offsets in the following method:
https://github.com/thomasmoelhave/tpie/blob/663a2617f8f98bbc90fa0aa484094fd4cff7a49f/tpie/array.h#L56
The overflow happens e.g. in case of
n = (size_t) -1
. Usingssize_t
(i.e. the signed version ofsize_t
) as argument seems to fix the issue.