From 1af1e62d9f67237277dd771a0cb78fa6b069742d Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 7 Apr 2010 16:41:41 -0700 Subject: Clean up and clarify semantic_error chaining I consolidated the copy-construction that every target_symbol::chain caller was doing. I also removed the comments that target_symbol errors might be chained due to function wildcards, because it's not true -- each derived instance gets a deep_copy of the probe body. However, @cast can still chain since it may try multiple modules to resolve the casting dereference. --- staptree.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'staptree.h') diff --git a/staptree.h b/staptree.h index 895c6667..eff5d3cd 100644 --- a/staptree.h +++ b/staptree.h @@ -33,9 +33,7 @@ struct semantic_error: public std::runtime_error semantic_error *chain; ~semantic_error () throw () {} - semantic_error (const std::string& msg): - runtime_error (msg), tok1 (0), tok2 (0), chain (0) {} - semantic_error (const std::string& msg, const token* t1): + semantic_error (const std::string& msg, const token* t1=0): runtime_error (msg), tok1 (t1), tok2 (0), chain (0) {} semantic_error (const std::string& msg, const token* t1, const std::string& m2, const token* t2): @@ -258,7 +256,7 @@ struct target_symbol: public symbol std::string probe_context_var; // NB: this being set implies that target_symbol is *resolved* semantic_error* saved_conversion_error; // hand-made linked list target_symbol(): addressof(false), saved_conversion_error (0) {} - void chain (semantic_error* e); + void chain (const semantic_error& er); void print (std::ostream& o) const; void visit (visitor* u); void visit_components (visitor* u); -- cgit