racket / ChezScheme

Chez Scheme
Apache License 2.0
110 stars 8 forks source link

Update shift left that might cause ub #7

Closed pmatos closed 5 years ago

pmatos commented 5 years ago

A few shift lefts cause ub because of (1 << n) where n is 31. The constant 1 is signed causing ub. Initially my fix was to do (1U << n) however, I have seen the pattern ((U32)1 << n) elsewhere in the file so decided to follow this.

Caught by ubsan racketcs.