Skip to content

Commit 09dc24f

Browse files
committed
Add more comments about overflow hazards.
1 parent 4be37cf commit 09dc24f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ml-proto/src/spec/eval.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ let rec eval_expr (c : config) (e : expr) =
154154
| CallIndirect (x, e1, es) ->
155155
let i = int32 (eval_expr c e1) e1.at in
156156
let vs = List.map (fun vo -> some (eval_expr c vo) vo.at) es in
157+
(* TODO: The conversion to int could overflow. *)
157158
eval_func c.modul (table c x (Int32.to_int i @@ e1.at)) vs
158159

159160
| Return eo ->
@@ -224,6 +225,7 @@ let rec eval_expr (c : config) (e : expr) =
224225
let i = int32 (eval_expr c e) e.at in
225226
if (I32.rem_u i (page_size c)) <> I32.zero then
226227
error e.at "runtime: resize_memory operand not multiple of page_size";
228+
(* TODO: The conversion to int could overflow. *)
227229
Memory.resize c.modul.memory (Int32.to_int i);
228230
None
229231

0 commit comments

Comments
 (0)