Skip to content

Commit 54404a1

Browse files
committed
asm: fix the case for non-exported function that returns a value
1 parent 301c583 commit 54404a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

IFPSAsmLib/Assembler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ Dictionary<string, string> aliases
542542
{
543543
if (value.StartsWith(Constants.VARIABLE_ARG_PREFIX)) {
544544
if (!int.TryParse(value.Substring(Constants.VARIABLE_ARG_PREFIX.Length), out var argIdx)) return null;
545-
argIdx--;
545+
if (function.ReturnArgument == null) argIdx--;
546546
if (argIdx < 0) return null;
547547
return function.CreateArgumentVariable(argIdx);
548548
}

0 commit comments

Comments
 (0)