commit 626125cf49771d4a54783df8edbab7214e3e53f6
parent fd1d674c6848ee1b1d083567035ff9b4dd5cfa14
Author: Sebastian <sebastian@sebsite.pw>
Date: Mon, 28 Mar 2022 17:37:14 -0400
parse: fix failed assertion for non-integer enum storage
Signed-off-by: Sebastian <sebastian@sebsite.pw>
Diffstat:
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/src/parse.c b/src/parse.c
@@ -421,10 +421,24 @@ parse_enum_type(struct lexer *lexer)
type->_enum.storage = STORAGE_INT;
unlex(lexer, &tok);
break;
- default:
+ case T_I8:
+ case T_I16:
+ case T_I32:
+ case T_I64:
+ case T_U8:
+ case T_U16:
+ case T_U32:
+ case T_U64:
+ case T_INT:
+ case T_UINT:
+ case T_SIZE:
+ case T_UINTPTR:
+ case T_CHAR:
unlex(lexer, &tok);
type->_enum.storage = parse_integer_type(lexer);
break;
+ default:
+ synassert_msg(false, "Enum storage must be an integer", &tok);
}
want(lexer, T_LBRACE, NULL);
while (tok.token != T_RBRACE) {