The GetRegularDreddPreludeCpp and GetRegularDreddPreludeC functions have been modified with the following changes:
(a) The return type is now bool instead of int. If the return expression is of type uint64_t, returning an int could truncate the value. By returning a bool, the result will be 0 if the value compares equal to 0; otherwise, the result will be 1.
(b) Any int literal involved in a bit shift operation is explicitly cast to uint64_t.
Additionally, we have added a test that check that aims to detect this bugs comparing execution output in test/execute/bit_overflow_c and test/execute/bit_overflow_c.
The
GetRegularDreddPreludeCpp
andGetRegularDreddPreludeC
functions have been modified with the following changes:(a) The return type is now
bool
instead ofint
. If the return expression is of typeuint64_t
, returning anint
could truncate the value. By returning abool
, the result will be0
if the value compares equal to0
; otherwise, the result will be1
. (b) Anyint
literal involved in a bit shift operation is explicitly cast touint64_t
.Additionally, we have added a test that check that aims to detect this bugs comparing execution output in
test/execute/bit_overflow_c
andtest/execute/bit_overflow_c
.This PR attempts to fix issue 230.