emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why do Fdefvar not protect its argument and temporaries with GCPRO?


From: Andreas Schwab
Subject: Re: Why do Fdefvar not protect its argument and temporaries with GCPRO?
Date: Wed, 19 Nov 2014 10:44:48 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Lee Duhem <address@hidden> 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, address@hidden
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]