From: Josh Stone Date: Tue, 10 Jun 2014 20:15:02 +0000 (-0700) Subject: elaborate: Don't catch semantic_error in blocks X-Git-Tag: release-2.6~106 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=1cda9c440df57dd24552d825f54fc95b2e0c1676;p=systemtap.git elaborate: Don't catch semantic_error in blocks In typeresolution_info::visit_block(), we were catching and printing semantic_errors, but this causes them to be repeated when type resolution loops around again. Instead let higher levels catch the error, where it will end the iteration properly too. This probably originated on the assumption that all probe and function code is contained in a block statement, but with optimization that may not even be true, so visit_block is really not the right place to catch errors. --- diff --git a/elaborate.cxx b/elaborate.cxx index 3634ab399..f86dd3b18 100644 --- a/elaborate.cxx +++ b/elaborate.cxx @@ -5039,15 +5039,8 @@ typeresolution_info::visit_block (block* e) { for (unsigned i=0; istatements.size(); i++) { - try - { - t = pe_unknown; - e->statements[i]->visit (this); - } - catch (const semantic_error& e) - { - session.print_error (e); - } + t = pe_unknown; + e->statements[i]->visit (this); } }