diff options
Diffstat (limited to 'deps/v8/test/unittests/heap/cppgc/prefinalizer-unittest.cc')
-rw-r--r-- | deps/v8/test/unittests/heap/cppgc/prefinalizer-unittest.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/deps/v8/test/unittests/heap/cppgc/prefinalizer-unittest.cc b/deps/v8/test/unittests/heap/cppgc/prefinalizer-unittest.cc index 5fc412c8c3..985938bede 100644 --- a/deps/v8/test/unittests/heap/cppgc/prefinalizer-unittest.cc +++ b/deps/v8/test/unittests/heap/cppgc/prefinalizer-unittest.cc @@ -292,9 +292,11 @@ class GCedHolder : public GarbageCollected<GCedHolder> { } // namespace #if V8_ENABLE_CHECKS -#ifdef CPPGC_CHECK_ASSIGNMENTS_IN_PREFINALIZERS +#ifdef CPPGC_VERIFY_HEAP -TEST_F(PrefinalizerDeathTest, PrefinalizerCantRewireGraphWithDeadObjects) { +TEST_F(PrefinalizerDeathTest, PrefinalizerCanRewireGraphWithDeadObjects) { + // Prefinalizers are allowed to rewire dead object to dead objects as that + // doesn't affect the live object graph. Persistent<LinkedNode> root{MakeGarbageCollected<LinkedNode>( GetAllocationHandle(), MakeGarbageCollected<LinkedNode>( @@ -305,7 +307,7 @@ TEST_F(PrefinalizerDeathTest, PrefinalizerCantRewireGraphWithDeadObjects) { // All LinkedNode objects will die on the following GC. The pre-finalizer may // still operate with them but not add them to a live object. root.Clear(); - EXPECT_DEATH_IF_SUPPORTED(PreciseGC(), ""); + PreciseGC(); } TEST_F(PrefinalizerDeathTest, PrefinalizerCantRessurectObjectOnStack) { @@ -325,7 +327,7 @@ TEST_F(PrefinalizerDeathTest, PrefinalizerCantRessurectObjectOnHeap) { EXPECT_DEATH_IF_SUPPORTED(PreciseGC(), ""); } -#endif // CPPGC_CHECK_ASSIGNMENTS_IN_PREFINALIZERS +#endif // CPPGC_VERIFY_HEAP #endif // V8_ENABLE_CHECKS #ifdef CPPGC_ALLOW_ALLOCATIONS_IN_PREFINALIZERS |