emacs-devel
[Top][All Lists]
Advanced

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

Re: Lisp watchpoints


From: Andreas Schwab
Subject: Re: Lisp watchpoints
Date: Sun, 29 Nov 2015 12:28:59 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Noam Postavsky <address@hidden> writes:

> On Sat, Nov 28, 2015 at 11:44 PM, Stefan Monnier
> <address@hidden> wrote:
>>> +  while (!NILP (watchers))
>>> +    {
>>> +      Lisp_Object watcher = XCAR (watchers);
>>
>> This will lead to a segmentation fault after something like (put <var>
>> 'watchers [1]).  While very unlikely, it's very easy to avoid this
>> problem: just use CONSP instead of !NILP.
>>
>>> +      else if (FUNCTIONP (watcher))
>>> +        CALLN (Ffuncall, watcher, operation, where, symbol, newval);
>>
>> I don't think you need to test "FUNCTIONP (watcher)".
>
> Isn't the FUNCTIONP test needed for basically the same reason as using
> CONSP over !NILP? i.e. to avoid segfault in case of (put <var>
> 'watchers '([1])).

Ffuncall does all necessary checks.

Andreas.

-- 
Andreas Schwab, address@hidden
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



reply via email to

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