public inbox for dtrace@lists.linux.dev
 help / color / mirror / Atom feed
From: Nick Alcock <nick.alcock@oracle.com>
To: Kris Van Hees <kris.van.hees@oracle.com>
Cc: dtrace@lists.linux.dev, dtrace-devel@oss.oracle.com
Subject: Re: [PATCH 3/4] cg: reject clauses using return() by default
Date: Tue, 15 Jul 2025 11:51:50 +0100	[thread overview]
Message-ID: <87tt3dvi9l.fsf@esperi.org.uk> (raw)
In-Reply-To: <878qkpwxho.fsf@esperi.org.uk> (Nick Alcock's message of "Tue, 15 Jul 2025 11:37:39 +0100")

On 15 Jul 2025, Nick Alcock spake thusly:

> On 15 Jul 2025, Kris Van Hees verbalised:
>
>> Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
>
> Reviewed-by: Nick Alcock <nick.alcock@oracle.com>
>
>> ---
>>  libdtrace/dt_cg.c      | 10 +++++++++-
>>  libdtrace/dt_errtags.h |  1 +
>>  libdtrace/dtrace.h     | 19 ++++++++++---------
>>  3 files changed, 20 insertions(+), 10 deletions(-)
>>
>> diff --git a/libdtrace/dt_cg.c b/libdtrace/dt_cg.c
>> index 738597ed..0607cd4e 100644
>> --- a/libdtrace/dt_cg.c
>> +++ b/libdtrace/dt_cg.c
>> @@ -875,6 +875,10 @@ dt_cg_call_clause(dtrace_hdl_t *dtp, dtrace_stmtdesc_t *sdp, dt_clause_arg_t *ar
>>  	 */
>>  	if (prp->prov->impl->reject_clause != NULL)
>>  		prp->prov->impl->reject_clause(prp, sdp->dtsd_clauseflags);
>> +	else if (sdp->dtsd_clauseflags & DT_CLSFLAG_RETURN)
>> +		xyerror(D_ACT_RETURN, "return() not allowed for %s:%s:%s:%s\n",
>> +			prp->desc->prv, prp->desc->mod, prp->desc->fun,
>> +			prp->desc->prb);
>
> Ah, I guess these are the "default checks" given in the previous commit,
> so you can just set up the reject_clause() if destructive mode is on,
> and not need to check here at all.

No, nonsense -- dt_cg_clsflags turns on the destructive flag whenever it
turns on the return flag. Which is fine. (This behaviour is still
somewhat irregular, but I guess if anything can have special handling in
dt_cg_call_clause it would be something named return :) )

-- 
NULL && (void)

  reply	other threads:[~2025-07-15 10:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-15  5:48 [PATCH 3/4] cg: reject clauses using return() by default Kris Van Hees
2025-07-15 10:37 ` Nick Alcock
2025-07-15 10:51   ` Nick Alcock [this message]
2025-07-15 15:37   ` Kris Van Hees

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tt3dvi9l.fsf@esperi.org.uk \
    --to=nick.alcock@oracle.com \
    --cc=dtrace-devel@oss.oracle.com \
    --cc=dtrace@lists.linux.dev \
    --cc=kris.van.hees@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox