From: Ivan Maidanski Date: Thu, 23 Mar 2017 19:44:11 +0000 (+0300) Subject: Fix static assertion violation in LONG_MULT for 64-bit targets X-Git-Tag: v8.0.0~817 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9442667628d63142d74652dbc096f69dcf1873d1;p=gc Fix static assertion violation in LONG_MULT for 64-bit targets * include/private/gc_pmark.h [MARK_BIT_PER_OBJ] (PUSH_CONTENTS_HDR): Cast displ to unsigned32 when passed to LONG_MULT (it is safe because displ is less than HBLKSIZE). --- diff --git a/include/private/gc_pmark.h b/include/private/gc_pmark.h index 50772641..cb65f3d1 100644 --- a/include/private/gc_pmark.h +++ b/include/private/gc_pmark.h @@ -291,9 +291,9 @@ GC_INNER mse * GC_signal_mark_stack_overflow(mse *msp); unsigned32 low_prod, high_prod; \ unsigned32 inv_sz = hhdr -> hb_inv_sz; \ ptr_t base = current; \ - LONG_MULT(high_prod, low_prod, displ, inv_sz); \ + LONG_MULT(high_prod, low_prod, (unsigned32)displ, inv_sz); \ /* product is > and within sz_in_bytes of displ * sz_in_bytes * 2**32 */ \ - if (EXPECT(low_prod >> 16 != 0, FALSE)) { \ + if (EXPECT(low_prod >> 16 != 0, FALSE)) { \ /* FIXME: fails if offset is a multiple of HBLKSIZE which becomes 0 */ \ if (inv_sz == LARGE_INV_SZ) { \ size_t obj_displ; \