diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-01-27 23:02:55 +0000 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-01-27 23:02:55 +0000 |
| commit | 31aacd5bf435224c7d8f9b19359175d3e6d25660 (patch) | |
| tree | ab9d62de198d9874e1afb7212ab3feb46fde4f01 /src/types.c | |
| parent | 92453369c5558feaaaa116fbc54968b087e1aeab (diff) | |
Fix parsing for block/if expression within if/for/etc. statementsv0.0.6
Diffstat (limited to 'src/types.c')
| -rw-r--r-- | src/types.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/types.c b/src/types.c index c49ad4a42..7bb849fff 100644 --- a/src/types.c +++ b/src/types.c @@ -1194,7 +1194,9 @@ Selection lookup_field_with_selection(gbAllocator a, Type *type_, String field_n } else if (!is_type_union(type)) { for (isize i = 0; i < type->Record.field_count; i++) { Entity *f = type->Record.fields[i]; - GB_ASSERT(f->kind == Entity_Variable && f->flags & EntityFlag_Field); + if (f->kind != Entity_Variable || (f->flags & EntityFlag_Field) == 0) { + continue; + } String str = f->token.string; if (str_eq(field_name, str)) { selection_add_index(&sel, i); // HACK(bill): Leaky memory |