@@ -226,19 +226,6 @@ let rec step (c : config) : config =
226
226
with Memory. SizeOverflow | Memory. SizeLimit | Memory. OutOfMemory -> - 1l
227
227
in I32 result :: vs', []
228
228
229
- | MemoryFill , I32 n :: I32 b :: I32 i :: vs' ->
230
- let mem = memory frame.inst (0l @@ e.at) in
231
- let addr = I64_convert. extend_i32_u i in
232
- (try Memory. fill mem addr (Int32. to_int b) n; vs', []
233
- with exn -> vs', [Trapping (memory_error e.at exn ) @@ e.at])
234
-
235
- | MemoryCopy , I32 n :: I32 s :: I32 d :: vs' ->
236
- let mem = memory frame.inst (0l @@ e.at) in
237
- let dst = I64_convert. extend_i32_u d in
238
- let src = I64_convert. extend_i32_u s in
239
- (try Memory. copy mem dst src n; vs', []
240
- with exn -> vs', [Trapping (memory_error e.at exn ) @@ e.at])
241
-
242
229
| Const v , vs ->
243
230
v.it :: vs, []
244
231
@@ -262,6 +249,19 @@ let rec step (c : config) : config =
262
249
(try Eval_numeric. eval_cvtop cvtop v :: vs', []
263
250
with exn -> vs', [Trapping (numeric_error e.at exn ) @@ e.at])
264
251
252
+ | MemoryCopy , I32 n :: I32 s :: I32 d :: vs' ->
253
+ let mem = memory frame.inst (0l @@ e.at) in
254
+ let dst = I64_convert. extend_i32_u d in
255
+ let src = I64_convert. extend_i32_u s in
256
+ (try Memory. copy mem dst src n; vs', []
257
+ with exn -> vs', [Trapping (memory_error e.at exn ) @@ e.at])
258
+
259
+ | MemoryFill , I32 n :: I32 b :: I32 i :: vs' ->
260
+ let mem = memory frame.inst (0l @@ e.at) in
261
+ let addr = I64_convert. extend_i32_u i in
262
+ (try Memory. fill mem addr (Int32. to_int b) n; vs', []
263
+ with exn -> vs', [Trapping (memory_error e.at exn ) @@ e.at])
264
+
265
265
| _ ->
266
266
let s1 = string_of_values (List. rev vs) in
267
267
let s2 = string_of_value_types (List. map type_of (List. rev vs)) in
0 commit comments