qbe

Internal scc patchset buffer for QBE
Log | Files | Refs | README | LICENSE

commit 12cfd93e26a837875fdeef4e871277a67e12d083
parent 3ef1d83866fa07a44cc6ff3908da3fb57de61142
Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date:   Tue, 22 Sep 2015 17:28:03 -0400

improve error reporting in the parser

Diffstat:
Mlisc/parse.c | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git 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;