From: Frank Ch. Eigler Date: Wed, 21 Oct 2015 20:11:14 +0000 (-0400) Subject: /*stable*/ embedded-c functions: restore check for arity-0 X-Git-Tag: release-3.0~368 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=67d60c9f456bcf73205174ad63826981e74791bf;p=systemtap.git /*stable*/ embedded-c functions: restore check for arity-0 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. --- diff --git a/elaborate.cxx b/elaborate.cxx index b4857dcea..1790db8fa 100644 --- a/elaborate.cxx +++ b/elaborate.cxx @@ -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 index 000000000..31ae828f1 --- /dev/null +++ b/testsuite/buildok/fortynine.stp @@ -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()) }