summaryrefslogtreecommitdiff
path: root/src/expr/node_value.cpp
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2010-03-08 23:49:47 +0000
committerMorgan Deters <mdeters@gmail.com>2010-03-08 23:49:47 +0000
commitcf4d347cbbbb4c1a1e1db99337cfd2b22b84b756 (patch)
treeceea43e3d37525038bed10b115c73a8aa08ce68d /src/expr/node_value.cpp
parentde0160112edbed8ce9b62bf87172ae2f0e99a013 (diff)
This fixes regressions at levels >= 1 which were failing
* implement zombification and garbage collection of NodeValues (but GC not turned on yet) * implement removal of key nodes from all attribute tables * audit NodeBuilder and fix memory leaks and improper reference-count management. This is in many places a re-write. Clearly documented invariants on NodeBuilder state. (Closes Bug 38) * created a "BackedNodeBuilder" that can be used to construct NodeBuilders with a stack-based backing store for a size that's not a compile-time constant. * NodeValues no longer depend on Node for toStream()'ing * make unit test-building "silent" with --enable-silent-rules * (Makefile.am, Makefile.builds.in) fix top-level build system so that "make regressN" works with unbuilt/out-of-date source trees in the expected way. * (various) code cleanup, documentation, formatting
Diffstat (limited to 'src/expr/node_value.cpp')
-rw-r--r--src/expr/node_value.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/expr/node_value.cpp b/src/expr/node_value.cpp
index 5c5765011..5dbfac169 100644
--- a/src/expr/node_value.cpp
+++ b/src/expr/node_value.cpp
@@ -38,9 +38,11 @@ string NodeValue::toString() const {
void NodeValue::toStream(std::ostream& out) const {
if(d_kind == kind::VARIABLE) {
- Node n(this);
string s;
- if(n.hasAttribute(VarNameAttr(), s)) {
+ // conceptually "this" is const, and hasAttribute() doesn't change
+ // its argument, but it requires a non-const key arg (for now)
+ if(NodeManager::currentNM()->hasAttribute(const_cast<NodeValue*>(this),
+ VarNameAttr(), s)) {
out << s;
} else {
out << "var_" << d_id;
@@ -51,7 +53,7 @@ void NodeValue::toStream(std::ostream& out) const {
if(i != nv_end()) {
out << " ";
}
- Node(*i).toStream(out);
+ (*i)->toStream(out);
}
out << ")";
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback