summaryrefslogtreecommitdiff
path: root/parse
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-05-06 18:13:50 -0700
committerOri Bernstein <ori@eigenstate.org>2015-05-06 18:13:50 -0700
commit9bbe6908eeb15650a5f065c8aea8142d1ce905ff (patch)
tree377ad14e171a0dca10ee2325d93eb225664f896c /parse
parente68983d3805bbf857361b69b96407c2ff75b7b27 (diff)
downloadmc-9bbe6908eeb15650a5f065c8aea8142d1ce905ff.tar.gz
Compile error on reaching end of func without return.
Diffstat (limited to 'parse')
-rw-r--r--parse/infer.c2
-rw-r--r--parse/ops.def5
2 files changed, 4 insertions, 3 deletions
diff --git a/parse/infer.c b/parse/infer.c
index 1006a3d..477c1fb 100644
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -1446,7 +1446,7 @@ static void inferexpr(Inferstate *st, Node **np, Type *ret, int *sawret)
}
settype(st, n, type(st, args[0]));
break;
- case Obad: case Ocjmp: case Ojtab: case Oset:
+ case Obad: case Ocjmp: case Ojtab: case Oset: case Odead:
case Oslbase: case Osllen: case Outag:
case Oblit: case Oclear: case Oudata:
case Otrunc: case Oswiden: case Ozwiden:
diff --git a/parse/ops.def b/parse/ops.def
index 2569668..caa6f56 100644
--- a/parse/ops.def
+++ b/parse/ops.def
@@ -56,8 +56,9 @@ O(Ostruct, 1, OTmisc, NULL)
O(Oarr, 1, OTmisc, NULL)
/* all below this point are backend-only */
-O(Ocjmp, 1, OTmisc, NULL) /* conditional jump */
-O(Ojtab, 1, OTmisc, NULL) /* jump table */
+O(Odead, 0, OTmisc, "DEAD") /* unreachable code */
+O(Ocjmp, 1, OTmisc, "CJMP") /* conditional jump */
+O(Ojtab, 1, OTmisc, "JTAB") /* jump table */
O(Oset, 1, OTbin, "=") /* store to var */
O(Osllen, 1, OTpre, "SLLEN") /* size of slice */
O(Oslbase, 1, OTpre, "SLBASE") /* base of sice */