emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 58965d91e7: Avoid segfaults on MS-Windows when invoked with --ver


From: Eli Zaretskii
Subject: master 58965d91e7: Avoid segfaults on MS-Windows when invoked with --version
Date: Wed, 1 Jun 2022 14:58:13 -0400 (EDT)

branch: master
commit 58965d91e7fb5a26a5422357f44d6e841f67db74
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    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.
---
 src/emacs.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/emacs.c b/src/emacs.c
index 9197a19f36..e4257a66b4 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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]