summaryrefslogtreecommitdiff
path: root/src/expr/node_builder.h
diff options
context:
space:
mode:
authorChristopher L. Conway <christopherleeconway@gmail.com>2010-09-21 16:36:42 +0000
committerChristopher L. Conway <christopherleeconway@gmail.com>2010-09-21 16:36:42 +0000
commit5b2b60003b225260904c0073cc952ed2f7169e11 (patch)
treedd3c20b429ac90c86d6950ff0135ba4c1a480f3f /src/expr/node_builder.h
parentd3d08250a1ec33689ec29736600c17aab7614d18 (diff)
Moving automatic type check to NodeBuilder (Fixes: #199)
Diffstat (limited to 'src/expr/node_builder.h')
-rw-r--r--src/expr/node_builder.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/expr/node_builder.h b/src/expr/node_builder.h
index 422cb47a8..ff696dca9 100644
--- a/src/expr/node_builder.h
+++ b/src/expr/node_builder.h
@@ -829,22 +829,42 @@ TypeNode NodeBuilder<nchild_thresh>::constructTypeNode() const {
template <unsigned nchild_thresh>
Node NodeBuilder<nchild_thresh>::constructNode() {
- return Node(constructNV());
+ Node n = Node(constructNV());
+ if( IS_DEBUG_BUILD ) {
+ // force an immediate type check
+ d_nm->getType(n,true);
+ }
+ return n;
}
template <unsigned nchild_thresh>
Node NodeBuilder<nchild_thresh>::constructNode() const {
- return Node(constructNV());
+ Node n = Node(constructNV());
+ if( IS_DEBUG_BUILD ) {
+ // force an immediate type check
+ d_nm->getType(n,true);
+ }
+ return n;
}
template <unsigned nchild_thresh>
Node* NodeBuilder<nchild_thresh>::constructNodePtr() {
- return new Node(constructNV());
+ Node *np = new Node(constructNV());
+ if( IS_DEBUG_BUILD ) {
+ // force an immediate type check
+ d_nm->getType(*np,true);
+ }
+ return np;
}
template <unsigned nchild_thresh>
Node* NodeBuilder<nchild_thresh>::constructNodePtr() const {
- return new Node(constructNV());
+ Node *np = new Node(constructNV());
+ if( IS_DEBUG_BUILD ) {
+ // force an immediate type check
+ d_nm->getType(*np,true);
+ }
+ return np;
}
template <unsigned nchild_thresh>
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback