There might be a problem with this code, if a Daedalus function is called from within an external, because the entire stack (including previous function's stacks) might be cleared:
Instead, we should clear the stack up to the previous call frame (taking into account return values). There should also be an unsafe function to trigger this behaviour from C and wrappers.
There might be a problem with this code, if a Daedalus function is called from within an external, because the entire stack (including previous function's stacks) might be cleared:
https://github.com/GothicKit/ZenKit/blob/7121a33e809905d68a6d13b9eb9fa619f84ae2df/include/zenkit/DaedalusVm.hh#L153-L170
Instead, we should clear the stack up to the previous call frame (taking into account return values). There should also be an unsafe function to trigger this behaviour from C and wrappers.