Blame SOURCES/pr23074.patch

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