This commit is contained in:
Francesco Cozzuto
2023-01-23 22:04:08 +01:00
parent 5234fc73a8
commit 248fc1d1a8
4 changed files with 25 additions and 6 deletions
+3 -3
View File
@@ -1121,9 +1121,9 @@ static int runExecutableAtIndex(Runtime *runtime, Error *error,
return -1; return -1;
// Get return values // Get return values
int retc = 0; int retc = Runtime_GetFrameStackUsage(runtime);
while (retc < MAX_RETS && (rets[retc] = Runtime_Top(runtime, -retc))) for (int i = 0; i < MIN(retc, MAX_RETS); i++)
retc++; rets[i] = Runtime_Top(runtime, i-retc+1);
if (!Runtime_PopFrame(runtime)) if (!Runtime_PopFrame(runtime))
return -1; return -1;
+19
View File
@@ -0,0 +1,19 @@
@type [runtime]
@bytecode
PUSHFUN func, 0, "func";
CALL 0, 3;
PUSHVAR "print";
CALL 3, 1;
POP 1;
EXIT;
func:
PUSHINT 1;
PUSHINT 2;
PUSHINT 3;
RETURN 3;
@output [321]