From 9283a24699fa21c63fb2000c4adac405edb76123 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 18 Apr 2008 23:56:32 +0000 Subject: [PATCH] Fix a bug in FN_to_NDS in configurations where intDsize < intPsize. --- ChangeLog | 8 +++++++- src/integer/cl_I.h | 6 +++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 405fa77..4c9e06b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,16 @@ +2008-04-18 Bruno Haible + + * src/integer/cl_I.h (FN_MSD1_mask, FN_MSD2_mask, FN_MSD3_mask): + Define without tag bits. Fixes a bug in FN_to_NDS with negative fixnums + on platforms where FN_maxlength > 1. + 2008-04-07 Alexei Sheplyakov * configure.ac: create subdirectory to hold auto-generated headers. 2008-04-07 Alexei Sheplyakov - Re-esatblish 1.2.0 ABI, broken 2008-02-22: + Re-establish 1.2.0 ABI, broken 2008-02-22: * src/float/input/cl_F_readparsed.cc: Add obsolete signature with index args uintL. * src/integer/input/cl_I_readparsed.cc: Likewise. diff --git a/src/integer/cl_I.h b/src/integer/cl_I.h index 61f814d..e519e72 100644 --- a/src/integer/cl_I.h +++ b/src/integer/cl_I.h @@ -504,11 +504,11 @@ inline sintD FN_MSD (cl_uint word) #endif // wird nur bei FN_maxlength >= 2 gebraucht, d.h. intDsize < cl_value_len -#define FN_MSD1_mask (~((cl_uint)(bitc(intDsize-1)-1) << cl_value_shift)) +#define FN_MSD1_mask ((~(cl_uint)(bitc(intDsize-1)-1)) << cl_value_shift) // wird nur bei FN_maxlength >= 3 gebraucht, d.h. 2*intDsize < cl_value_len -#define FN_MSD2_mask (~((cl_uint)(bitc(2*intDsize-1)-1) << cl_value_shift)) +#define FN_MSD2_mask ((~(cl_uint)(bitc(2*intDsize-1)-1)) << cl_value_shift) // wird nur bei FN_maxlength >= 4 gebraucht, d.h. 3*intDsize < cl_value_len -#define FN_MSD3_mask (~((cl_uint)(bitc(3*intDsize-1)-1) << cl_value_shift)) +#define FN_MSD3_mask ((~(cl_uint)(bitc(3*intDsize-1)-1)) << cl_value_shift) // Store a Fixnum at destLSDptr, <= FN_maxlength digits below destLSDptr needed. #define FN_to_NDS(destLSDptr, word, MSDptr_zuweisung,len_zuweisung,LSDptr_zuweisung, check_for_0,zero_statement) \