From bcfbc9de654b0718d46349ca8ada284dba3dc761 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 27 Jul 2012 13:29:26 +0300 Subject: [PATCH] Fix listn introduced in 2012-07-27T06:04:35Z!dmantipov@yandex.ru. src/alloc.c (listn): Fix the order the arguments are consed onto the list. --- src/ChangeLog | 3 +++ src/alloc.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 54b34eb5c00..ab870b56f1e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2012-07-27 Eli Zaretskii + * alloc.c (listn): Fix the order the arguments are consed onto the + list. + * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for enumeration constants, as PURE and HEAP are too general, and clash with other headers and sources, such as gmalloc.c and the diff --git a/src/alloc.c b/src/alloc.c index 27426cdff66..a551dd821b8 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -2832,7 +2832,7 @@ listn (enum constype type, ptrdiff_t count, Lisp_Object arg, ...) objp[i] = va_arg (ap, Lisp_Object); va_end (ap); - for (i = 0, val = Qnil; i < count; i++) + for (val = Qnil, i = count - 1; i >= 0; i--) { if (type == CONSTYPE_PURE) val = pure_cons (objp[i], val); -- 2.39.2