summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeder Andersen2012-11-19 11:49:48 (EST)
committer Eugene Tarassov2012-11-20 14:04:43 (EST)
commit3ad889a66c25bf82e140ad42d58c11e0e0a3863d (patch)
treee12ccb0aeb8a5a575c436f567ae8a33f85b4a1e2
parent2fbdcf4ad66db473c7fd114c083365217969767f (diff)
downloadorg.eclipse.tcf.agent-3ad889a66c25bf82e140ad42d58c11e0e0a3863d.zip
org.eclipse.tcf.agent-3ad889a66c25bf82e140ad42d58c11e0e0a3863d.tar.gz
org.eclipse.tcf.agent-3ad889a66c25bf82e140ad42d58c11e0e0a3863d.tar.bz2
dwarf: avoid exceptions when parsing parent-less formal parameters
Adds a simple check for NULL before testing the "parent" tag type, when discovering a formal parameter's definition.
-rw-r--r--agent/tcf/services/dwarfcache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/agent/tcf/services/dwarfcache.c b/agent/tcf/services/dwarfcache.c
index 00c5fae..297fc8d 100644
--- a/agent/tcf/services/dwarfcache.c
+++ b/agent/tcf/services/dwarfcache.c
@@ -777,7 +777,7 @@ static void read_object_refs(void) {
if (ref.obj->mFlags & DOIF_abstract_origin) {
if ((ref.obj->mTag == TAG_variable && (ref.obj->mFlags & DOIF_external)) ||
ref.obj->mTag == TAG_subprogram ||
- (ref.obj->mTag == TAG_formal_parameter && ref.obj->mParent->mTag == TAG_subprogram))
+ (ref.obj->mTag == TAG_formal_parameter && ref.obj->mParent != NULL && ref.obj->mParent->mTag == TAG_subprogram))
ref.org->mDefinition = ref.obj;
}
if (ref.obj->mFlags & DOIF_external) {