Subject: Re: bug#36597: 27.0.50; rehash hash tables eagerly in pdumper

From: Pip Cet <[email-masked]>
Date: Tue, 11 Aug 2020 15:59:12 +0000

On Tue, Aug 11, 2020 at 2:52 PM Eli Zaretskii <[email-masked]> wrote:
>   pdumper.c: In function 'hash_table_thaw':
>   pdumper.c:2667:30: error: conversion from 'EMACS_INT' {aka 'long long int'} to 'ptrdiff_t' {aka 'int'} may change value [-Werror=conversion]
>    2667 |   h->hash = make_nil_vector (XFIXNUM (h->hash));
>         |                              ^~~~~~~~~~~~~~~~~
>   cc1.exe: some warnings being treated as errors

I suggest going back to Fmake_vector (h->hash, Qnil), as in the
attached patch. It's shorter, and it actually compiles.
From eaaefce564bcee1d76e36105caea9d7937743ad4 Mon Sep 17 00:00:00 2001
From: Pip Cet <[email-masked]>
Date: Tue, 11 Aug 2020 15:52:36 +0000
Subject: [PATCH] Fix wide-int compilation issue in pdumper.c

* src/pdumper.c (hash_table_thaw): Avoid make_nil_vector, which
requires additional casting.
---
 src/pdumper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pdumper.c b/src/pdumper.c
index 94921dc9ea..e132da1551 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -2664,7 +2664,7 @@ hash_table_freeze (struct Lisp_Hash_Table *h)
 hash_table_thaw (Lisp_Object hash)
 {
   struct Lisp_Hash_Table *h = XHASH_TABLE (hash);
-  h->hash = make_nil_vector (XFIXNUM (h->hash));
+  h->hash = Fmake_vector (h->hash, Qnil);
   h->next = Fmake_vector (h->next, make_fixnum (-1));
   h->index = Fmake_vector (h->index, make_fixnum (-1));
 
-- 
2.28.0