]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Avoid double-decoding in ada_add_global_exceptions
authorTom Tromey <tromey@adacore.com>
Mon, 24 Feb 2025 20:18:27 +0000 (13:18 -0700)
committerTom Tromey <tromey@adacore.com>
Thu, 6 Mar 2025 14:08:14 +0000 (07:08 -0700)
commit5393cfd07abcafad6f3a84dcd263f7248943ace6
tree536cbfdd04bb796ef250235990b7da9074b87895
parent37b0b22f16c73903ad382fb8435bdd4b56464001
Avoid double-decoding in ada_add_global_exceptions

I noticed that ada_add_global_exceptions calls ada_decode on
'search_name' -- and then passes this to name_matches_regex, which
also calls ada_decode.

name_matches_regex is also used later, where the result of
'natural_name ()' is passed to it -- but natural_name also calls
ada_decode.

So, I think the call to ada_decode in name_matches_regex is redundant.
This patch removes it, and turns name_matches_regex into an inner
function to avoid propagating its use.

Note that, right now, the DWARF implementation of
expand_symtabs_matching does not in fact pass an encoded name to this
callback.  So, this code remains slightly (but currently harmlessly)
wrong.  expand_symtabs_matching is fixed by another pending series of
mine.
gdb/ada-lang.c