From: Eli Zaretskii Date: Wed, 1 Jun 2022 18:57:07 +0000 (+0300) Subject: Avoid segfaults on MS-Windows when invoked with --version X-Git-Tag: emacs-29.0.90~1910^2~295^2~4 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=58965d91e7fb5a26a5422357f44d6e841f67db74;p=emacs.git Avoid segfaults on MS-Windows when invoked with --version * src/emacs.c (main): If invoked with --version, call 'init_bignum' before calling 'format-time-string', as that is needed for safe manipulation of bignums in timefns.c. --- diff --git a/src/emacs.c b/src/emacs.c index 9197a19f368..e4257a66b4c 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1428,6 +1428,11 @@ main (int argc, char **argv) if (initialized) { Lisp_Object tem, tem2; + + /* Fformat_time_string below manipulates bignums, so we need + this initialization. */ + init_bignum (); + tem = Fsymbol_value (intern_c_string ("emacs-version")); tem2 = Fsymbol_value (intern_c_string ("emacs-copyright")); if (!STRINGP (tem))