]> sourceware.org Git - systemtap.git/commitdiff
stapregex cleanup: properly set rc after gen_dfa_table()
authorSerguei Makarov <smakarov@redhat.com>
Fri, 5 Apr 2013 15:55:20 +0000 (11:55 -0400)
committerSerguei Makarov <smakarov@redhat.com>
Wed, 29 May 2013 14:38:07 +0000 (10:38 -0400)
elaborate.cxx

index a39694d9f227ba2431e6fc55af98c1fc5813c7e8..8149b3836c4b280b65aa903797aee4aa505f4f32 100644 (file)
@@ -1523,17 +1523,26 @@ public:
 };
 
 // Go through the regex match invocations and generate corresponding DFAs.
-void gen_dfa_table (systemtap_session& s)
+int gen_dfa_table (systemtap_session& s)
 {
-  regex_collecting_visitor rcv(s); // TODOXXX
+  regex_collecting_visitor rcv(s);
 
   for (unsigned i=0; i<s.probes.size(); i++)
     {
-      s.probes[i]->body->visit (& rcv);
-
-      if (s.probes[i]->sole_location()->condition)
-        s.probes[i]->sole_location()->condition->visit (& rcv);
+      try
+        {
+          s.probes[i]->body->visit (& rcv);
+          
+          if (s.probes[i]->sole_location()->condition)
+            s.probes[i]->sole_location()->condition->visit (& rcv);
+        }
+      catch (const semantic_error& e)
+        {
+          s.print_error (e);
+        }
     }
+
+  return s.num_errors();
 }
 
 // ------------------------------------------------------------------------
@@ -1973,7 +1982,7 @@ semantic_pass (systemtap_session& s)
       if (rc == 0) rc = semantic_pass_conditions (s);
       if (rc == 0) rc = semantic_pass_optimize1 (s);
       if (rc == 0) rc = semantic_pass_types (s);
-      if (rc == 0) gen_dfa_table(s); // TODOXXX set rc?
+      if (rc == 0) rc = gen_dfa_table(s);
       if (rc == 0) add_global_var_display (s);
       if (rc == 0) rc = semantic_pass_optimize2 (s);
       if (rc == 0) rc = semantic_pass_vars (s);
This page took 0.039268 seconds and 5 git commands to generate.