[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] * src/eval.c: Stop checking for nvars, and use only CONSP
From: |
Pip Cet |
Subject: |
Re: [PATCH] * src/eval.c: Stop checking for nvars, and use only CONSP |
Date: |
Tue, 2 Mar 2021 05:34:35 +0000 |
On Tue, Mar 2, 2021 at 2:19 AM Naoya Yamashita <conao3@gmail.com> wrote:
> I found src/eval.c (let) has redundant conditions, that compares
> the length of the list with the current index and also checks if
> the current list is cons.
Technically, those aren't redundant. We're calling eval_sub in between
the checks, and that might modify the list of arguments.
That's not something that is supported, but it is something that
shouldn't segfault, just throw an error.
IIUC, the following will likely segfault with your patch:
(let ((cons-cell '((a 2) (b 3))))
(eval `(let ((x (setcdr ',cons-cell nil))
. ,cons-cell)
(message "foo"))))
Again, that's not code that should work. It isn't quite nasty enough
to justify a segfault, though, IMHO.
Pip
- [PATCH] * src/eval.c: Stop checking for nvars, and use only CONSP, Naoya Yamashita, 2021/03/01
- Re: [PATCH] * src/eval.c: Stop checking for nvars, and use only CONSP, Stefan Monnier, 2021/03/01
- Re: [PATCH] * src/eval.c: Stop checking for nvars, and use only CONSP, Naoya Yamashita, 2021/03/01
- Re: [PATCH] * src/eval.c: Stop checking for nvars, and use only CONSP, Stefan Monnier, 2021/03/02
- Re: [PATCH] * src/eval.c: Stop checking for nvars, and use only CONSP, Pip Cet, 2021/03/02
- Re: [PATCH] * src/eval.c: Stop checking for nvars, and use only CONSP, Stefan Monnier, 2021/03/02
- Re: [PATCH] * src/eval.c: Stop checking for nvars, and use only CONSP, Pip Cet, 2021/03/02
- Re: [PATCH] * src/eval.c: Stop checking for nvars, and use only CONSP, Stefan Monnier, 2021/03/02
- Re: [PATCH] * src/eval.c: Stop checking for nvars, and use only CONSP, Pip Cet, 2021/03/02
- Re: [PATCH] * src/eval.c: Stop checking for nvars, and use only CONSP, Stefan Monnier, 2021/03/02
Re: [PATCH] * src/eval.c: Stop checking for nvars, and use only CONSP,
Pip Cet <=
Re: [PATCH] * src/eval.c: Stop checking for nvars, and use only CONSP, Eli Zaretskii, 2021/03/02