Skip to content

Commit

Permalink
fix: null memory blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
zshipko committed Jan 13, 2024
1 parent d7448be commit 4876191
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/host_function.ml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ module Memory_handle = struct

let of_val_exn t v =
match of_val t v with
| None -> invalid_arg "Memory_block.of_val_exn"
| None ->
{ offs = Unsigned.UInt64.of_int 0; len = Unsigned.UInt64.of_int 0 }
| Some v -> v

let to_val { offs; len = _ } = Val.of_i64 (Unsigned.UInt64.to_int64 offs)
Expand Down

0 comments on commit 4876191

Please sign in to comment.