|
From: Paul F. <pa...@so...> - 2022-07-05 10:58:13
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=498b5c4286ec631bec43b8c359e3ff00c00b90e7 commit 498b5c4286ec631bec43b8c359e3ff00c00b90e7 Author: Paul Floyd <pj...@wa...> Date: Tue Jul 5 12:53:34 2022 +0200 Fix reading dwarf info for arrays with lower bound and count 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. Diff: --- coregrind/m_debuginfo/readdwarf3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coregrind/m_debuginfo/readdwarf3.c b/coregrind/m_debuginfo/readdwarf3.c index 96bd21f7f7..b1a709e6a0 100644 --- a/coregrind/m_debuginfo/readdwarf3.c +++ b/coregrind/m_debuginfo/readdwarf3.c @@ -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; |