Blame SOURCES/pr23074.patch

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