Index: test/cctest/test-heap.cc |
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc |
index 757b36d1391b2338e8842fe7042d068cd4637a3d..45ec1fc3f96ed185e1982e0be5252f19ff217a4a 100644 |
--- a/test/cctest/test-heap.cc |
+++ b/test/cctest/test-heap.cc |
@@ -3919,8 +3919,12 @@ TEST(NoWeakHashTableLeakWithIncrementalMarking) { |
} |
heap->CollectAllGarbage(i::Heap::kNoGCFlags); |
} |
- WeakHashTable* table = WeakHashTable::cast(heap->weak_object_to_code_table()); |
- CHECK_EQ(0, table->NumberOfElements()); |
+ int elements = 0; |
+ if (heap->weak_object_to_code_table()->IsHashTable()) { |
+ WeakHashTable* t = WeakHashTable::cast(heap->weak_object_to_code_table()); |
+ elements = t->NumberOfElements(); |
+ } |
+ CHECK_EQ(0, elements); |
} |