os

An operating system
git clone https://erai.gay/code/os/
Log | Files | Refs | README | LICENSE

commit b960d56cde215127a964e237754e1a2b45a31136
parent db41f9afc1e19a2d7c1fe05c58049293507d0959
Author: erai <erai@omiltem.net>
Date:   Sat,  2 Nov 2024 15:47:12 -0400

allow union in dot

Diffstat:
Mcc1.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cc1.c b/cc1.c @@ -725,13 +725,13 @@ typecheck_expr(c: *compiler, d: *decl, n: *node, rhs: int) { typecheck_expr(c, d, n.a, 0); if (n.a.t.kind == TY_PTR) { - if (n.a.t.val.kind != TY_STRUCT) { + if (n.a.t.val.kind != TY_STRUCT && n.a.t.val.kind != TY_UNION) { cdie(c, "dot not a struct"); } v = find(c, n.a.t.val.st.name, n.b.s, 0); } else { - if (n.a.t.kind != TY_STRUCT) { + if (n.a.t.kind != TY_STRUCT && n.a.t.kind != TY_UNION) { cdie(c, "dot not a struct"); }