diff options
| author | Charles.Forsyth <devnull@localhost> | 2008-02-01 18:46:35 +0000 |
|---|---|---|
| committer | Charles.Forsyth <devnull@localhost> | 2008-02-01 18:46:35 +0000 |
| commit | 04f9470ee130b6877edcaa202c0a143c9a48fced (patch) | |
| tree | 2917c267fefe64b1cf3efcc6a6281115d46e2d8e /appl/cmd/limbo/com.b | |
| parent | acf16bbe632adbae6f2caf3210136c47ecee6a62 (diff) | |
20080201-1852
Diffstat (limited to 'appl/cmd/limbo/com.b')
| -rw-r--r-- | appl/cmd/limbo/com.b | 8 |
1 files changed, 6 insertions, 2 deletions
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) |
