summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--parse.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/parse.c b/parse.c
index 31a6d09..f70bbc2 100644
--- a/parse.c
+++ b/parse.c
@@ -545,10 +545,12 @@ parseline(PState ps)
 			Jrets, Jretd,
 			Jretc, Jret0
 		}[rcls];
-		if (rcls < 5) {
+		if (peek() == Tnl)
+			curb->jmp.type = Jret0;
+		else if (rcls < 5) {
 			r = parseref();
 			if (req(r, R))
-				err("return value expected");
+				err("invalid return value");
 			curb->jmp.arg = r;
 		}
 		goto Close;