summaryrefslogtreecommitdiff
path: root/parse/infer.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2019-02-28 22:34:52 -0800
committerOri Bernstein <ori@eigenstate.org>2019-02-28 22:34:52 -0800
commit62bd41784b871d00d347787069cc31f4d5e41f4f (patch)
tree3f360e8fe7354520661be25986bb50a4e2bbbe0a /parse/infer.c
parentaebfdd24002430894e5223faa56abbd7d9c27115 (diff)
downloadmc-62bd41784b871d00d347787069cc31f4d5e41f4f.tar.gz
Fix type substitution in sizeof.
Diffstat (limited to 'parse/infer.c')
-rw-r--r--parse/infer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/parse/infer.c b/parse/infer.c
index 98ab589..61af0a5 100644
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -1787,8 +1787,9 @@ inferexpr(Node **np, Type *ret, int *sawret)
delayedcheck(n);
break;
case Osize: /* sizeof(@a) -> size */
- infersub(n, ret, sawret, &isconst);
settype(n, mktylike(n->loc, Tyuint));
+ inferdecl(args[0]);
+ n->expr.isconst = 1;
break;
case Ocall: /* (@a, @b, @c, ... -> @r)(@a, @b, @c, ...) -> @r */
infersub(n, ret, sawret, &isconst);