A static analyzer pointed out that find_vec_in_debug_names will use
the contents of a unique_ptr after it has been destroyed. This patch
fixes the bug by hoisting the declaration into the appropriate
enclosing block.
I'm checking this in as obvious.
gdb/ChangeLog
2019-07-01 Tom Tromey <tromey@adacore.com>
* dwarf2read.c
(dw2_debug_names_iterator::find_vec_in_debug_names): Hoist
declaration of without_params. Fix formatting.
2019-07-01 Tom Tromey <tromey@adacore.com>
2019-07-01 Tom Tromey <tromey@adacore.com>
+ * dwarf2read.c
+ (dw2_debug_names_iterator::find_vec_in_debug_names): Hoist
+ declaration of without_params. Fix formatting.
+
+2019-07-01 Tom Tromey <tromey@adacore.com>
+
* ada-exp.y (find_primitive_type): Update.
* ada-lang.h (ada_lookup_symbol): Update.
* ada-lang.c (ada_lookup_symbol): Remove "is_a_field_of_this"
* ada-exp.y (find_primitive_type): Update.
* ada-lang.h (ada_lookup_symbol): Update.
* ada-lang.c (ada_lookup_symbol): Remove "is_a_field_of_this"
{
int (*cmp) (const char *, const char *);
{
int (*cmp) (const char *, const char *);
+ gdb::unique_xmalloc_ptr<char> without_params;
if (current_language->la_language == language_cplus
|| current_language->la_language == language_fortran
|| current_language->la_language == language_d)
if (current_language->la_language == language_cplus
|| current_language->la_language == language_fortran
|| current_language->la_language == language_d)
if (strchr (name, '(') != NULL)
{
if (strchr (name, '(') != NULL)
{
- gdb::unique_xmalloc_ptr<char> without_params
- = cp_remove_params (name);
-
+ without_params = cp_remove_params (name);
if (without_params != NULL)
if (without_params != NULL)
- {
- name = without_params.get();
- }
+ name = without_params.get ();