Skip to content

Commit de191a9

Browse files
committed
Fix order of memory ops
1 parent 1f00387 commit de191a9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

interpreter/spec/decode.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,10 @@ let rec instr s =
284284

285285
| 0x3f ->
286286
expect 0x00 s "zero flag expected";
287-
grow_memory
287+
current_memory
288288
| 0x40 ->
289289
expect 0x00 s "zero flag expected";
290-
current_memory
290+
grow_memory
291291

292292
| 0x41 -> i32_const (at vs32 s)
293293
| 0x42 -> i64_const (at vs64 s)

interpreter/spec/encode.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ let encode m =
209209
| Store ({ty = I64Type; sz = Some Mem32; _} as mo) -> op 0x3e; memop mo
210210
| Store {ty = F32Type | F64Type; sz = Some _; _} -> assert false
211211

212-
| GrowMemory -> op 0x3f; u8 0x00
213-
| CurrentMemory -> op 0x40; u8 0x00
212+
| CurrentMemory -> op 0x3f; u8 0x00
213+
| GrowMemory -> op 0x40; u8 0x00
214214

215215
| Const {it = I32 c; _} -> op 0x41; vs32 c
216216
| Const {it = I64 c; _} -> op 0x42; vs64 c

0 commit comments

Comments
 (0)