diff --git a/test/cctest/test-mark-compact.cc b/test/cctest/test-mark-compact.cc index 48610b09ac..d94c37e808 100644 --- a/test/cctest/test-mark-compact.cc +++ b/test/cctest/test-mark-compact.cc @@ -53,6 +53,7 @@ static void InitializeVM() { TEST(MarkingDeque) { + InitializeVM(); int mem_size = 20 * kPointerSize; byte* mem = NewArray(20*kPointerSize); Address low = reinterpret_cast
(mem); @@ -60,19 +61,20 @@ TEST(MarkingDeque) { MarkingDeque s; s.Initialize(low, high); - Address address = NULL; + Address original_address = reinterpret_cast
(&s); + Address current_address = original_address; while (!s.IsFull()) { - s.PushBlack(HeapObject::FromAddress(address)); - address += kPointerSize; + s.PushBlack(HeapObject::FromAddress(current_address)); + current_address += kPointerSize; } while (!s.IsEmpty()) { Address value = s.Pop()->address(); - address -= kPointerSize; - CHECK_EQ(address, value); + current_address -= kPointerSize; + CHECK_EQ(current_address, value); } - CHECK_EQ(NULL, address); + CHECK_EQ(original_address, current_address); DeleteArray(mem); }