WebAssembly / tail-call

Proposal to add tail calls to WebAssembly
https://webassembly.github.io/tail-call/
Other
111 stars 8 forks source link

Question about tail-invocation stack value length assertion (item 3) #10

Closed jacobmischka closed 4 years ago

jacobmischka commented 4 years ago

I'm reading through the spec, and https://github.com/WebAssembly/tail-call/blame/master/document/core/exec/instructions.rst#L1134 says that there must be at least m values on the stack, but then proceeds to pop n items from it

Should that m be n? Or am I misunderstanding something?

rossberg commented 4 years ago

That's a typo, the assertion should have said n. Fixed now.

jacobmischka commented 4 years ago

Thanks! Should the frame subscript here still be m? Or should that be n as well?

https://github.com/WebAssembly/tail-call/blame/master/document/core/exec/instructions.rst#L1155

rossberg commented 4 years ago

No, that must match the return arity of the function called.