unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: Lee Duhem <lee.duhem@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Why do Fdefvar not protect its argument and temporaries with GCPRO?
Date: Wed, 19 Nov 2014 10:44:48 +0100	[thread overview]
Message-ID: <mvmzjbnwmlr.fsf@hawking.suse.de> (raw)
In-Reply-To: <CAOSer0BaKCCLw=RCzx_2=q22p3BHWvBkFy6nUNn3LQm9=YJFDw@mail.gmail.com> (Lee Duhem's message of "Wed, 19 Nov 2014 10:48:44 +0800")

Lee Duhem <lee.duhem@gmail.com> writes:

> In the definition of `Fdefvar`, it calls `eval_sub`, and its temporary
> variable `tail` is used after that call. So why do `Fdefvar` not protect
> `tail` and other temporaries from GC with GCPRO? As other functions in
> `src/eval.c` did.

I think a few of them do too much GCPRO, since arguments of lisp
functions are protected by the caller (and conses are not relocated).
In the initial version of Fdefvar no intermediate values were stored in
variables, instead they were recomputed by calling Fcdr/Fcar on the
function argument, which is ok protection-wise.

> Is this a bug?

In this case, I think it is.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."



  reply	other threads:[~2014-11-19  9:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-19  2:48 Why do Fdefvar not protect its argument and temporaries with GCPRO? Lee Duhem
2014-11-19  9:44 ` Andreas Schwab [this message]
2014-11-19 13:51   ` Stefan Monnier
2014-11-20  2:59     ` Lee Duhem

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=mvmzjbnwmlr.fsf@hawking.suse.de \
    --to=schwab@suse.de \
    --cc=emacs-devel@gnu.org \
    --cc=lee.duhem@gmail.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).