aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2codeview.cc
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2025-09-02 15:58:26 -0700
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2025-09-02 15:58:26 -0700
commit071b4126c613881f4cb25b4e5c39032964827f88 (patch)
tree7ed805786566918630d1d617b1ed8f7310f5fd8e /gcc/dwarf2codeview.cc
parent845d23f3ea08ba873197c275a8857eee7edad996 (diff)
parentcaa1c2f42691d68af4d894a5c3e700ecd2dba080 (diff)
downloadgcc-devel/gfortran-test.zip
gcc-devel/gfortran-test.tar.gz
gcc-devel/gfortran-test.tar.bz2
Merge branch 'master' into gfortran-testdevel/gfortran-test
Diffstat (limited to 'gcc/dwarf2codeview.cc')
-rw-r--r--gcc/dwarf2codeview.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/dwarf2codeview.cc b/gcc/dwarf2codeview.cc
index d98b50c..154cd94 100644
--- a/gcc/dwarf2codeview.cc
+++ b/gcc/dwarf2codeview.cc
@@ -6748,10 +6748,23 @@ get_type_num_array_type (dw_die_ref type, bool in_struct)
c = first_child;
do
{
+ dw_attr_node *upper_bound;
+
c = dw_get_die_sib (c);
if (dw_get_die_tag (c) != DW_TAG_subrange_type)
continue;
+ /* Check that each DW_TAG_subrange_type DIE has a DW_AT_upper_bound
+ attribute that's an unsigned integer. This is the case for C and
+ C++, but not for other languages such as Ada. */
+ upper_bound = get_AT (c, DW_AT_upper_bound);
+ if (!upper_bound)
+ return 0;
+
+ if (AT_class (upper_bound) != dw_val_class_unsigned_const
+ && AT_class (upper_bound) != dw_val_class_unsigned_const_implicit)
+ return 0;
+
dimensions++;
}
while (c != first_child);