Skip to content

Commit

Permalink
Fix handling of native int constants
Browse files Browse the repository at this point in the history
They were wrongly truncated to 31 bits.
  • Loading branch information
vouillon committed Nov 27, 2023
1 parent 0e36628 commit d67c215
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions compiler/lib/parse_bytecode.ml
Original file line number Diff line number Diff line change
Expand Up @@ -468,11 +468,7 @@ end = struct
| Some name when same_ident name ident_32 -> Int (Int32, (Obj.magic x : int32))
| Some name when same_ident name ident_native ->
let i : nativeint = Obj.magic x in
Int
( Native
, match target with
| `JavaScript -> Int32.of_nativeint_warning_on_overflow i
| `Wasm -> Int31.of_nativeint_warning_on_overflow i )
Int (Native, Int32.of_nativeint_warning_on_overflow i)
| Some name when same_ident name ident_64 -> Int64 (Obj.magic x : int64)
| Some name ->
failwith
Expand Down

0 comments on commit d67c215

Please sign in to comment.