diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2019-11-07 13:42:55 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2019-11-07 13:42:55 +0000 |
commit | 4dd1eceb9e9acbd57c680780b65f0dd50e83c3af (patch) | |
tree | d5a9cd17c03cfd51453ae6d5ca088f2f1e4b952a /usr.bin | |
parent | 63b8ebac4fa702863e64aa2c7f712ac943708969 (diff) |
Don't stop parsing functions when variables are declared before arguments.
Fix argument types of functions containing a static variable when compiled
with clang(1).
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ctfconv/parse.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/usr.bin/ctfconv/parse.c b/usr.bin/ctfconv/parse.c index 0d1ee731ab6..5c34f2c2c49 100644 --- a/usr.bin/ctfconv/parse.c +++ b/usr.bin/ctfconv/parse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.c,v 1.12 2019/11/07 13:36:03 mpi Exp $ */ +/* $OpenBSD: parse.c,v 1.13 2019/11/07 13:42:54 mpi Exp $ */ /* * Copyright (c) 2016-2017 Martin Pieuchot @@ -1138,12 +1138,19 @@ subparse_arguments(struct dwdie *die, size_t psz, struct itype *it) * Nested declaration. * * This matches the case where a ``struct'', ``union'', - * ``enum'' or ``typedef'' is first declared "inside" a - * function declaration. + * ``enum'', ``typedef'' or ``static'' variable is first + * declared inside a function declaration. */ - if (tag == DW_TAG_structure_type || tag == DW_TAG_union_type || - tag == DW_TAG_enumeration_type || tag == DW_TAG_typedef) + switch (tag) { + case DW_TAG_structure_type: + case DW_TAG_union_type: + case DW_TAG_enumeration_type: + case DW_TAG_typedef: + case DW_TAG_variable: continue; + default: + break; + } if (tag != DW_TAG_formal_parameter) break; |