diff options
| author | 2022-08-08 16:06:08 +0200 | |
|---|---|---|
| committer | 2022-08-08 16:06:08 +0200 | |
| commit | fc55daf22dd890860ac9c1a0a29900977a700df2 (patch) | |
| tree | 96735ed737ae499c9dbbf54ad7bec44c6a4b6eb0 /bootstrap/types.c | |
| parent | cc325dce01101e8b488cfc7e9fddfe0f778c7e17 (diff) | |
start self hosted comler
Diffstat (limited to 'bootstrap/types.c')
| -rw-r--r-- | bootstrap/types.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bootstrap/types.c b/bootstrap/types.c index 78a3df0..9118392 100644 --- a/bootstrap/types.c +++ b/bootstrap/types.c @@ -314,6 +314,10 @@ arraydecay(const struct type *ty) { int numtype2rank(const struct type *a) { a = unconstify(a); + if (a->t == TYenum) { + assert(a->enu.lax); + a = a->enu.intty; + } if (a->t == TYint) { if (a->size < g_targ.intsize || a == ty_int) return 0; @@ -340,7 +344,7 @@ rank2numtype(int r) { bool isnumtype(const struct type *a) { - return a->t == TYint || a->t == TYfloat; + return a->t == TYint || a->t == TYfloat || (a->t == TYenum && a->enu.lax); } // peer type resolution |