diff --git a/src/ChangeLog b/src/ChangeLog index 54b34eb5c004b82d88801d95293160bd6cd55921..ab870b56f1e3707837bc8ec8259d541a5fc9c567 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 27426cdff66ef5f2746d5034011668adf12d331c..a551dd821b83cbeb47a8f61d1f5ff3874318f1dc 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);