summaryrefslogtreecommitdiffstats
path: root/elaborate.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'elaborate.cxx')
-rw-r--r--elaborate.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/elaborate.cxx b/elaborate.cxx
index 53f2a8f6..6fb3f197 100644
--- a/elaborate.cxx
+++ b/elaborate.cxx
@@ -406,9 +406,6 @@ match_node::find_and_build (systemtap_session& s,
sub_map_iterator_t i = sub.find (match);
if (i == sub.end()) // no match
{
- if (loc->optional) /* PR10102: to tolerate mismatched optional probe */
- return;
-
string alternatives;
for (sub_map_iterator_t i = sub.begin(); i != sub.end(); i++)
alternatives += string(" ") + i->first.str();
@@ -633,7 +630,18 @@ derive_probes (systemtap_session& s,
// and set a flag on the copy permanently.
bool old_loc_opt = loc->optional;
loc->optional = loc->optional || optional;
- s.pattern_root->find_and_build (s, p, loc, 0, dps); // <-- actual derivation!
+ try
+ {
+ s.pattern_root->find_and_build (s, p, loc, 0, dps); // <-- actual derivation!
+ }
+ catch (const semantic_error& e)
+ {
+ if (!loc->optional)
+ throw semantic_error(e);
+ else /* tolerate failure for optional probe */
+ continue;
+ }
+
loc->optional = old_loc_opt;
unsigned num_atend = dps.size();