aboutsummaryrefslogtreecommitdiff
path: root/gdb/ChangeLog
diff options
context:
space:
mode:
authorLancelot SIX <lsix@lancelotsix.com>2020-12-24 11:01:21 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2020-12-24 11:02:55 -0500
commitf8676776828c6c0c26da31de0de68c0f4162a8e9 (patch)
treeaf0220f4d16694ca6f0220e3ea33227a92958d34 /gdb/ChangeLog
parent99d8bab0c125618005b96cbca9bae94919ae93b7 (diff)
downloadgdb-f8676776828c6c0c26da31de0de68c0f4162a8e9.zip
gdb-f8676776828c6c0c26da31de0de68c0f4162a8e9.tar.gz
gdb-f8676776828c6c0c26da31de0de68c0f4162a8e9.tar.bz2
gdb/gdbtypes.h: Fix comparison of uninitialized values
When called with an array type of unknown dimensions, is_scalar_type_recursive ended up comparing uninitialized values. This was picked up by the following compiler warning: CXX gdbtypes.o /binutils-gdb/gdb/gdbtypes.c: In function int is_scalar_type_recursive(type*): /binutils-gdb/gdb/gdbtypes.c:3670:38: warning: high_bound may be used uninitialized in this function [-Wmaybe-uninitialized] 3670 | return high_bound == low_bound && is_scalar_type_recursive (elt_type); | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /binutils-gdb/gdb/gdbtypes.c:3670:38: warning: low_bound may be used uninitialized in this function [-Wmaybe-uninitialized] This patch makes sure that when dealing with an array of unknown size (or an array of more than 1 element), is_scalar_type_recursive returns false. gdb/ChangeLog: * gdbtypes.c (is_scalar_type_recursive): Prevent comparison between uninitialized values. Change-Id: Ifc005ced166aa7a065fef3e652977bae67625bf4
Diffstat (limited to 'gdb/ChangeLog')
-rw-r--r--gdb/ChangeLog5
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 26d7f58..ac4caf0 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2020-12-24 Lancelot SIX <lsix@lancelotsix.com>
+
+ * gdbtypes.c (is_scalar_type_recursive): Prevent comparison
+ between uninitialized values.
+
2020-12-23 Andrew Burgess <andrew.burgess@embecosm.com>
* expprint.c (print_subexp_standard): Replace uses of