|
From: <sv...@va...> - 2014-06-16 18:08:15
|
Author: philippe
Date: Mon Jun 16 18:08:02 2014
New Revision: 14044
Log:
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
Modified:
trunk/coregrind/m_debuginfo/readdwarf3.c
Modified: trunk/coregrind/m_debuginfo/readdwarf3.c
==============================================================================
--- trunk/coregrind/m_debuginfo/readdwarf3.c (original)
+++ trunk/coregrind/m_debuginfo/readdwarf3.c Mon Jun 16 18:08:02 2014
@@ -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;
}
|