WebAssembly calling convention impl incorrectly uses make_indirect_byval() · Issue #130442 · rust-lang/rust (original) (raw)

It should use make_indirect() instead. It seems like LLVM ignores sarg on WebAssembly, so it happens to work out fine in the end with the LLVM backend at least, but it is still incorrect per https://github.com/WebAssembly/tool-conventions/blob/main/BasicCABI.md.

For those unaware the difference between the two is that make_indirect() will pass a pointer to the argument somewhere, while make_indirect_byval() is supposed to store the argument at a fixed location on the stack.