From 7392f2dc4102fcc5bc4e8a9752db589f75ab9f52 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mattias=20Engdeg=C3=A5rd?= Date: Fri, 31 Dec 2021 19:44:02 +0100 Subject: [PATCH] Byte code arity check micro-optimisation * src/bytecode.c (exec_byte_code): Slight simplification. --- src/bytecode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/bytecode.c b/src/bytecode.c index 0d0a28cd0bb..00db29b0140 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -391,8 +391,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, bool rest = (at & 128) != 0; int mandatory = at & 127; ptrdiff_t nonrest = at >> 8; - ptrdiff_t maxargs = rest ? PTRDIFF_MAX : nonrest; - if (! (mandatory <= nargs && nargs <= maxargs)) + if (! (mandatory <= nargs && (rest || nargs <= nonrest))) Fsignal (Qwrong_number_of_arguments, list2 (Fcons (make_fixnum (mandatory), make_fixnum (nonrest)), make_fixnum (nargs))); -- 2.39.2