salient-lang / salient

http://salient-lang.dev/
MIT License
0 stars 0 forks source link

Tail call stack flattening #11

Closed AjaniBilby closed 5 months ago

AjaniBilby commented 5 months ago

Fix the stack issue created by pr #8, where tail calls now aren't fully applicable due to the stack growing with each call.

Implement the return_call statement so that it does a safety check that none of the values parsed to the call are allocated in the local stack (if they are, throw a compilation error). Once that is done, call the function without shifting the stack forward and use the return_call wasm instruction.