Blame SOURCES/pr23074.patch

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