[runtime] Fix mono_bitset_count () so it works on win64 as well. (#4413)
authorZoltan Varga <vargaz@gmail.com>
Wed, 22 Feb 2017 17:47:47 +0000 (12:47 -0500)
committerGitHub <noreply@github.com>
Wed, 22 Feb 2017 17:47:47 +0000 (12:47 -0500)
mono/utils/monobitset.c

index b86ab331dbf7e2cab2180e69cef51ae5060c10a4..2f6b6c501037c6cd070612896455c227b3f2b9ae 100644 (file)
@@ -211,10 +211,10 @@ mono_bitset_count (const MonoBitSet *set) {
        for (i = 0; i < set->size / BITS_PER_CHUNK; ++i) {
                d = set->data [i];
 #ifdef __GNUC__
-               if (sizeof (gsize) == sizeof (unsigned long))
-                       count += __builtin_popcountl (d);
-               else
+               if (sizeof (gsize) == sizeof (unsigned int))
                        count += __builtin_popcount (d);
+               else
+                       count += __builtin_popcountll (d);
 #else
                while (d) {
                        count ++;