racket / ChezScheme

Chez Scheme
Apache License 2.0
110 stars 8 forks source link

Ensure that the literal 1 is wide enough for a shift #23

Closed pmatos closed 4 years ago

pmatos commented 4 years ago

Fixes runtime error found by ubsan.

pmatos commented 4 years ago

Found by CI here: https://github.com/racket/racket/runs/652807311?check_suite_focus=true#step:10:7

pmatos commented 4 years ago

A cast (bigit)1 would be a little better than 1UL, since really the 1 needs to be the same bitwidth as a bignum digit.

My bad - I should have noticed that. Sorry. Updating PR.