diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2021-08-16 22:16:03 +0200 |
|---|---|---|
| committer | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2021-08-16 22:16:03 +0200 |
| commit | 3af078e9417274ce7b6fdfa76ebd72ac26f87668 (patch) | |
| tree | 1a3b58ce02044bb1cfdfdcea03ed70c1e135f7d4 /src/check_type.cpp | |
| parent | 48c1f0ab590d5f120548a212fff2c762f8818f34 (diff) | |
| parent | 19386814b3ff02914d59ecf20e40191f151d8dbe (diff) | |
Merge branch 'master' into bigint
Diffstat (limited to 'src/check_type.cpp')
| -rw-r--r-- | src/check_type.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp index d2a216c93..7dbd72612 100644 --- a/src/check_type.cpp +++ b/src/check_type.cpp @@ -159,7 +159,12 @@ void check_struct_fields(CheckerContext *ctx, Ast *node, Array<Entity *> *fields Entity *field = alloc_entity_field(ctx->scope, name_token, type, is_using, field_src_index); add_entity(ctx, ctx->scope, name, field); array_add(fields, field); - array_add(tags, p->tag.string); + String tag = p->tag.string; + if (tag.len != 0 && !unquote_string(permanent_allocator(), &tag, 0, tag.text[0] == '`')) { + error(p->tag, "Invalid string literal"); + tag = {}; + } + array_add(tags, tag); field_src_index += 1; } |