From: Paul Eggert Date: Mon, 13 Jun 2011 05:55:57 +0000 (-0700) Subject: * unexelf.c (unexec): Don't assume BSS addr fits in unsigned. X-Git-Tag: emacs-pretest-24.0.90~104^2~548^2~26 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ee2079f16e33b20dc2330062c766eafee4db240d;p=emacs.git * unexelf.c (unexec): Don't assume BSS addr fits in unsigned. --- diff --git a/src/ChangeLog b/src/ChangeLog index 8e74e4a630e..9c7cf3cba9a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2011-06-13 Paul Eggert + * unexelf.c (unexec): Don't assume BSS addr fits in unsigned. + * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned. * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX. diff --git a/src/unexelf.c b/src/unexelf.c index 8b45894f853..951e7c0eea6 100644 --- a/src/unexelf.c +++ b/src/unexelf.c @@ -391,6 +391,7 @@ temacs: extern void fatal (const char *msgid, ...); #include +#include #include #include #include @@ -784,7 +785,7 @@ unexec (const char *new_name, const char *old_name) fprintf (stderr, "new_data2_incr %x\n", new_data2_incr); #endif - if ((unsigned) new_bss_addr < (unsigned) old_bss_addr + old_bss_size) + if ((uintptr_t) new_bss_addr < (uintptr_t) old_bss_addr + old_bss_size) fatal (".bss shrank when undumping???\n", 0, 0); /* Set the output file to the right size. Allocate a buffer to hold