From b0926e71fb997927909cd7267e2b7806bfbb38b4 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Thu, 13 Sep 2007 16:45:09 -0600 Subject: [PATCH] fix math errors when walking object map in collect()::Client::walk() --- src/machine.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/machine.cpp b/src/machine.cpp index 3c25c0998a..6a24886588 100644 --- a/src/machine.cpp +++ b/src/machine.cpp @@ -2617,7 +2617,7 @@ collect(Thread* t, Heap::CollectionType type) = ceiling(arrayElementSize, BytesPerWord); for (unsigned i = 0; i < fixedSizeInWords; ++i) { - if (mask[wordOf(i)] & (static_cast(1) << bitOf(i))) { + if (mask[i / 32] & (static_cast(1) << (i % 32))) { if (not w->visit(i)) { return; } @@ -2627,7 +2627,7 @@ collect(Thread* t, Heap::CollectionType type) bool arrayObjectElements = false; for (unsigned j = 0; j < arrayElementSizeInWords; ++j) { unsigned k = fixedSizeInWords + j; - if (mask[wordOf(k)] & (static_cast(1) << bitOf(k))) { + if (mask[k / 32] & (static_cast(1) << (k % 32))) { arrayObjectElements = true; break; } @@ -2637,7 +2637,7 @@ collect(Thread* t, Heap::CollectionType type) for (unsigned i = 0; i < arrayLength; ++i) { for (unsigned j = 0; j < arrayElementSizeInWords; ++j) { unsigned k = fixedSizeInWords + j; - if (mask[wordOf(k)] & (static_cast(1) << bitOf(k))) { + if (mask[k / 32] & (static_cast(1) << (k % 32))) { if (not w->visit (fixedSizeInWords + (i * arrayElementSizeInWords) + j)) {