harec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit a35d59d84bd01618230ab42d70a912b78705eda5
parent ff1e5296a1218f839990c94ed7d3f2a0a445e856
Author: Eyal Sawady <ecs@d2evs.net>
Date:   Mon, 18 Jan 2021 00:34:26 -0500

type_is_integer, type_is_numeric: fix for aliases

Diffstat:
Msrc/types.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/types.c b/src/types.c @@ -117,7 +117,6 @@ type_is_integer(const struct type *type) { switch (type->storage) { case TYPE_STORAGE_VOID: - case TYPE_STORAGE_ALIAS: case TYPE_STORAGE_ARRAY: case TYPE_STORAGE_FUNCTION: case TYPE_STORAGE_POINTER: @@ -147,6 +146,8 @@ type_is_integer(const struct type *type) case TYPE_STORAGE_UINT: case TYPE_STORAGE_UINTPTR: return true; + case TYPE_STORAGE_ALIAS: + return type_is_numeric(type_dealias(type)); } assert(0); // Unreachable } @@ -156,7 +157,6 @@ type_is_numeric(const struct type *type) { switch (type->storage) { case TYPE_STORAGE_VOID: - case TYPE_STORAGE_ALIAS: case TYPE_STORAGE_ARRAY: case TYPE_STORAGE_FUNCTION: case TYPE_STORAGE_POINTER: @@ -186,6 +186,8 @@ type_is_numeric(const struct type *type) case TYPE_STORAGE_UINT: case TYPE_STORAGE_UINTPTR: return true; + case TYPE_STORAGE_ALIAS: + return type_is_integer(type_dealias(type)); } assert(0); // Unreachable }