From: Brendan Hansen Date: Tue, 18 Aug 2020 14:02:26 +0000 (-0500) Subject: bug fix with named struct members X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=4a4e66fcd659abad5c81d76afd6f2e91c2743bf8;p=onyx.git bug fix with named struct members --- diff --git a/onyx b/onyx index 05b31d23..090504e3 100755 Binary files a/onyx and b/onyx differ diff --git a/src/onyxparser.c b/src/onyxparser.c index 3296377a..c5da87a2 100644 --- a/src/onyxparser.c +++ b/src/onyxparser.c @@ -192,8 +192,13 @@ static b32 parse_possible_struct_literal(OnyxParser* parser, AstTyped** ret) { AstStructLiteral* sl = make_node(AstStructLiteral, Ast_Kind_Struct_Literal); sl->token = parser->curr; + bh_arr_new(global_heap_allocator, sl->values, 4); bh_arr_new(global_heap_allocator, sl->named_values, 4); + fori (i, 0, 4) { + sl->values[i] = NULL; + sl->named_values[i] = NULL; + } if (symbol2 != NULL) { AstTyped *package = make_node(AstTyped, Ast_Kind_Symbol);