From: Tom Tromey Date: Tue, 17 Mar 2020 00:32:44 +0000 (-0600) Subject: Initialize base_value in pascal_object_print_value X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=771dd3a88b1f0e03a110fc4f2207913df45f8b4b;p=binutils-gdb.git Initialize base_value in pascal_object_print_value The val_print removal series introduced a new possibly-uninitialized warning in p-valprint.c. Examination of the code shows that the warning does not indicate a real bug, so this patch silences the warning by setting the variable in the catch clause of a try/catch. (The obvious initialization did not work due to a "goto" in this function.) gdb/ChangeLog 2020-03-16 Tom Tromey * p-valprint.c (pascal_object_print_value): Initialize base_value. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7c506578738..cfd8c5b9d24 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2020-03-16 Tom Tromey + + * p-valprint.c (pascal_object_print_value): Initialize + base_value. + 2020-03-16 Anton Kolesov Shahab Vahedi diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c index 35a4e59d250..cbd7fb75e24 100644 --- a/gdb/p-valprint.c +++ b/gdb/p-valprint.c @@ -739,6 +739,7 @@ pascal_object_print_value (struct value *val, struct ui_file *stream, } catch (const gdb_exception_error &ex) { + base_value = nullptr; if (ex.error == NOT_AVAILABLE_ERROR) skip = -1; else