From: Pip Cet Date: Sun, 14 Jul 2019 04:44:27 +0000 (-0700) Subject: Avoid returning negative numbers from `hash-table-count' X-Git-Tag: emacs-27.0.90~1929 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1542d17324c46a1406355ed10a48a97f51014e90;p=emacs.git Avoid returning negative numbers from `hash-table-count' * src/fns.c (Fhash_table_count): Rehash argument if necessary. --- diff --git a/src/fns.c b/src/fns.c index 54dafe07ac8..238a37193c1 100644 --- a/src/fns.c +++ b/src/fns.c @@ -4875,7 +4875,9 @@ DEFUN ("hash-table-count", Fhash_table_count, Shash_table_count, 1, 1, 0, doc: /* Return the number of elements in TABLE. */) (Lisp_Object table) { - return make_fixnum (check_hash_table (table)->count); + struct Lisp_Hash_Table *h = check_hash_table (table); + hash_rehash_if_needed (h); + return make_fixnum (h->count); }