mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
After compiling OpenCL CTS with -fsanitize=undefined I stumbled upon some signed integer overflows. test_absdiff.cpp:103:24: runtime error: signed integer overflow: 419625160 - -1937831252 cannot be represented in type 'int' test_absdiff.cpp:101:28: runtime error: signed integer overflow: 1277901399 - -1294103363 cannot be represented in type 'int' test_absdiff.cpp:140:24: runtime error: signed integer overflow: 8945130301981949496 - -2872789959208163723 cannot be represented in type 'long int' test_absdiff.cpp:138:29: runtime error: signed integer overflow: 5488544718097069860 - -5558131619970145206 cannot be represented in type 'long int' The result from these operations was used to compare against the kernel result. This patch replaces the abs_diff manual computations by a function that handles the signed integer overflow case.
14 KiB
14 KiB