ref: ddd4c181664eb42d240823f6eab8ba126682938b
parent: b3d69e8d1a3563e89028e41e0c3aba717bfc2555
author: Ori Bernstein <[email protected]>
date: Sun Nov 30 17:18:01 EST 2014
Don't allow attempts to get members in types that don't support them.
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -1795,8 +1795,10 @@
* x.y : membtype
*/
} else {
- if (t->type == Typtr)
+ if (tybase(t)->type == Typtr)
t = tybase(tf(st, t->sub[0]));
+ if (tybase(t)->type != Tystruct)
+ fatal(n, "type %s does not support member operators near %s", tystr(t), ctxstr(st, n));
nl = t->sdecls;
for (i = 0; i < t->nmemb; i++) {
if (!strcmp(namestr(memb), declname(nl[i]))) {