diff options
-rw-r--r-- | libctf/ChangeLog | 4 | ||||
-rw-r--r-- | libctf/ctf-decl.c | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/libctf/ChangeLog b/libctf/ChangeLog index fec02ce..cc8e34a 100644 --- a/libctf/ChangeLog +++ b/libctf/ChangeLog @@ -1,3 +1,7 @@ +2021-01-05 Nick Alcock <nick.alcock@oracle.com> + + * ctf-decl.c (ctf_decl_push): Don't print array decls backwards. + 2021-01-04 Nicolas Boulenguez <nicolas@debian.org> PR 27117 diff --git a/libctf/ctf-decl.c b/libctf/ctf-decl.c index f18ca96..232ff5d 100644 --- a/libctf/ctf-decl.c +++ b/libctf/ctf-decl.c @@ -152,11 +152,10 @@ ctf_decl_push (ctf_decl_t *cd, ctf_dict_t *fp, ctf_id_t type) if (prec > cd->cd_qualp && prec < CTF_PREC_ARRAY) cd->cd_qualp = prec; - /* C array declarators are ordered inside out so prepend them. Also by - convention qualifiers of base types precede the type specifier (e.g. + /* By convention qualifiers of base types precede the type specifier (e.g. const int vs. int const) even though the two forms are equivalent. */ - if (kind == CTF_K_ARRAY || (is_qual && prec == CTF_PREC_BASE)) + if (is_qual && prec == CTF_PREC_BASE) ctf_list_prepend (&cd->cd_nodes[prec], cdp); else ctf_list_append (&cd->cd_nodes[prec], cdp); |