Skip to content

Commit

Permalink
simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
zapashcanon committed Aug 23, 2024
1 parent 377223b commit 1cdfff0
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/interpret/interpret.ml
Original file line number Diff line number Diff line change
Expand Up @@ -939,15 +939,11 @@ module Make (P : Interpret_intf.P) :
let* mem = Env.get_memory env mem_0 in
let old_size = I64.of_int32 @@ Memory.size mem in
let max_size = Memory.get_limit_max mem in
let delta, stack =
(* TODO: convert to unsigned *)
Stack.pop_i32 stack
in
let delta, stack = Stack.pop_i32 stack in
let delta = I64.(of_int32 delta * page_size) in
let new_size = I64.(old_size + delta) in
let> too_big =
Bool.or_ I64.(delta < const_i64 0L)
@@ Bool.or_ I64.(ge_u new_size (page_size * page_size))
Bool.or_ I64.(ge_u new_size (page_size * page_size))
@@
match max_size with
| Some max -> I64.(new_size > max * page_size)
Expand Down

0 comments on commit 1cdfff0

Please sign in to comment.