stedolan / malfunction

Malfunctional Programming
Other
338 stars 19 forks source link

Semantics of lsl #1

Closed chambart closed 8 years ago

chambart commented 8 years ago

Sadly the lsl operator is not very well defined in OCaml when shifting by more than a word size.

For instance on amd64, x lsl 65 is equivalent to x lsl 1, while on arm64 it will be 0. The evaluator should reject it.

stedolan commented 8 years ago

Nice catch, thanks! (I wish everyone used ARM's behaviour for shifts).