]> sourceware.org Git - systemtap.git/commitdiff
/*stable*/ embedded-c functions: restore check for arity-0
authorFrank Ch. Eigler <fche@redhat.com>
Wed, 21 Oct 2015 20:11:14 +0000 (16:11 -0400)
committerFrank Ch. Eigler <fche@redhat.com>
Wed, 21 Oct 2015 20:11:14 +0000 (16:11 -0400)
During the various rewrites, this check got lost, and caused
arity-1 putatively-/*stable*/ functions to be recognized in
pass 2 but cause a SEGV in pass 3.

elaborate.cxx
testsuite/buildok/fortynine.stp [new file with mode: 0755]

index b4857dcea5c098d9da1fe5f24504d22ff82ff403..1790db8fa9c98e91a124d6ba29054807b17e7dc4 100644 (file)
@@ -4587,7 +4587,7 @@ void semantic_pass_opt7(systemtap_session& s)
       functiondecl* fn = (*it).second;
       stable_analysis sa;
       fn->body->visit(&sa);
-      if (sa.stable)
+      if (sa.stable && fn->formal_args.size() == 0)
         stable_fcs.insert(fn->name);
     }
 
diff --git a/testsuite/buildok/fortynine.stp b/testsuite/buildok/fortynine.stp
new file mode 100755 (executable)
index 0000000..31ae828
--- /dev/null
@@ -0,0 +1,5 @@
+#! stap -gp4
+
+function foo (a) %{ /* stable */ /* pure */ /* unmodified-fnargs */ STAP_RETURN(STAP_ARG_a); %}
+function foo2() %{ /* stable */ /* pure */ /* unmodified-fnargs */ STAP_RETURN("hi"); %}
+probe begin { log(foo("hello")) log(foo2()) }
This page took 0.038412 seconds and 5 git commands to generate.