Blame SOURCES/pr23074.patch

757d3f
commit 83071bc877b462eacca309fa49c9e8112fc16bdf
757d3f
Author: Jafeer Uddin <juddin@redhat.com>
757d3f
Date:   Thu May 9 16:18:46 2019 -0400
757d3f
757d3f
    PR23074: fix guru mode issue with generated calls to register get/set
757d3f
757d3f
diff --git a/elaborate.cxx b/elaborate.cxx
757d3f
index 9ebf30b..fcd1d1d 100644
757d3f
--- a/elaborate.cxx
757d3f
+++ b/elaborate.cxx
757d3f
@@ -3073,7 +3073,7 @@ public:
757d3f
     }
757d3f
 
757d3f
   // Don't allow /* guru */ functions unless caller is privileged.
757d3f
-  if (!call->tok->location.file->privileged &&
757d3f
+  if (!call->synthetic && !call->tok->location.file->privileged &&
757d3f
       s->tagged_p ("/* guru */"))
757d3f
     throw SEMANTIC_ERROR (_("function may not be used unless -g is specified"),
757d3f
 			  call->tok);
757d3f
diff --git a/loc2stap.cxx b/loc2stap.cxx
757d3f
index c1a48d0..d4fd051 100644
757d3f
--- a/loc2stap.cxx
757d3f
+++ b/loc2stap.cxx
757d3f
@@ -1745,6 +1745,7 @@ location_context::handle_GNU_parameter_ref (Dwarf_Op expr)
757d3f
   // it and we want to be able to restore the registers back.
757d3f
   functioncall *get_ptregs = new functioncall;
757d3f
   get_ptregs->tok = e->tok;
757d3f
+  get_ptregs->synthetic = true;
757d3f
   if (this->userspace_p)
757d3f
     get_ptregs->function = std::string("__get_uregs");
757d3f
   else
757d3f
@@ -1870,6 +1871,7 @@ location_context::handle_GNU_parameter_ref (Dwarf_Op expr)
757d3f
   // Translation done, restore the pt_regs to its original value
757d3f
   functioncall *set_ptregs = new functioncall;
757d3f
   set_ptregs->tok = e->tok;
757d3f
+  set_ptregs->synthetic = true;
757d3f
   if (this->userspace_p)
757d3f
     set_ptregs->function = std::string("__set_uregs");
757d3f
   else
757d3f
diff --git a/staptree.h b/staptree.h
757d3f
index d63156f..2735808 100644
757d3f
--- a/staptree.h
757d3f
+++ b/staptree.h
757d3f
@@ -464,6 +464,7 @@ struct functioncall: public expression
757d3f
   interned_string function;
757d3f
   std::vector<expression*> args;
757d3f
   std::vector<functiondecl*> referents;
757d3f
+  bool synthetic;
757d3f
   functioncall ();
757d3f
   void print (std::ostream& o) const;
757d3f
   void visit (visitor* u);