summary refs log tree commit diff
path: root/lisc/parse.c
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-03-17 13:02:18 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-03-17 13:02:18 -0400
commit2889d44f24d8017f527f6f5aa1163065cc57e994 (patch)
tree2a5532cfaa3dea50e63222471d68f909f8915b96 /lisc/parse.c
parent2d9aabefff1e6a2c800ea851502a21aae43457f7 (diff)
downloadroux-2889d44f24d8017f527f6f5aa1163065cc57e994.tar.gz
parse fixes for struct return
Diffstat (limited to 'lisc/parse.c')
-rw-r--r--lisc/parse.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisc/parse.c b/lisc/parse.c
index e91e32d..f98d887 100644
--- a/lisc/parse.c
+++ b/lisc/parse.c
@@ -662,6 +662,7 @@ parsefn()
 	con[0].type = CBits;
 	fn = alloc(sizeof *fn);
 	blink = &fn->start;
+	fn->retty = -1;
 	if (peek() != TGlo)
 		rcls = parsecls(&fn->retty);
 	else
@@ -1047,14 +1048,16 @@ printfn(Fn *fn, FILE *f)
 		case JRet0:
 		case JRetw:
 		case JRetl:
-		case JRetc:
 		case JRets:
 		case JRetd:
+		case JRetc:
 			fprintf(f, "\t%s", jtoa[b->jmp.type]);
 			if (b->jmp.type != JRet0) {
 				fprintf(f, " ");
 				printref(b->jmp.arg, fn, f);
 			}
+			if (b->jmp.type == JRetc)
+				fprintf(f, ", :%s", typ[fn->retty].name);
 			fprintf(f, "\n");
 			break;
 		case JJmp: