wabt icon indicating copy to clipboard operation
wabt copied to clipboard

Fix bug in wasm2c's tail call optimization codegen

Open squk opened this issue 1 year ago • 1 comments

The default wasm-rt implementation defines wasm_rt_memcpy as memcpy which expects void*

squk avatar Oct 18 '24 13:10 squk

I'm a little confused -- we pass the tail-call tests, so... this suggests we need some additional testing here. How is this code-path not hit by the current tests?

keithw avatar Oct 18 '24 18:10 keithw

I guess there are no spec tests for tail-calls that use multi-value? If so that seems like an omission we should fix. @squk , are you up for either:

  • adding a test to this repo (of using tail-call with multi-value) that this PR will make green, and/or
  • submitting one upstream to the tail-call proposal repo?

If you don't have cycles for this or don't want to, I think we could probably take it from here too, but I'd love to have a test somewhere.

keithw avatar Nov 07 '24 03:11 keithw

@keithw I don't think I have the cycles for these tests unfortunately. We're not enabling this optimization for a while it seems

squk avatar Feb 24 '25 16:02 squk

We definitely want this fix and thank you for finding and fixing the bug! If you don't have the cycles to improve the testing, as I said we can probably take it from here.

keithw avatar Feb 24 '25 16:02 keithw