Fix random crash due to non-init inlparser when --read-var-info given but not --read-inline-info
Wrong place for the assertion for the inlparser
+ move the "zero the parsers" out of the "if VG_(clo*)" conditions
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14044 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_debuginfo/readdwarf3.c b/coregrind/m_debuginfo/readdwarf3.c
index cd95ab0..b4e8556 100644
--- a/coregrind/m_debuginfo/readdwarf3.c
+++ b/coregrind/m_debuginfo/readdwarf3.c
@@ -4047,6 +4047,11 @@
TRACE_SYMTAB("\n");
}
+ /* Zero out all parsers. Parsers will really be initialised
+ according to VG_(clo_read_*_info). */
+ VG_(memset)( &varparser, 0, sizeof(varparser) );
+ VG_(memset)( &inlparser, 0, sizeof(inlparser) );
+ VG_(memset)( &typarser, 0, sizeof(typarser) );
if (VG_(clo_read_var_info)) {
/* We'll park the harvested type information in here. Also create
@@ -4099,7 +4104,6 @@
types. It'll be discarded as soon as we've completed the CU,
since the resulting information is tipped in to 'tyents' as it
is generated. */
- VG_(memset)( &typarser, 0, sizeof(typarser) );
typarser.sp = -1;
typarser.language = '?';
for (i = 0; i < N_D3_TYPE_STACK; i++) {
@@ -4107,15 +4111,11 @@
typarser.qparentE[i].cuOff = D3_INVALID_CUOFF;
}
- VG_(memset)( &varparser, 0, sizeof(varparser) );
varparser.sp = -1;
signature_types = VG_(HT_construct) ("signature_types");
}
- if (VG_(clo_read_inline_info))
- VG_(memset)( &inlparser, 0, sizeof(inlparser) );
-
/* Do an initial pass to scan the .debug_types section, if any, and
fill in the signatured types hash table. This lets us handle
mapping from a type signature to a (cooked) DIE offset directly
@@ -4371,9 +4371,9 @@
vg_assert(varparser.filenameTable );
VG_(deleteXA)( varparser.filenameTable );
varparser.filenameTable = NULL;
- vg_assert(inlparser.filenameTable );
}
if (VG_(clo_read_inline_info)) {
+ vg_assert(inlparser.filenameTable );
VG_(deleteXA)( inlparser.filenameTable );
inlparser.filenameTable = NULL;
}