diff --git a/src/handles/handles-inl.h b/src/handles/handles-inl.h index c0dab51de8..43c2ef807e 100644 --- a/src/handles/handles-inl.h +++ b/src/handles/handles-inl.h @@ -178,6 +178,7 @@ Address* HandleScope::CreateHandle(Isolate* isolate, Address value) { Address* HandleScope::GetHandle(Isolate* isolate, Address value) { DCHECK(AllowHandleAllocation::IsAllowed()); + DCHECK(isolate->main_thread_local_heap()->IsRunning()); DCHECK_WITH_MSG(isolate->thread_id() == ThreadId::Current(), "main-thread handle can only be created on the main thread."); HandleScopeData* data = isolate->handle_scope_data(); diff --git a/src/handles/local-handles-inl.h b/src/handles/local-handles-inl.h index f9f63175cf..4520d442d3 100644 --- a/src/handles/local-handles-inl.h +++ b/src/handles/local-handles-inl.h @@ -16,6 +16,7 @@ namespace internal { // static V8_INLINE Address* LocalHandleScope::GetHandle(LocalHeap* local_heap, Address value) { + DCHECK(local_heap->IsRunning()); if (local_heap->is_main_thread()) return LocalHandleScope::GetMainThreadHandle(local_heap, value);