aboutsummaryrefslogtreecommitdiffstats
path: root/parse.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2020-02-19 17:29:11 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-02-20 01:41:31 +0100
commit9ac20e9e3c06918665aada812b0452d88d835291 (patch)
tree78850f8875f75df96952cd83b4820f0d8207158b /parse.c
parent4201c46a529024189737323a4b35b1360a33313c (diff)
downloadsparse-9ac20e9e3c06918665aada812b0452d88d835291.tar.gz
struct_union_enum_specifier: always initialize sym->scope
Currently it is not possible to figure out the scope of the private struct/union/enum type, its ->scope is NULL because bind_symbol() is not called. Change struct_union_enum_specifier() to set sym->scope = block_scope in this case, this is what bind_symbol() does when type has a name. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/parse.c b/parse.c
index fb05253b..0e6f66a8 100644
--- a/parse.c
+++ b/parse.c
@@ -772,6 +772,7 @@ static struct token *struct_union_enum_specifier(enum type type,
}
sym = alloc_symbol(token->pos, type);
+ set_current_scope(sym); // used by dissect
token = parse(token->next, sym);
ctx->ctype.base_type = sym;
token = expect(token, '}', "at end of specifier");