]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Use attribute::unsigned_constant for DW_AT_bit_stride
authorTom Tromey <tromey@adacore.com>
Wed, 19 Mar 2025 13:22:27 +0000 (07:22 -0600)
committerTom Tromey <tromey@adacore.com>
Thu, 24 Apr 2025 19:25:08 +0000 (13:25 -0600)
DW_AT_bit_stride uses an unsigned constant, so make this explicit in
the reader.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32680

gdb/dwarf2/read.c

index 5751e762590469c867299eb99d4ad37e4cf144c9..e29fef0f72a819d02ac29b72c3d87823ef97f1e4 100644 (file)
@@ -12064,7 +12064,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu)
 
   attr = dwarf2_attr (die, DW_AT_bit_stride, cu);
   if (attr != NULL)
-    bit_stride = attr->constant_value (0);
+    bit_stride = attr->unsigned_constant ().value_or (0);
 
   /* Irix 6.2 native cc creates array types without children for
      arrays with unspecified length.  */