]> sourceware.org Git - systemtap.git/commitdiff
translator for embeddedcode: don't emit deref_fault pseudo-labels
authorFrank Ch. Eigler <fche@redhat.com>
Thu, 22 Jun 2017 19:49:39 +0000 (15:49 -0400)
committerFrank Ch. Eigler <fche@redhat.com>
Thu, 22 Jun 2017 19:53:21 +0000 (15:53 -0400)
We will aim to rely on the single solitary deref_fault: label
emitted at the tail of functions / probes boilerplate, rather
than labels that may be nested within generated code.  This
also needs the old-fashioned CATCH_DEREF_FAULT macro for
embedded-C code to no longer define the label.

runtime/loc2c-runtime.h
translate.cxx

index 09eb3f1b0c303072440fde80205555b39be89c47..a847d6ba6cea8159b4d672af0c370e8b55ccdabb 100644 (file)
     goto deref_fault;                                                      \
     })
 
-#define CATCH_DEREF_FAULT()                            \
-  if (0) {                                             \
-deref_fault: ;                                         \
-  }
+#define CATCH_DEREF_FAULT()    ({0; }) /* always emitted by translator.cxx for functions & probes */
 #endif
 
 #endif /* _LOC2C_RUNTIME_H_ */
index d2434b9951c35fbaf26fff17e60625dde614b84c..631c546e5cbc632e03b8fecf3be718db378f5aad 100644 (file)
@@ -3794,8 +3794,8 @@ c_unparser::visit_embeddedcode (embeddedcode *s)
     o->newline() << "assert_is_myproc();";
   o->newline() << "{";
 
-  if (1 || s->code.find ("CATCH_DEREF_FAULT") != string::npos)
-    o->newline() << "__label__ deref_fault;";
+  //  if (1 || s->code.find ("CATCH_DEREF_FAULT") != string::npos)
+  //    o->newline() << "__label__ deref_fault;";
 
   vector<vardecl*> read_defs;
   vector<vardecl*> write_defs;
@@ -3823,8 +3823,8 @@ c_unparser::visit_embeddedcode (embeddedcode *s)
   for (vector<vardecl*>::const_iterator it = write_defs.begin(); it != write_defs.end(); ++it)
     c_global_write_undef(*it);
 
-  if (1 || s->code.find ("CATCH_DEREF_FAULT") != string::npos)
-    o->newline() << ";";
+  //  if (1 || s->code.find ("CATCH_DEREF_FAULT") != string::npos)
+  //    o->newline() << ";";
 
   o->newline() << "}";
 }
This page took 1.194963 seconds and 5 git commands to generate.