From 04f9470ee130b6877edcaa202c0a143c9a48fced Mon Sep 17 00:00:00 2001 From: "Charles.Forsyth" Date: Fri, 1 Feb 2008 18:46:35 +0000 Subject: 20080201-1852 --- appl/cmd/limbo/com.b | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'appl/cmd/limbo/com.b') diff --git a/appl/cmd/limbo/com.b b/appl/cmd/limbo/com.b index c14cd923..320d209c 100644 --- a/appl/cmd/limbo/com.b +++ b/appl/cmd/limbo/com.b @@ -388,10 +388,14 @@ fncom(decl: ref Decl) scom(n.left); } pushblock(); - in := genrawop(src, IRET, nil, nil, nil); + valued := decl.ty.tof != tnone; + if(valued) + in := genrawop(src, IRAISE, nil, nil, nil); + else + in = genrawop(src, IRET, nil, nil, nil); popblock(); reach(decl.pc); - if(in.reach != byte 0 && decl.ty.tof != tnone) + if(valued && in.reach != byte 0) error(src.start, "no return at end of function " + dotconv(decl)); # decl.endpc = lastinst; if(labdep != 0) -- cgit v1.2.3