Blame SOURCES/pr23074.patch

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