summary refs log tree commit diff
path: root/lisc
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-09-22 17:28:03 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-09-22 17:28:07 -0400
commit12cfd93e26a837875fdeef4e871277a67e12d083 (patch)
treea87cc17d66eb8d605b45ffae11a79b7e616821de /lisc
parent3ef1d83866fa07a44cc6ff3908da3fb57de61142 (diff)
downloadroux-12cfd93e26a837875fdeef4e871277a67e12d083.tar.gz
improve error reporting in the parser
Diffstat (limited to 'lisc')
-rw-r--r--lisc/parse.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisc/parse.c b/lisc/parse.c
index 76c2d65..a6957f2 100644
--- a/lisc/parse.c
+++ b/lisc/parse.c
@@ -515,8 +515,12 @@ parseline(PState ps)
 			JRetc, JRet0
 		}[rcls];
 		curb->jmp.rettyn = rtyn;
-		if (rcls < 3)
-			curb->jmp.arg = parseref();
+		if (rcls < 3) {
+			r = parseref();
+			if (req(r, R))
+				err("return value expected");
+			curb->jmp.arg = r;
+		}
 		goto Close;
 	case TJmp:
 		curb->jmp.type = JJmp;