summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgraydon <graydon>2005-07-11 21:47:39 +0000
committergraydon <graydon>2005-07-11 21:47:39 +0000
commitc37f6b365f83fc09aa77dfb05c4543bcf6ee7bc8 (patch)
tree412e62742db373d09a684c359ee980d466f84f0b
parent3f43362a3e5b1e800819d13e3068328e24589495 (diff)
downloadsystemtap-steved-c37f6b365f83fc09aa77dfb05c4543bcf6ee7bc8.tar.gz
systemtap-steved-c37f6b365f83fc09aa77dfb05c4543bcf6ee7bc8.tar.xz
systemtap-steved-c37f6b365f83fc09aa77dfb05c4543bcf6ee7bc8.zip
2005-07-11 Graydon Hoare <graydon@redhat.com>
* staptree.cxx (require): Generally handle null pointers in src. (deep_copy_visitor::visit_if_statement): Revert fche's change.
-rw-r--r--ChangeLog5
-rw-r--r--staptree.cxx16
2 files changed, 13 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 48523355..646003b0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-07-11 Graydon Hoare <graydon@redhat.com>
+
+ * staptree.cxx (require): Generally handle null pointers in src.
+ (deep_copy_visitor::visit_if_statement): Revert fche's change.
+
2005-07-11 Frank Ch. Eigler <fche@redhat.com>
* parse.cxx (parse_literal): Compile cleanly on 64-bit host.
diff --git a/staptree.cxx b/staptree.cxx
index 7192c4b8..706f4260 100644
--- a/staptree.cxx
+++ b/staptree.cxx
@@ -987,10 +987,13 @@ template <typename T> static void
require (deep_copy_visitor *v, T *dst, T src)
{
*dst = NULL;
- v->targets.push(static_cast<void *>(dst));
- src->visit(v);
- v->targets.pop();
- assert(*dst);
+ if (src != NULL)
+ {
+ v->targets.push(static_cast<void *>(dst));
+ src->visit(v);
+ v->targets.pop();
+ assert(*dst);
+ }
}
template <typename T> static void
@@ -1033,10 +1036,7 @@ deep_copy_visitor::visit_if_statement (if_statement* s)
if_statement *n = new if_statement;
require <expression*> (this, &(n->condition), s->condition);
require <statement*> (this, &(n->thenblock), s->thenblock);
- if (s->elseblock)
- require <statement*> (this, &(n->elseblock), s->elseblock);
- else
- n->elseblock = 0;
+ require <statement*> (this, &(n->elseblock), s->elseblock);
provide <if_statement*> (this, n);
}