# HG changeset patch # User Jerry James # Date 1325097047 25200 # Node ID 0d05accafc63e15903fc22cb6a0e7f8b3dce3fc5 # Parent 81fee4aee9b6771e273b2d8c491144e7bd8d6adc Don't lose bits in make_fixnum / make_char_1. See xemacs-patches message with ID . diff -r 81fee4aee9b6 -r 0d05accafc63 src/ChangeLog --- a/src/ChangeLog Wed Dec 28 11:21:38 2011 +0100 +++ b/src/ChangeLog Wed Dec 28 11:30:47 2011 -0700 @@ -1,3 +1,9 @@ +2011-12-28 Jerry James + + * lisp-disunion.h (make_fixnum): avoid losing bits off the left end + if the value is of large magnitude and narrow type. + (make_char_1): ditto. + 2011-12-28 Didier Verna * console-impl.h (struct console_methods): Have the text_width diff -r 81fee4aee9b6 -r 0d05accafc63 src/lisp-disunion.h --- a/src/lisp-disunion.h Wed Dec 28 11:21:38 2011 +0100 +++ b/src/lisp-disunion.h Wed Dec 28 11:30:47 2011 -0700 @@ -96,9 +96,9 @@ return obj; } -#define make_fixnum(x) ((Lisp_Object) (((x) << FIXNUM_GCBITS) | Lisp_Type_Fixnum_Bit)) +#define make_fixnum(x) ((Lisp_Object) ((((EMACS_INT)(x)) << FIXNUM_GCBITS) | Lisp_Type_Fixnum_Bit)) -#define make_char_1(x) ((Lisp_Object) (((x) << GCBITS) | Lisp_Type_Char)) +#define make_char_1(x) ((Lisp_Object) ((((EMACS_UINT)(x)) << GCBITS) | Lisp_Type_Char)) #define FIXNUMP(x) ((EMACS_UINT)(x) & Lisp_Type_Fixnum_Bit) #define FIXNUM_PLUS(x,y) ((x)+(y)-Lisp_Type_Fixnum_Bit)