Skip to content

Fix overflow issue with c/pthread-driver-races/char_pc8736x_gpio_pc8736x_gpio_*_pc8736x_gpio_set.*

The issue is the shift in the pc8736x_gpio_set(whoop_int, whoop_int) call:

bit = minor & 7;
[...]
(val << bit)

where minor and val both have the value whoop_int. For a whoop_int like for instance

268435431 (00001111 11111111 11111111 11100111)

this causes bit = 7 and shifting the int val (which has the value above) by 7 to the left causes an integer overflow.

The pc8736x_gpio_set() function (and the call to it) is the same for all the benchmarks touched in this patch.

The benchmarks are fixed by adding a second assumption on whoop_int in main().

Copies of the original versions of these benchmarks with suffix -set_ovfl are added as well, their .yml files however only contain the "no-overflow" property with verdict "false".

Merge request reports

Loading