Skip to content

Commit

Permalink
Fixed misinterpretation of i32 as i64
Browse files Browse the repository at this point in the history
  • Loading branch information
Southporter committed May 22, 2024
1 parent 70d1e40 commit b04f882
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
- name: Run mem64 test
run: |
zig build -Doptimize=ReleaseSafe test-mem64
zig build test-mem64
- name: Run wasi testsuite
run: |
Expand Down
6 changes: 5 additions & 1 deletion src/vm_stack.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2102,7 +2102,11 @@ const InstructionFuncs = struct {
};

if (num_pages >= 0 and memory_instance.grow(@as(usize, @intCast(num_pages)))) {
stack.pushI32(old_num_pages);
switch (memory_instance.limits.indexType()) {
.I32 => stack.pushI32(old_num_pages),
.I64 => stack.pushI64(old_num_pages),
else => unreachable,
}
try @call(.always_tail, InstructionFuncs.lookup(code[pc + 1].opcode), .{ pc + 1, code, stack });
} else {
switch (memory_instance.limits.indexType()) {
Expand Down

0 comments on commit b04f882

Please sign in to comment.