commit 2889d44f24d8017f527f6f5aa1163065cc57e994
parent 2d9aabefff1e6a2c800ea851502a21aae43457f7
Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date: Thu, 17 Mar 2016 13:02:18 -0400
parse fixes for struct return
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git 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: