bug fix
This commit is contained in:
+3
-3
@@ -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;
|
||||||
|
|||||||
@@ -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]
|
||||||
Reference in New Issue
Block a user