summaryrefslogtreecommitdiff
path: root/colm/pdabuild.cc
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2012-05-06 09:22:59 -0400
committerAdrian Thurston <thurston@complang.org>2012-05-06 09:22:59 -0400
commit665201ca77d15fdb6d171b8685c75b6d0552b573 (patch)
tree4311f576f26d1f5a95e299e2b0151e2f3b739d37 /colm/pdabuild.cc
parent6b58da8e1f8525d16d73e0cbd496adc9e093511c (diff)
downloadcolm-665201ca77d15fdb6d171b8685c75b6d0552b573.tar.gz
Some more protection for treeChild calls. Need to stop creating attributes for
them and then stop using treeChild for the parse tree nodes.
Diffstat (limited to 'colm/pdabuild.cc')
-rw-r--r--colm/pdabuild.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/colm/pdabuild.cc b/colm/pdabuild.cc
index dc540b39..8b0d238c 100644
--- a/colm/pdabuild.cc
+++ b/colm/pdabuild.cc
@@ -1548,7 +1548,7 @@ void mapNodes( Program *prg, int &count, Kid *kid )
count += prg->rtd->lelInfo[kid->tree->id].numCaptureAttr;
- if ( !( pt(kid->tree)->shadow->tree->flags & AF_NAMED ) )
+ if ( !( pt(kid->tree)->shadow->tree->flags & AF_NAMED ) && !( pt(kid->tree)->shadow->tree->flags & AF_ARTIFICIAL ) && kid->tree->child != 0 )
mapNodes( prg, count, treeChild( prg, kid->tree ) );
mapNodes( prg, count, kid->next );
}
@@ -1562,7 +1562,8 @@ void fillNodes( Program *prg, Bindings *bindings, long &bindId,
PatReplNode &node = nodes[ind++];
Kid *child =
- !( pt(kid->tree)->shadow->tree->flags & AF_NAMED ) ?
+ !( pt(kid->tree)->shadow->tree->flags & AF_NAMED ) && !( pt(kid->tree)->shadow->tree->flags & AF_ARTIFICIAL ) && kid->tree->child != 0
+ ?
treeChild( prg, kid->tree ) : 0;
/* Set up the fields. */