sds icon indicating copy to clipboard operation
sds copied to clipboard

Potential undefined behavior when negating value in sdsll2str

Open ghost opened this issue 7 years ago • 0 comments

When compiling with UndefinedBehaviorSanitizer and running the tests (CC=clang-6.0 CFLAGS='-fsanitize=undefined', the following error is raised:

[...]
6 - sdscatprintf() seems working in the base case: PASSED
sds.c:446:23: runtime error: negation of -9223372036854775808 cannot be represented 
in type 'long long'; cast to an unsigned type to negate this value to itself
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior sds.c:446:23 in
[...]

ghost avatar Jan 28 '18 23:01 ghost