]> sourceware.org Git - systemtap.git/commitdiff
autocast: Avoid duplicating errors
authorJosh Stone <jistone@redhat.com>
Fri, 6 Jun 2014 23:58:16 +0000 (16:58 -0700)
committerJosh Stone <jistone@redhat.com>
Fri, 6 Jun 2014 23:58:16 +0000 (16:58 -0700)
Don't retry an autocast expansion if we already have a saved error, and
wait to print errors until type resolution is in assert_resolvability.

elaborate.cxx

index 0e0e0dc498127fbd8a439c488ec4acf6b1931982..81d16dfbfae1307978a0def5b606d66c7f992a07 100644 (file)
@@ -4244,7 +4244,7 @@ struct autocast_expanding_visitor: public var_expanding_visitor
     {
       const bool lvalue = is_active_lvalue (e);
       const exp_type_ptr& details = e->operand->type_details;
-      if (details)
+      if (details && !e->saved_conversion_error)
         {
           functioncall* fc = details->expand (e, lvalue);
           if (fc)
@@ -4906,7 +4906,7 @@ typeresolution_info::visit_autocast_op (autocast_op* e)
 {
   // Like cast_op, a implicit autocast_op shouldn't survive this far
   // unless it was not resolved and its value is really needed.
-  if (e->saved_conversion_error)
+  if (assert_resolvability && e->saved_conversion_error)
     throw (* (e->saved_conversion_error));
   else if (assert_resolvability)
     throw SEMANTIC_ERROR(_("unknown type in dereference"), e->tok);
This page took 0.111629 seconds and 5 git commands to generate.