diff options
author | 2024-08-12 22:44:17 +0000 | |
---|---|---|
committer | 2024-08-13 05:19:19 +0000 | |
commit | 75e123b2850ac20123351341d7b23400fed229af (patch) | |
tree | 0d8b82ca3c765f1eb4144b9d08f3f5c1e7d307e7 | |
parent | 3ad282d75dba70238e9cfcb6b28676d8eb13dd1c (diff) |
Fix IsPerformingCompaction check in VerifyOverflowReferenceBitmap()
The function could be called when heap is not constructed yet. So handle
that case.
Test: art/test/testrunner/testrunner.py --host
Bug: 358560587
Change-Id: I2653489cedf45cda208e89dc5356bd4a52eec930
-rw-r--r-- | runtime/mirror/class-inl.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/mirror/class-inl.h b/runtime/mirror/class-inl.h index 482faec5f9..7e1dbeb041 100644 --- a/runtime/mirror/class-inl.h +++ b/runtime/mirror/class-inl.h @@ -760,7 +760,8 @@ inline size_t Class::GetPrimitiveTypeSizeShift() { template <VerifyObjectFlags kVerifyFlags, ReadBarrierOption kReadBarrierOption> inline void Class::VerifyOverflowReferenceBitmap() { // Can't reliably access super-classes during CMC compaction. - if (Runtime::Current()->GetHeap()->IsPerformingUffdCompaction()) { + if (Runtime::Current() != nullptr && Runtime::Current()->GetHeap() != nullptr && + Runtime::Current()->GetHeap()->IsPerformingUffdCompaction()) { return; } CHECK(!IsVariableSize<kVerifyFlags>()); |