cmd/internal/obj/wasm: use i64 for large return addr

This commit is contained in:
Zxilly 2025-04-09 06:21:38 +08:00
parent 559b5d814f
commit 267d9a1a03
No known key found for this signature in database
GPG Key ID: 47AB1DEC841BC6A2
1 changed files with 4 additions and 3 deletions

View File

@ -1006,9 +1006,10 @@ func genWasmExportWrapper(s *obj.LSym, appendp func(p *obj.Prog, as obj.As, args
// In the unwinding case, we call wasm_pc_f_loop_export to handle stack switch and rewinding,
// until a normal return (non-unwinding) back to this function.
p = appendp(p, AIf)
p = appendp(p, AI32Const, retAddr)
p = appendp(p, AI32Const, constAddr(16))
p = appendp(p, AI32ShrU)
p = appendp(p, AI64Const, retAddr)
p = appendp(p, AI64Const, constAddr(16))
p = appendp(p, AI64ShrU)
p = appendp(p, AI32WrapI64)
p = appendp(p, ACall, obj.Addr{Type: obj.TYPE_MEM, Name: obj.NAME_EXTERN, Sym: wasm_pc_f_loop_export})
p = appendp(p, AEnd)