A lightweight WebAssembly runtime that is fast, secure, and standards-compliant
Trap in wasm entry trampolines if the buffer is too small (#14484)
Alex Crichtonddb318535d35
diff --git a/crates/cranelift/src/compiler.rs b/crates/cranelift/src/compiler.rsindex f540f1b860..29fee69dc7 100644--- a/crates/cranelift/src/compiler.rs+++ b/crates/cranelift/src/compiler.rs@@ -1489,7 +1489,20 @@ impl Compiler {(params[0], params[1], params[2], params[3])};- // First load the actual arguments out of the array.+ // Validate `values_vec_len` as a defense-in-depth measure to ensure+ // it's large enough. This should always be verified dynamically by the+ // runtime, but should this be mistaken we want to halt ASAP as opposed+ // to reading or writing beyond host-side buffers.+ let required_capacity = cmp::max(callee_sig.params().len(), callee_sig.results().len());+ let required_capacity = u32::try_from(required_capacity).unwrap();+ let enough_capacity = builder.ins().icmp_imm_u(+ ir::condcodes::IntCC::UnsignedGreaterThanOrEqual,+ values_vec_len,+ i64::from(required_capacity),+ );+ builder.ins().trapz(enough_capacity, TRAP_INTERNAL_ASSERT);++ // Load the actual arguments out of the array.let mut args = self.load_values_from_array(&mut alias_regions,callee_sig.params(),diff --git a/tests/disas/array-call-trampoline.wat b/tests/disas/array-call-trampoline.watindex a4d20d0ff8..5fa0587b0a 100644--- a/tests/disas/array-call-trampoline.wat+++ b/tests/disas/array-call-trampoline.wat@@ -22,26 +22,29 @@;; jump block1;;;; block1:-;; v4 = load.i32 notrap little region0 v2-;; v5 = load.i64 notrap little region0 v2+16-;; v7 = get_frame_pointer.i64-;; v6 = load.i64 notrap aligned readonly can_move region1 v0+8-;; store notrap aligned region2 v7, v6+72-;; v8 = get_stack_pointer.i64-;; store notrap aligned region3 v8, v6+64-;; v9 = get_exception_handler_address.i64 block1, 0-;; store notrap aligned region4 v9, v6+80-;; try_call fn0(v0, v1, v4, v5), sig0, block2(ret0, ret1), [ default: block3 ]+;; v4 = iconst.i64 2+;; v5 = icmp.i64 uge v3, v4 ; v4 = 2+;; trapz v5, user1+;; v6 = load.i32 notrap little region0 v2+;; v7 = load.i64 notrap little region0 v2+16+;; v9 = get_frame_pointer.i64+;; v8 = load.i64 notrap aligned readonly can_move region1 v0+8+;; store notrap aligned region2 v9, v8+72+;; v10 = get_stack_pointer.i64+;; store notrap aligned region3 v10, v8+64+;; v11 = get_exception_handler_address.i64 block1, 0+;; store notrap aligned region4 v11, v8+80+;; try_call fn0(v0, v1, v6, v7), sig0, block2(ret0, ret1), [ default: block3 ];;-;; block2(v10: i32, v11: i64):-;; store notrap little region0 v10, v2-;; store notrap little region0 v11, v2+16-;; v12 = iconst.i8 1-;; return v12 ; v12 = 1+;; block2(v12: i32, v13: i64):+;; store notrap little region0 v12, v2+;; store notrap little region0 v13, v2+16+;; v14 = iconst.i8 1+;; return v14 ; v14 = 1;;;; block3:-;; v13 = iconst.i64 1-;; store notrap aligned region5 v13, v6+136 ; v13 = 1-;; v14 = iconst.i8 0-;; return v14 ; v14 = 0+;; v15 = iconst.i64 1+;; store notrap aligned region5 v15, v8+136 ; v15 = 1+;; v16 = iconst.i8 0+;; return v16 ; v16 = 0;; }diff --git a/tests/disas/debug.wat b/tests/disas/debug.watindex 74f254de13..5feaca7b62 100644--- a/tests/disas/debug.wat+++ b/tests/disas/debug.wat@@ -23,20 +23,20 @@;; 29: movq %rdi, (%rsp);; nopl (%rax, %rax);; ├─╼ debug frame state (after previous inst): func key DefinedWasmFunction(StaticModuleIndex(0), DefinedFuncIndex(0)), wasm PC 0x24, slot at FP-0x30, locals I32 @ slot+0x8, I32 @ slot+0xc, stack-;; ╰─╼ breakpoint patch: wasm PC 0x24, patch bytes [232, 212, 1, 0, 0]+;; ╰─╼ breakpoint patch: wasm PC 0x24, patch bytes [232, 224, 1, 0, 0];; movl %edx, 0x10(%rsp);; nopl (%rax, %rax);; ├─╼ debug frame state (after previous inst): func key DefinedWasmFunction(StaticModuleIndex(0), DefinedFuncIndex(0)), wasm PC 0x26, slot at FP-0x30, locals I32 @ slot+0x8, I32 @ slot+0xc, stack I32 @ slot+0x10-;; ╰─╼ breakpoint patch: wasm PC 0x26, patch bytes [232, 203, 1, 0, 0]+;; ╰─╼ breakpoint patch: wasm PC 0x26, patch bytes [232, 215, 1, 0, 0];; movl %ecx, 0x14(%rsp);; nopl (%rax, %rax);; ├─╼ debug frame state (after previous inst): func key DefinedWasmFunction(StaticModuleIndex(0), DefinedFuncIndex(0)), wasm PC 0x28, slot at FP-0x30, locals I32 @ slot+0x8, I32 @ slot+0xc, stack I32 @ slot+0x10, I32 @ slot+0x14-;; ╰─╼ breakpoint patch: wasm PC 0x28, patch bytes [232, 194, 1, 0, 0]+;; ╰─╼ breakpoint patch: wasm PC 0x28, patch bytes [232, 206, 1, 0, 0];; leal (%rdx, %rcx), %eax;; movl %eax, 0x10(%rsp);; nopl (%rax, %rax);; ├─╼ debug frame state (after previous inst): func key DefinedWasmFunction(StaticModuleIndex(0), DefinedFuncIndex(0)), wasm PC 0x29, slot at FP-0x30, locals I32 @ slot+0x8, I32 @ slot+0xc, stack I32 @ slot+0x10-;; ╰─╼ breakpoint patch: wasm PC 0x29, patch bytes [232, 182, 1, 0, 0]+;; ╰─╼ breakpoint patch: wasm PC 0x29, patch bytes [232, 194, 1, 0, 0];; movl %eax, 0x10(%rsp);; movq 0x20(%rsp), %r12;; addq $0x30, %rsp@@ -45,9 +45,9 @@;; retq;; 62: movq %rdi, %r12;; 65: xorl %esi, %esi-;; 67: callq 0x1a8+;; 67: callq 0x1b4;; 6c: movq %r12, %rdi-;; 6f: callq 0x1d9+;; 6f: callq 0x1e5;; ╰─╼ debug frame state (after previous inst): func key DefinedWasmFunction(StaticModuleIndex(0), DefinedFuncIndex(0)), wasm PC 0x23, slot at FP-0x30, locals I32 @ slot+0x8, I32 @ slot+0xc, stack;; 74: ud2;;@@ -60,7 +60,9 @@;; movq %r13, 0x20(%rsp);; movq %r14, 0x28(%rsp);; movq %r15, 0x30(%rsp)-;; movl (%rdx), %r8d+;; cmpq $2, %rcx+;; jb 0x136+;; a1: movl (%rdx), %r8d;; movl 0x10(%rdx), %ecx;; movq %rdx, (%rsp);; movq %rbp, %r9@@ -74,7 +76,7 @@;; movq %r10, 8(%rsp);; callq 0;; ├─╼ exception frame offset: SP = FP - 0x40-;; ╰─╼ exception handler: default handler, no dynamic context, handler=0xf8+;; ╰─╼ exception handler: default handler, no dynamic context, handler=0x102;; movq (%rsp), %rdx;; movl %eax, (%rdx);; movl $1, %eax@@ -87,18 +89,19 @@;; movq %rbp, %rsp;; popq %rbp;; retq-;; f8: movq 8(%rsp), %r10-;; fd: movq $1, 0x88(%r10)-;; 108: xorl %eax, %eax-;; 10a: movq 0x10(%rsp), %rbx-;; 10f: movq 0x18(%rsp), %r12-;; 114: movq 0x20(%rsp), %r13-;; 119: movq 0x28(%rsp), %r14-;; 11e: movq 0x30(%rsp), %r15-;; 123: addq $0x40, %rsp-;; 127: movq %rbp, %rsp-;; 12a: popq %rbp-;; 12b: retq+;; 102: movq 8(%rsp), %r10+;; 107: movq $1, 0x88(%r10)+;; 112: xorl %eax, %eax+;; 114: movq 0x10(%rsp), %rbx+;; 119: movq 0x18(%rsp), %r12+;; 11e: movq 0x20(%rsp), %r13+;; 123: movq 0x28(%rsp), %r14+;; 128: movq 0x30(%rsp), %r15+;; 12d: addq $0x40, %rsp+;; 131: movq %rbp, %rsp+;; 134: popq %rbp+;; 135: retq+;; 136: ud2;;;; signatures[0]::wasm_to_array_trampoline:;; pushq %rbp@@ -123,19 +126,19 @@;; callq *%rax;; addq $1, 0x10(%r15);; testb %al, %al-;; je 0x196-;; 180: movl (%rsp), %eax+;; je 0x1a2+;; 18c: movl (%rsp), %eax;; movq 0x20(%rsp), %rbx;; movq 0x28(%rsp), %r15;; addq $0x30, %rsp;; movq %rbp, %rsp;; popq %rbp;; retq-;; 196: movq 0x10(%rbx), %rax-;; 19a: movq 0x148(%rax), %rax-;; 1a1: movq %rbx, %rdi-;; 1a4: callq *%rax-;; 1a6: ud2+;; 1a2: movq 0x10(%rbx), %rax+;; 1a6: movq 0x148(%rax), %rax+;; 1ad: movq %rbx, %rdi+;; 1b0: callq *%rax+;; 1b2: ud2;;;; wasmtime_builtin_trap:;; pushq %rbp@@ -212,8 +215,8 @@;; movq 0x170(%r12), %r11;; callq *%r11;; testb %al, %al-;; je 0x3dd-;; 309: movq (%rsp), %rax+;; je 0x3e9+;; 315: movq (%rsp), %rax;; movq 8(%rsp), %rcx;; movq 0x10(%rsp), %rdx;; movq 0x18(%rsp), %rsi@@ -244,7 +247,7 @@;; movq %rbp, %rsp;; popq %rbp;; retq-;; 3dd: movq 0x148(%r12), %rax-;; 3e5: movq %r13, %rdi-;; 3e8: callq *%rax-;; 3ea: ud2+;; 3e9: movq 0x148(%r12), %rax+;; 3f1: movq %r13, %rdi+;; 3f4: callq *%rax+;; 3f6: ud2diff --git a/tests/disas/elem-segment.wat b/tests/disas/elem-segment.watindex 8293127fa4..8fef96eea2 100644--- a/tests/disas/elem-segment.wat+++ b/tests/disas/elem-segment.wat@@ -23,24 +23,24 @@;; jump block1;;;; block1:-;; v5 = get_frame_pointer.i64-;; v4 = load.i64 notrap aligned readonly can_move region0 v0+8-;; store notrap aligned region1 v5, v4+72-;; v6 = get_stack_pointer.i64-;; store notrap aligned region2 v6, v4+64-;; v7 = get_exception_handler_address.i64 block1, 0-;; store notrap aligned region3 v7, v4+80+;; v7 = get_frame_pointer.i64+;; v6 = load.i64 notrap aligned readonly can_move region0 v0+8+;; store notrap aligned region1 v7, v6+72+;; v8 = get_stack_pointer.i64+;; store notrap aligned region2 v8, v6+64+;; v9 = get_exception_handler_address.i64 block1, 0+;; store notrap aligned region3 v9, v6+80;; try_call fn0(v0, v1), sig0, block2, [ default: block3 ];;;; block2:-;; v8 = iconst.i8 1-;; return v8 ; v8 = 1+;; v13 = iconst.i8 1+;; return v13 ; v13 = 1;;;; block3:-;; v9 = iconst.i64 1-;; store notrap aligned region4 v9, v4+136 ; v9 = 1-;; v10 = iconst.i8 0-;; return v10 ; v10 = 0+;; v11 = iconst.i64 1+;; store notrap aligned region4 v11, v6+136 ; v11 = 1+;; v12 = iconst.i8 0+;; return v12 ; v12 = 0;; };;;; function u2415919104:0(i64 vmctx, i64) tail {diff --git a/tests/disas/exceptions.wat b/tests/disas/exceptions.watindex a544f5701b..eb4b275f10 100644--- a/tests/disas/exceptions.wat+++ b/tests/disas/exceptions.wat@@ -33,7 +33,7 @@;; movq %rdi, %rbx;; movq %rcx, %r13;; movq %rdx, %r14-;; callq 0x401+;; callq 0x40d;; movq %rax, %r12;; movq 0x20(%rbx), %rdx;; movl (%rdx), %esi@@ -62,7 +62,7 @@;; movl $0, 0x14(%rdx);; movq %rbx, %rdi;; movq %rbx, (%rsp)-;; callq 0x42e+;; callq 0x43a;; jmp 0xea;; b6: movl $0x4000002, %esi;; movq 0x28(%rbx), %rax@@ -70,7 +70,7 @@;; movl $0x30, %ecx;; movl $0x10, %r8d;; movq %rbx, %rdi-;; callq 0x398+;; callq 0x3a4;; movq 8(%rbx), %rcx;; movl %eax, %edx;; addq 0x20(%rcx), %rdxdiff --git a/tests/disas/gc/issue-11753.wat b/tests/disas/gc/issue-11753.watindex bfcf95eeb8..cacba1c6d6 100644--- a/tests/disas/gc/issue-11753.wat+++ b/tests/disas/gc/issue-11753.wat@@ -94,7 +94,7 @@;; f4: movl (%rax), %edx;; f6: movl $0x20, %ecx;; fb: movl $0x10, %r8d-;; 101: callq 0x286+;; 101: callq 0x291;; 106: movq 8(%rsp), %r9;; 10b: movq 8(%r9), %rcx;; 10f: movl %eax, %esidiff --git a/tests/disas/issue-12808.wat b/tests/disas/issue-12808.watindex 37c57321f5..5823ce78dc 100644--- a/tests/disas/issue-12808.wat+++ b/tests/disas/issue-12808.wat@@ -23,23 +23,23 @@;; 21: movq %rdi, (%rsp);; nopl (%rax, %rax);; ├─╼ debug frame state (after previous inst): func key DefinedWasmFunction(StaticModuleIndex(0), DefinedFuncIndex(0)), wasm PC 0x1f, slot at FP-0x30, locals , stack-;; ╰─╼ breakpoint patch: wasm PC 0x1f, patch bytes [232, 254, 1, 0, 0]+;; ╰─╼ breakpoint patch: wasm PC 0x1f, patch bytes [232, 10, 2, 0, 0];; movl $0, 8(%rsp);; nopl (%rax, %rax);; ├─╼ debug frame state (after previous inst): func key DefinedWasmFunction(StaticModuleIndex(0), DefinedFuncIndex(0)), wasm PC 0x21, slot at FP-0x30, locals , stack I32 @ slot+0x8-;; ╰─╼ breakpoint patch: wasm PC 0x21, patch bytes [232, 241, 1, 0, 0]+;; ╰─╼ breakpoint patch: wasm PC 0x21, patch bytes [232, 253, 1, 0, 0];; movl $0, 0xc(%rsp);; nopl (%rax, %rax);; ├─╼ debug frame state (after previous inst): func key DefinedWasmFunction(StaticModuleIndex(0), DefinedFuncIndex(0)), wasm PC 0x23, slot at FP-0x30, locals , stack I32 @ slot+0x8, I32 @ slot+0xc-;; ╰─╼ breakpoint patch: wasm PC 0x23, patch bytes [232, 228, 1, 0, 0]+;; ╰─╼ breakpoint patch: wasm PC 0x23, patch bytes [232, 240, 1, 0, 0];; movl $0, 0x10(%rsp);; nopl (%rax, %rax);; ├─╼ debug frame state (after previous inst): func key DefinedWasmFunction(StaticModuleIndex(0), DefinedFuncIndex(0)), wasm PC 0x25, slot at FP-0x30, locals , stack I32 @ slot+0x8, I32 @ slot+0xc, I32 @ slot+0x10-;; ╰─╼ breakpoint patch: wasm PC 0x25, patch bytes [232, 215, 1, 0, 0]+;; ╰─╼ breakpoint patch: wasm PC 0x25, patch bytes [232, 227, 1, 0, 0];; movl $0, 0x14(%rsp);; nopl (%rax, %rax);; ├─╼ debug frame state (after previous inst): func key DefinedWasmFunction(StaticModuleIndex(0), DefinedFuncIndex(0)), wasm PC 0x27, slot at FP-0x30, locals , stack I32 @ slot+0x8, I32 @ slot+0xc, I32 @ slot+0x10, I32 @ slot+0x14-;; ╰─╼ breakpoint patch: wasm PC 0x27, patch bytes [232, 202, 1, 0, 0]+;; ╰─╼ breakpoint patch: wasm PC 0x27, patch bytes [232, 214, 1, 0, 0];; movq 0x30(%rdi), %rax;; movq (%rax), %rcx;; xorl %eax, %eax@@ -48,7 +48,7 @@;; movq %rax, %rcx;; nopl (%rax, %rax);; ├─╼ debug frame state (after previous inst): func key DefinedWasmFunction(StaticModuleIndex(0), DefinedFuncIndex(0)), wasm PC 0x2b, slot at FP-0x30, locals , stack I32 @ slot+0x8, I32 @ slot+0xc-;; ╰─╼ breakpoint patch: wasm PC 0x2b, patch bytes [232, 177, 1, 0, 0]+;; ╰─╼ breakpoint patch: wasm PC 0x2b, patch bytes [232, 189, 1, 0, 0];; xorl %eax, %eax;; movl $0, 8(%rsp);; movl %ecx, 0xc(%rsp)@@ -59,8 +59,8 @@;; retq;; 93: movq %rdi, %r14;; 96: xorl %esi, %esi-;; 98: callq 0x1ca+;; 98: callq 0x1d6;; 9d: movq %r14, %rdi-;; a0: callq 0x1fb+;; a0: callq 0x207;; ╰─╼ debug frame state (after previous inst): func key DefinedWasmFunction(StaticModuleIndex(0), DefinedFuncIndex(0)), wasm PC 0x1e, slot at FP-0x30, locals , stack;; a5: ud2diff --git a/tests/disas/startup-data-active.wat b/tests/disas/startup-data-active.watindex d07e1612d9..928793b0fe 100644--- a/tests/disas/startup-data-active.wat+++ b/tests/disas/startup-data-active.wat@@ -21,24 +21,24 @@;; jump block1;;;; block1:-;; v5 = get_frame_pointer.i64-;; v4 = load.i64 notrap aligned readonly can_move region0 v0+8-;; store notrap aligned region1 v5, v4+72-;; v6 = get_stack_pointer.i64-;; store notrap aligned region2 v6, v4+64-;; v7 = get_exception_handler_address.i64 block1, 0-;; store notrap aligned region3 v7, v4+80+;; v7 = get_frame_pointer.i64+;; v6 = load.i64 notrap aligned readonly can_move region0 v0+8+;; store notrap aligned region1 v7, v6+72+;; v8 = get_stack_pointer.i64+;; store notrap aligned region2 v8, v6+64+;; v9 = get_exception_handler_address.i64 block1, 0+;; store notrap aligned region3 v9, v6+80;; try_call fn0(v0, v1), sig0, block2, [ default: block3 ];;;; block2:-;; v8 = iconst.i8 1-;; return v8 ; v8 = 1+;; v13 = iconst.i8 1+;; return v13 ; v13 = 1;;;; block3:-;; v9 = iconst.i64 1-;; store notrap aligned region4 v9, v4+136 ; v9 = 1-;; v10 = iconst.i8 0-;; return v10 ; v10 = 0+;; v11 = iconst.i64 1+;; store notrap aligned region4 v11, v6+136 ; v11 = 1+;; v12 = iconst.i8 0+;; return v12 ; v12 = 0;; };;;; function u2415919104:0(i64 vmctx, i64) tail {diff --git a/tests/disas/startup-elem-active.wat b/tests/disas/startup-elem-active.watindex c6f17ae3d8..39b1843b6f 100644--- a/tests/disas/startup-elem-active.wat+++ b/tests/disas/startup-elem-active.wat@@ -25,24 +25,24 @@;; jump block1;;;; block1:-;; v5 = get_frame_pointer.i64-;; v4 = load.i64 notrap aligned readonly can_move region0 v0+8-;; store notrap aligned region1 v5, v4+72-;; v6 = get_stack_pointer.i64-;; store notrap aligned region2 v6, v4+64-;; v7 = get_exception_handler_address.i64 block1, 0-;; store notrap aligned region3 v7, v4+80+;; v7 = get_frame_pointer.i64+;; v6 = load.i64 notrap aligned readonly can_move region0 v0+8+;; store notrap aligned region1 v7, v6+72+;; v8 = get_stack_pointer.i64+;; store notrap aligned region2 v8, v6+64+;; v9 = get_exception_handler_address.i64 block1, 0+;; store notrap aligned region3 v9, v6+80;; try_call fn0(v0, v1), sig0, block2, [ default: block3 ];;;; block2:-;; v8 = iconst.i8 1-;; return v8 ; v8 = 1+;; v13 = iconst.i8 1+;; return v13 ; v13 = 1;;;; block3:-;; v9 = iconst.i64 1-;; store notrap aligned region4 v9, v4+136 ; v9 = 1-;; v10 = iconst.i8 0-;; return v10 ; v10 = 0+;; v11 = iconst.i64 1+;; store notrap aligned region4 v11, v6+136 ; v11 = 1+;; v12 = iconst.i8 0+;; return v12 ; v12 = 0;; };;;; function u2415919104:0(i64 vmctx, i64) tail {diff --git a/tests/disas/startup-global.wat b/tests/disas/startup-global.watindex 24e0a26a2f..3e7085d9b2 100644--- a/tests/disas/startup-global.wat+++ b/tests/disas/startup-global.wat@@ -18,24 +18,24 @@;; jump block1;;;; block1:-;; v5 = get_frame_pointer.i64-;; v4 = load.i64 notrap aligned readonly can_move region0 v0+8-;; store notrap aligned region1 v5, v4+72-;; v6 = get_stack_pointer.i64-;; store notrap aligned region2 v6, v4+64-;; v7 = get_exception_handler_address.i64 block1, 0-;; store notrap aligned region3 v7, v4+80+;; v7 = get_frame_pointer.i64+;; v6 = load.i64 notrap aligned readonly can_move region0 v0+8+;; store notrap aligned region1 v7, v6+72+;; v8 = get_stack_pointer.i64+;; store notrap aligned region2 v8, v6+64+;; v9 = get_exception_handler_address.i64 block1, 0+;; store notrap aligned region3 v9, v6+80;; try_call fn0(v0, v1), sig0, block2, [ default: block3 ];;;; block2:-;; v8 = iconst.i8 1-;; return v8 ; v8 = 1+;; v13 = iconst.i8 1+;; return v13 ; v13 = 1;;;; block3:-;; v9 = iconst.i64 1-;; store notrap aligned region4 v9, v4+136 ; v9 = 1-;; v10 = iconst.i8 0-;; return v10 ; v10 = 0+;; v11 = iconst.i64 1+;; store notrap aligned region4 v11, v6+136 ; v11 = 1+;; v12 = iconst.i8 0+;; return v12 ; v12 = 0;; };;;; function u2415919104:0(i64 vmctx, i64) tail {diff --git a/tests/disas/startup-passive-segment.wat b/tests/disas/startup-passive-segment.watindex b71ea27e13..2f2c2561ec 100644--- a/tests/disas/startup-passive-segment.wat+++ b/tests/disas/startup-passive-segment.wat@@ -19,24 +19,24 @@;; jump block1;;;; block1:-;; v5 = get_frame_pointer.i64-;; v4 = load.i64 notrap aligned readonly can_move region0 v0+8-;; store notrap aligned region1 v5, v4+72-;; v6 = get_stack_pointer.i64-;; store notrap aligned region2 v6, v4+64-;; v7 = get_exception_handler_address.i64 block1, 0-;; store notrap aligned region3 v7, v4+80+;; v7 = get_frame_pointer.i64+;; v6 = load.i64 notrap aligned readonly can_move region0 v0+8+;; store notrap aligned region1 v7, v6+72+;; v8 = get_stack_pointer.i64+;; store notrap aligned region2 v8, v6+64+;; v9 = get_exception_handler_address.i64 block1, 0+;; store notrap aligned region3 v9, v6+80;; try_call fn0(v0, v1), sig0, block2, [ default: block3 ];;;; block2:-;; v8 = iconst.i8 1-;; return v8 ; v8 = 1+;; v13 = iconst.i8 1+;; return v13 ; v13 = 1;;;; block3:-;; v9 = iconst.i64 1-;; store notrap aligned region4 v9, v4+136 ; v9 = 1-;; v10 = iconst.i8 0-;; return v10 ; v10 = 0+;; v11 = iconst.i64 1+;; store notrap aligned region4 v11, v6+136 ; v11 = 1+;; v12 = iconst.i8 0+;; return v12 ; v12 = 0;; };;;; function u2415919104:0(i64 vmctx, i64) tail {diff --git a/tests/disas/startup-start.wat b/tests/disas/startup-start.watindex 7fedb1a17d..d45ced7486 100644--- a/tests/disas/startup-start.wat+++ b/tests/disas/startup-start.wat@@ -19,24 +19,24 @@;; jump block1;;;; block1:-;; v5 = get_frame_pointer.i64-;; v4 = load.i64 notrap aligned readonly can_move region0 v0+8-;; store notrap aligned region1 v5, v4+72-;; v6 = get_stack_pointer.i64-;; store notrap aligned region2 v6, v4+64-;; v7 = get_exception_handler_address.i64 block1, 0-;; store notrap aligned region3 v7, v4+80+;; v7 = get_frame_pointer.i64+;; v6 = load.i64 notrap aligned readonly can_move region0 v0+8+;; store notrap aligned region1 v7, v6+72+;; v8 = get_stack_pointer.i64+;; store notrap aligned region2 v8, v6+64+;; v9 = get_exception_handler_address.i64 block1, 0+;; store notrap aligned region3 v9, v6+80;; try_call fn0(v0, v1), sig0, block2, [ default: block3 ];;;; block2:-;; v8 = iconst.i8 1-;; return v8 ; v8 = 1+;; v13 = iconst.i8 1+;; return v13 ; v13 = 1;;;; block3:-;; v9 = iconst.i64 1-;; store notrap aligned region4 v9, v4+136 ; v9 = 1-;; v10 = iconst.i8 0-;; return v10 ; v10 = 0+;; v11 = iconst.i64 1+;; store notrap aligned region4 v11, v6+136 ; v11 = 1+;; v12 = iconst.i8 0+;; return v12 ; v12 = 0;; };;;; function u2415919104:0(i64 vmctx, i64) tail {diff --git a/tests/disas/startup-table-initial-value.wat b/tests/disas/startup-table-initial-value.watindex c7e61fe2b9..fbc5cde0a9 100644--- a/tests/disas/startup-table-initial-value.wat+++ b/tests/disas/startup-table-initial-value.wat@@ -19,24 +19,24 @@;; jump block1;;;; block1:-;; v5 = get_frame_pointer.i64-;; v4 = load.i64 notrap aligned readonly can_move region0 v0+8-;; store notrap aligned region1 v5, v4+72-;; v6 = get_stack_pointer.i64-;; store notrap aligned region2 v6, v4+64-;; v7 = get_exception_handler_address.i64 block1, 0-;; store notrap aligned region3 v7, v4+80+;; v7 = get_frame_pointer.i64+;; v6 = load.i64 notrap aligned readonly can_move region0 v0+8+;; store notrap aligned region1 v7, v6+72+;; v8 = get_stack_pointer.i64+;; store notrap aligned region2 v8, v6+64+;; v9 = get_exception_handler_address.i64 block1, 0+;; store notrap aligned region3 v9, v6+80;; try_call fn0(v0, v1), sig0, block2, [ default: block3 ];;;; block2:-;; v8 = iconst.i8 1-;; return v8 ; v8 = 1+;; v13 = iconst.i8 1+;; return v13 ; v13 = 1;;;; block3:-;; v9 = iconst.i64 1-;; store notrap aligned region4 v9, v4+136 ; v9 = 1-;; v10 = iconst.i8 0-;; return v10 ; v10 = 0+;; v11 = iconst.i64 1+;; store notrap aligned region4 v11, v6+136 ; v11 = 1+;; v12 = iconst.i8 0+;; return v12 ; v12 = 0;; };;;; function u2415919104:0(i64 vmctx, i64) tail {diff --git a/tests/disas/trunc.wat b/tests/disas/trunc.watindex 250b13dcb0..aed4755d4f 100644--- a/tests/disas/trunc.wat+++ b/tests/disas/trunc.wat@@ -24,7 +24,7 @@;; jne 0x101;; 39: movq %rbx, %rdi;; movdqu (%rsp), %xmm0-;; callq 0x259+;; callq 0x264;; movabsq $13830554455654793216, %rax;; movq %rax, %xmm1;; ucomisd %xmm0, %xmm1@@ -55,27 +55,27 @@;; retq;; d3: movl $6, %esi;; d8: movq %rbx, %rdi-;; db: callq 0x286+;; db: callq 0x291;; e0: movq %rbx, %rdi-;; e3: callq 0x2b7+;; e3: callq 0x2c2;; e8: ud2;; ea: movl $6, %esi;; ef: movq %rbx, %rdi-;; f2: callq 0x286+;; f2: callq 0x291;; f7: movq %rbx, %rdi-;; fa: callq 0x2b7+;; fa: callq 0x2c2;; ff: ud2;; 101: movl $8, %esi;; 106: movq %rbx, %rdi-;; 109: callq 0x286+;; 109: callq 0x291;; 10e: movq %rbx, %rdi-;; 111: callq 0x2b7+;; 111: callq 0x2c2;; 116: ud2;; 118: xorl %esi, %esi;; 11a: movq %rbx, %rdi-;; 11d: callq 0x286+;; 11d: callq 0x291;; 122: movq %rbx, %rdi-;; 125: callq 0x2b7+;; 125: callq 0x2c2;; 12a: ud2;; 12c: ud2;; 12e: ud2diff --git a/tests/disas/trunc32.wat b/tests/disas/trunc32.watindex dc903bde99..5d8db810db 100644--- a/tests/disas/trunc32.wat+++ b/tests/disas/trunc32.wat@@ -26,7 +26,7 @@;; jp 0xf6;; jne 0xf6;; 46: movq %rbx, %rdi-;; callq 0x257+;; callq 0x262;; movabsq $13830554455654793216, %rax;; movq %rax, %xmm1;; ucomisd %xmm0, %xmm1@@ -56,27 +56,27 @@;; retq;; c8: movl $6, %esi;; cd: movq %rbx, %rdi-;; d0: callq 0x284+;; d0: callq 0x28f;; d5: movq %rbx, %rdi-;; d8: callq 0x2b5+;; d8: callq 0x2c0;; dd: ud2;; df: movl $6, %esi;; e4: movq %rbx, %rdi-;; e7: callq 0x284+;; e7: callq 0x28f;; ec: movq %rbx, %rdi-;; ef: callq 0x2b5+;; ef: callq 0x2c0;; f4: ud2;; f6: movl $8, %esi;; fb: movq %rbx, %rdi-;; fe: callq 0x284+;; fe: callq 0x28f;; 103: movq %rbx, %rdi-;; 106: callq 0x2b5+;; 106: callq 0x2c0;; 10b: ud2;; 10d: xorl %esi, %esi;; 10f: movq %rbx, %rdi-;; 112: callq 0x284+;; 112: callq 0x28f;; 117: movq %rbx, %rdi-;; 11a: callq 0x2b5+;; 11a: callq 0x2c0;; 11f: ud2;; 121: ud2;; 123: ud2diff --git a/tests/disas/winch/aarch64/call_indirect/call_indirect.wat b/tests/disas/winch/aarch64/call_indirect/call_indirect.watindex eed3fa344b..d285aa51f6 100644--- a/tests/disas/winch/aarch64/call_indirect/call_indirect.wat+++ b/tests/disas/winch/aarch64/call_indirect/call_indirect.wat@@ -85,7 +85,7 @@;; mov x0, x9;; mov x1, #0;; ldur w2, [x28]-;; bl #0x3f8+;; bl #0x400;; e0: add x28, x28, #4;; mov sp, x28;; ldur x9, [x28, #0x14]@@ -151,7 +151,7 @@;; mov x0, x9;; mov x1, #0;; ldur w2, [x28, #0xc]-;; bl #0x3f8+;; bl #0x400;; 1e8: add x28, x28, #0x10;; mov sp, x28;; ldur x9, [x28, #0x18]diff --git a/tests/disas/winch/aarch64/call_indirect/local_arg.wat b/tests/disas/winch/aarch64/call_indirect/local_arg.watindex d81b97733c..2b1fae177d 100644--- a/tests/disas/winch/aarch64/call_indirect/local_arg.wat+++ b/tests/disas/winch/aarch64/call_indirect/local_arg.wat@@ -91,7 +91,7 @@;; mov x0, x9;; mov x1, #0;; ldur w2, [x28]-;; bl #0x438+;; bl #0x440;; 120: add x28, x28, #4;; mov sp, x28;; ldur x9, [x28, #0x14]diff --git a/tests/disas/winch/aarch64/callee_pop/cleanup.wat b/tests/disas/winch/aarch64/callee_pop/cleanup.watindex 3522648d0a..9e7038da7d 100644--- a/tests/disas/winch/aarch64/callee_pop/cleanup.wat+++ b/tests/disas/winch/aarch64/callee_pop/cleanup.wat@@ -292,7 +292,7 @@;; mov x0, x9;; mov x1, #0;; ldur w2, [x28, #0xc]-;; bl #0xce0+;; bl #0xd04;; 43c: add x28, x28, #0x10;; mov sp, x28;; ldur x9, [x28, #0x68]diff --git a/tests/disas/winch/aarch64/global-get-externref-drc.wat b/tests/disas/winch/aarch64/global-get-externref-drc.watindex 22eb456f41..efb3afea01 100644--- a/tests/disas/winch/aarch64/global-get-externref-drc.wat+++ b/tests/disas/winch/aarch64/global-get-externref-drc.wat@@ -76,7 +76,7 @@;; 108: sub x28, x28, #0xc;; mov sp, x28;; mov x0, x9-;; bl #0x29c+;; bl #0x2a4;; 118: add x28, x28, #0xc;; ╰─╼ stack_map: frame_size=48, frame_offsets=[12];; mov sp, x28diff --git a/tests/disas/winch/x64/atomic/notify/notify.wat b/tests/disas/winch/x64/atomic/notify/notify.watindex 27a48a85d7..11ebd7c97d 100644--- a/tests/disas/winch/x64/atomic/notify/notify.wat+++ b/tests/disas/winch/x64/atomic/notify/notify.wat@@ -27,7 +27,7 @@;; movl $0, %esi;; movq 8(%rsp), %rdx;; movl 4(%rsp), %ecx-;; callq 0x17c+;; callq 0x187;; addq $0x10, %rsp;; movq 8(%rsp), %r14;; addq $0x10, %rspdiff --git a/tests/disas/winch/x64/atomic/notify/notify_offset.wat b/tests/disas/winch/x64/atomic/notify/notify_offset.watindex 0ba240722b..189e5f40d3 100644--- a/tests/disas/winch/x64/atomic/notify/notify_offset.wat+++ b/tests/disas/winch/x64/atomic/notify/notify_offset.wat@@ -29,7 +29,7 @@;; movl $0, %esi;; movq 8(%rsp), %rdx;; movl 4(%rsp), %ecx-;; callq 0x18b+;; callq 0x196;; addq $0x10, %rsp;; movq 8(%rsp), %r14;; addq $0x10, %rspdiff --git a/tests/disas/winch/x64/atomic/wait/wait32.wat b/tests/disas/winch/x64/atomic/wait/wait32.watindex d41a4ddd98..b3a005eb02 100644--- a/tests/disas/winch/x64/atomic/wait/wait32.wat+++ b/tests/disas/winch/x64/atomic/wait/wait32.wat@@ -30,7 +30,7 @@;; movq 0x18(%rsp), %rdx;; movl 0x14(%rsp), %ecx;; movq 0xc(%rsp), %r8-;; callq 0x189+;; callq 0x194;; addq $0x20, %rsp;; movq 8(%rsp), %r14;; addq $0x10, %rspdiff --git a/tests/disas/winch/x64/atomic/wait/wait32_offset.wat b/tests/disas/winch/x64/atomic/wait/wait32_offset.watindex 4bc16177c4..8c8887168f 100644--- a/tests/disas/winch/x64/atomic/wait/wait32_offset.wat+++ b/tests/disas/winch/x64/atomic/wait/wait32_offset.wat@@ -35,7 +35,7 @@;; movq 0x18(%rsp), %rdx;; movl 0x14(%rsp), %ecx;; movq 0xc(%rsp), %r8-;; callq 0x198+;; callq 0x1a3;; addq $0x20, %rsp;; movq 8(%rsp), %r14;; addq $0x10, %rspdiff --git a/tests/disas/winch/x64/atomic/wait/wait64.wat b/tests/disas/winch/x64/atomic/wait/wait64.watindex deb252e073..a32cef9310 100644--- a/tests/disas/winch/x64/atomic/wait/wait64.wat+++ b/tests/disas/winch/x64/atomic/wait/wait64.wat@@ -29,7 +29,7 @@;; movq 0x18(%rsp), %rdx;; movq 0x10(%rsp), %rcx;; movq 8(%rsp), %r8-;; callq 0x181+;; callq 0x18c;; addq $0x20, %rsp;; movq 8(%rsp), %r14;; addq $0x10, %rspdiff --git a/tests/disas/winch/x64/atomic/wait/wait64_offset.wat b/tests/disas/winch/x64/atomic/wait/wait64_offset.watindex 322268cf1b..4d5be9eb39 100644--- a/tests/disas/winch/x64/atomic/wait/wait64_offset.wat+++ b/tests/disas/winch/x64/atomic/wait/wait64_offset.wat@@ -34,7 +34,7 @@;; movq 0x18(%rsp), %rdx;; movq 0x10(%rsp), %rcx;; movq 8(%rsp), %r8-;; callq 0x190+;; callq 0x19b;; addq $0x20, %rsp;; movq 8(%rsp), %r14;; addq $0x10, %rspdiff --git a/tests/disas/winch/x64/call_indirect/call_indirect.wat b/tests/disas/winch/x64/call_indirect/call_indirect.watindex 7da1cdbb25..0af89e84c3 100644--- a/tests/disas/winch/x64/call_indirect/call_indirect.wat+++ b/tests/disas/winch/x64/call_indirect/call_indirect.wat@@ -76,7 +76,7 @@;; movq %r14, %rdi;; movl $0, %esi;; movl 8(%rsp), %edx-;; callq 0x32f+;; callq 0x33a;; addq $0xc, %rsp;; movq 0x1c(%rsp), %r14;; jmp 0xdd@@ -126,7 +126,7 @@;; movq %r14, %rdi;; movl $0, %esi;; movl 4(%rsp), %edx-;; callq 0x32f+;; callq 0x33a;; addq $8, %rsp;; movq 0x20(%rsp), %r14;; jmp 0x1b4diff --git a/tests/disas/winch/x64/call_indirect/local_arg.wat b/tests/disas/winch/x64/call_indirect/local_arg.watindex 1033373365..aa960834c2 100644--- a/tests/disas/winch/x64/call_indirect/local_arg.wat+++ b/tests/disas/winch/x64/call_indirect/local_arg.wat@@ -72,7 +72,7 @@;; movq %r14, %rdi;; movl $0, %esi;; movl 8(%rsp), %edx-;; callq 0x33c+;; callq 0x347;; addq $0xc, %rsp;; movq 0x1c(%rsp), %r14;; jmp 0xfediff --git a/tests/disas/winch/x64/callee_pop/cleanup.wat b/tests/disas/winch/x64/callee_pop/cleanup.watindex b272ee421a..1173a29162 100644--- a/tests/disas/winch/x64/callee_pop/cleanup.wat+++ b/tests/disas/winch/x64/callee_pop/cleanup.wat@@ -207,7 +207,7 @@;; movq %r14, %rdi;; movl $0, %esi;; movl 4(%rsp), %edx-;; callq 0xa7a+;; callq 0xaa7;; addq $8, %rsp;; movq 0x70(%rsp), %r14;; jmp 0x307diff --git a/tests/disas/winch/x64/global-get-externref-drc.wat b/tests/disas/winch/x64/global-get-externref-drc.watindex 28bd927e43..b1ef396271 100644--- a/tests/disas/winch/x64/global-get-externref-drc.wat+++ b/tests/disas/winch/x64/global-get-externref-drc.wat@@ -62,7 +62,7 @@;; jb 0xff;; e4: subq $0xc, %rsp;; movq %r14, %rdi-;; callq 0x21a+;; callq 0x225;; addq $0xc, %rsp;; ╰─╼ stack_map: frame_size=32, frame_offsets=[12];; movq 0xc(%rsp), %r14diff --git a/tests/disas/winch/x64/load/grow_load.wat b/tests/disas/winch/x64/load/grow_load.watindex f4af848ed1..3a186ecd41 100644--- a/tests/disas/winch/x64/load/grow_load.wat+++ b/tests/disas/winch/x64/load/grow_load.wat@@ -65,7 +65,7 @@;; movq %r14, %rdi;; movl 0xc(%rsp), %esi;; movl $0, %edx-;; callq 0x302+;; callq 0x30e;; addq $0x10, %rsp;; movq 0x58(%rsp), %r14;; movl %eax, %eaxdiff --git a/tests/disas/winch/x64/ref/func.wat b/tests/disas/winch/x64/ref/func.watindex 49f72b56b7..7e384cc3b7 100644--- a/tests/disas/winch/x64/ref/func.wat+++ b/tests/disas/winch/x64/ref/func.wat@@ -39,7 +39,7 @@;; movq %rsi, (%rsp);; movq %r14, %rdi;; movl $0, %esi-;; callq 0x27d+;; callq 0x288;; movq 8(%rsp), %r14;; addq $0x10, %rsp;; popq %rbpdiff --git a/tests/disas/winch/x64/table/fill.wat b/tests/disas/winch/x64/table/fill.watindex b50b63c5ed..4084913c5e 100644--- a/tests/disas/winch/x64/table/fill.wat+++ b/tests/disas/winch/x64/table/fill.wat@@ -113,7 +113,7 @@;; movq %r14, %rdi;; movl $0, %esi;; movl 0xc(%rsp), %edx-;; callq 0x56e+;; callq 0x57a;; addq $0x10, %rsp;; movq 0x28(%rsp), %r14;; jmp 0x198diff --git a/tests/disas/winch/x64/table/get.wat b/tests/disas/winch/x64/table/get.watindex 203726ad30..4c1b76bbb6 100644--- a/tests/disas/winch/x64/table/get.wat+++ b/tests/disas/winch/x64/table/get.wat@@ -65,7 +65,7 @@;; movq %r14, %rdi;; movl $0, %esi;; movl 0xc(%rsp), %edx-;; callq 0x30a+;; callq 0x315;; addq $0x10, %rsp;; movq 0x18(%rsp), %r14;; jmp 0xfediff --git a/tests/disas/winch/x64/table/grow.wat b/tests/disas/winch/x64/table/grow.watindex b92e861112..1e8f64cc62 100644--- a/tests/disas/winch/x64/table/grow.wat+++ b/tests/disas/winch/x64/table/grow.wat@@ -34,7 +34,7 @@;; movq %r14, %rdi;; movl $0, %esi;; movl (%rsp), %edx-;; callq 0x224+;; callq 0x22f;; addq $4, %rsp;; movq 0x24(%rsp), %r14;; movl (%rsp), %ecxdiff --git a/tests/disas/winch/x64/table/init_copy_drop.wat b/tests/disas/winch/x64/table/init_copy_drop.watindex 3d7ee2e76b..0404964112 100644--- a/tests/disas/winch/x64/table/init_copy_drop.wat+++ b/tests/disas/winch/x64/table/init_copy_drop.wat@@ -138,13 +138,13 @@;; movq %rsi, (%rsp);; movq %r14, %rdi;; movl $0, %esi-;; callq 0x111c+;; callq 0x115e;; movq 8(%rsp), %r14;; pushq %rax;; subq $8, %rsp;; movq %r14, %rdi;; movl $0, %esi-;; callq 0x1147+;; callq 0x1189;; addq $8, %rsp;; movq 0x10(%rsp), %r14;; movq %r14, %r11@@ -190,17 +190,17 @@;; jmp 0x1f4;; 256: movq %r14, %rdi;; movl $0, %esi-;; callq 0x1172+;; callq 0x11b4;; movq 8(%rsp), %r14;; movq %r14, %rdi;; movl $1, %esi-;; callq 0x111c+;; callq 0x115e;; movq 8(%rsp), %r14;; pushq %rax;; subq $8, %rsp;; movq %r14, %rdi;; movl $1, %esi-;; callq 0x1147+;; callq 0x1189;; addq $8, %rsp;; movq 0x10(%rsp), %r14;; movq %r14, %r11@@ -246,7 +246,7 @@;; jmp 0x2ed;; 34f: movq %r14, %rdi;; movl $1, %esi-;; callq 0x1172+;; callq 0x11b4;; movq 8(%rsp), %r14;; movl $5, %eax;; movl $0xf, %ecx@@ -305,7 +305,7 @@;; movq %r14, %rdi;; movl $0, %esi;; movq 8(%rsp), %rdx-;; callq 0x11e1+;; callq 0x1223;; addq $0x10, %rsp;; movq 0x28(%rsp), %r14;; jmp 0x463@@ -389,7 +389,7 @@;; movq %r14, %rdi;; movl $0, %esi;; movq 8(%rsp), %rdx-;; callq 0x11e1+;; callq 0x1223;; addq $0x10, %rsp;; movq 0x28(%rsp), %r14;; jmp 0x5b7@@ -473,7 +473,7 @@;; movq %r14, %rdi;; movl $0, %esi;; movq 8(%rsp), %rdx-;; callq 0x11e1+;; callq 0x1223;; addq $0x10, %rsp;; movq 0x28(%rsp), %r14;; jmp 0x70b@@ -557,7 +557,7 @@;; movq %r14, %rdi;; movl $0, %esi;; movq 8(%rsp), %rdx-;; callq 0x11e1+;; callq 0x1223;; addq $0x10, %rsp;; movq 0x28(%rsp), %r14;; jmp 0x85f@@ -641,7 +641,7 @@;; movq %r14, %rdi;; movl $0, %esi;; movq 8(%rsp), %rdx-;; callq 0x11e1+;; callq 0x1223;; addq $0x10, %rsp;; movq 0x28(%rsp), %r14;; jmp 0x9b3@@ -751,7 +751,7 @@;; movq %r14, %rdi;; movl $0, %esi;; movl 0xc(%rsp), %edx-;; callq 0x11e1+;; callq 0x1223;; addq $0x10, %rsp;; movq 0x18(%rsp), %r14;; jmp 0xb24diff --git a/tests/disas/winch/x64/table/set.wat b/tests/disas/winch/x64/table/set.watindex 3d1d6199ff..0ba26b3ae0 100644--- a/tests/disas/winch/x64/table/set.wat+++ b/tests/disas/winch/x64/table/set.wat@@ -109,7 +109,7 @@;; movq %r14, %rdi;; movl $0, %esi;; movl 8(%rsp), %edx-;; callq 0x4f2+;; callq 0x50a;; addq $0xc, %rsp;; movq 0x1c(%rsp), %r14;; jmp 0x1a2diff --git a/tests/disas/x64/call-indirect-with-gc.wat b/tests/disas/x64/call-indirect-with-gc.watindex d053980e32..9be1ac3559 100644--- a/tests/disas/x64/call-indirect-with-gc.wat+++ b/tests/disas/x64/call-indirect-with-gc.wat@@ -53,7 +53,7 @@;; 8b: xorl %esi, %esi;; 8d: movq %r9, %rbx;; 90: movq %rbx, %rdi-;; 93: callq 0x22f+;; 93: callq 0x23b;; 98: jmp 0x59;; 9d: ud2;; 9f: ud2diff --git a/tests/disas/x64/call-indirect-without-gc.wat b/tests/disas/x64/call-indirect-without-gc.watindex 98c559ff2b..ddcaa7a871 100644--- a/tests/disas/x64/call-indirect-without-gc.wat+++ b/tests/disas/x64/call-indirect-without-gc.wat@@ -53,7 +53,7 @@;; 8b: xorl %esi, %esi;; 8d: movq %r9, %rbx;; 90: movq %rbx, %rdi-;; 93: callq 0x22f+;; 93: callq 0x23b;; 98: jmp 0x59;; 9d: ud2;; 9f: ud2