Closed ammarbinfaisal closed 1 year ago
In the bytecode of a function we dont keep track of how many arguments it is supposed to receive. And in the vm we just add them to the locals. This is an issue when we have to convert that bytecode to assembly.
Save the param count in the bytecode itself. That;s the easiest fix.
Or in the disassemble function also extract info from CALL ops to se how many args being to which function.
https://github.com/abooishaaq/sahl/commit/a3eddcb3770970472a7e27bff13a40eaa9f1dcea fixes this issue
In the bytecode of a function we dont keep track of how many arguments it is supposed to receive. And in the vm we just add them to the locals. This is an issue when we have to convert that bytecode to assembly.