Fix a bug spotted by IBM's BEAM checker in VG_(describe_IP).
In the non-XML part buf_dirname was read without observing the
know_dirinfo guard. Now fixed. Initialise buf_dirname nevertheless.
Also remove a dead assignment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14707 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_debuginfo/debuginfo.c b/coregrind/m_debuginfo/debuginfo.c
index 20ae401..11e2037 100644
--- a/coregrind/m_debuginfo/debuginfo.c
+++ b/coregrind/m_debuginfo/debuginfo.c
@@ -2224,7 +2224,7 @@
const HChar *buf_srcloc;
const HChar *buf_dirname;
- Bool know_dirinfo = False;
+ Bool know_dirinfo;
Bool know_fnname;
Bool know_objname;
Bool know_srcloc;
@@ -2268,6 +2268,7 @@
vg_assert (cur_inl);
know_dirinfo = False;
+ buf_dirname = "";
// The fndn_ix and lineno for the caller of the inlined fn is in cur_inl.
if (cur_inl->fndn_ix == 0) {
buf_srcloc = "???";
@@ -2352,7 +2353,7 @@
APPEND(" (");
// Get the directory name, if any, possibly pruned, into dirname.
const HChar* dirname = NULL;
- if (VG_(sizeXA)(VG_(clo_fullpath_after)) > 0) {
+ if (know_dirinfo && VG_(sizeXA)(VG_(clo_fullpath_after)) > 0) {
Int i;
dirname = buf_dirname;
// Remove leading prefixes from the dirname.