diff options
author | Michael Forney <mforney@mforney.org> | 2024-03-16 01:00:00 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2024-03-16 01:00:05 -0700 |
commit | 773bae1fe954fd578a8360c01ca83675bba9e6b4 (patch) | |
tree | c9b0f04bb027f4e1b3951b8194f78d8522790164 | |
parent | ad769cfc78bea044ac4b2f19fe5a0ed79fc423a5 (diff) |
expr: Work around qualified array types for now
This should be fixed so that array types are never qualified, but
for now, just union the array type qualifiers with the element type
qualifiers. See issue 79 for more details.
-rw-r--r-- | expr.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -98,9 +98,14 @@ decay(struct expr *e) tq = e->qual; switch (t->kind) { case TYPEARRAY: + /* + XXX: qualifiers should be applied to the element + type of array types, not the array type itself + assert(tq == QUALNONE); + */ e = mkunaryexpr(TBAND, e); - e->type = mkpointertype(t->base, t->qual); + e->type = mkpointertype(t->base, t->qual | tq); e->decayed = true; break; case TYPEFUNC: |