From 3926a95c65de7d279f07576b054b936d4cfc48e4 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 9 Feb 2016 19:06:22 +0300 Subject: [PATCH] sgen: fix bit counting in mword Fixes GC crashe for 64-bit architecture when using libmono. http://lists.ximian.com/pipermail/mono-devel-list/2016-February/043507.html --- mono/sgen/sgen-marksweep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mono/sgen/sgen-marksweep.c b/mono/sgen/sgen-marksweep.c index 929d86031fe..7aaaa0221e1 100644 --- a/mono/sgen/sgen-marksweep.c +++ b/mono/sgen/sgen-marksweep.c @@ -1401,8 +1401,8 @@ bitcount (mword d) int count = 0; #ifdef __GNUC__ - if (sizeof (mword) == sizeof (unsigned long)) - count += __builtin_popcountl (d); + if (sizeof (mword) == 8) + count += __builtin_popcountll (d); else count += __builtin_popcount (d); #else -- 2.25.1