[Top][All Lists]

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

Re: Slightly extending commit 16b0520a9

From: Alex
Subject: Re: Slightly extending commit 16b0520a9
Date: Sat, 05 Aug 2017 22:30:36 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>>    cond = eval_sub (XCAR (args));
>>    if (!NILP (cond))
>> -    return eval_sub (Fcar (XCDR (args)));
>> +    return eval_sub (XCAR (XCDR (args)));
> I don't see anything in the preceding code that guarantees that `XCDR (args)`
> holds a cons, so I think XCAR here is unsafe.

The following line includes "XCDR (XCDR (args))", and the value of cond
should not affect the type of XCDR (args). If XCDR is allowed in this
case, then IIUC XCAR should be allowed as well.

I believe the reason why we can assume that XCDR (args) is a cons cell
is that `if' requires at least 2 (unevalled) arguments, so args must be
a list of at least length 2.

reply via email to

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