]> sourceware.org Git - valgrind.git/commitdiff
Fix reading dwarf info for arrays with lower bound and count
authorPaul Floyd <pjfloyd@wanadoo.fr>
Tue, 5 Jul 2022 10:53:34 +0000 (12:53 +0200)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Tue, 5 Jul 2022 10:53:34 +0000 (12:53 +0200)
There was an out-by-one error, the upper bound was being set to
count whereas it should be count - 1.

This was causing drd/tests/atomic_var to fail because the g_dummy
array seemed to overlap the following s_y variable.

This seems only to have been caused by clang, not GCC, which
presumably supplies lower and upper bound rather than lower
bound and count.

coregrind/m_debuginfo/readdwarf3.c

index 96bd21f7f7528a2e8acb4517a773dc172ee2c2fc..b1a709e6a0667e9e4918a4d32b6863bd37248125 100644 (file)
@@ -4571,7 +4571,7 @@ static void parse_type_DIE ( /*MOD*/XArray* /* of TyEnt */ tyents,
          boundE.Te.Bound.knownL = True;
          boundE.Te.Bound.knownU = True;
          boundE.Te.Bound.boundL = lower;
-         boundE.Te.Bound.boundU = lower + count;
+         boundE.Te.Bound.boundU = lower + count - 1;
       } else {
          /* FIXME: handle more cases */
          goto_bad_DIE;
This page took 2.196742 seconds and 5 git commands to generate.