diff --git a/src/inspector/inspector_socket_server.cpp b/src/inspector/inspector_socket_server.cpp index 82a440c9bbb37ecc30f0af80f3afebd804a7bcd3..4ce6dccf44e21baba9c1ae55828bdeb630eeb78d 100644 --- a/src/inspector/inspector_socket_server.cpp +++ b/src/inspector/inspector_socket_server.cpp @@ -327,7 +327,7 @@ SocketSession* InspectorSocketServer::Session(int sessionId) void InspectorSocketServer::SessionStarted(int sessionId, const std::string& targetId, const std::string& wsKey) { SocketSession* session = Session(sessionId); - CHECK_NULL(session); + DCHECK(session != nullptr); if (!TargetExists(targetId)) { session->Decline(); return; @@ -361,7 +361,7 @@ void InspectorSocketServer::SessionTerminated(int sessionId) bool InspectorSocketServer::HandleGetRequest(int sessionId, const std::string& hostName, const std::string& path) { SocketSession* session = Session(sessionId); - CHECK_NULL(session); + DCHECK(session != nullptr); InspectorSocket* socket = session->GetWsSocket(); if (!inspectPublishUid.http) { SendHttpNotFound(socket); @@ -553,7 +553,7 @@ void SocketSession::Delegate::OnHttpGet(const std::string& host, const std::stri { if (!server->HandleGetRequest(usessionId, host, path)) { SocketSession* session = Session(); - CHECK_NULL(session); + DCHECK(session != nullptr); session->GetWsSocket()->CancelHandshake(); } } diff --git a/src/js_native_api_v8.cpp b/src/js_native_api_v8.cpp index 7ba4d7c29edae5f7fba07c9d80d321fb2310cd8b..dacf67db7cb3afd9a5f090fb2c6b7ace0a151376 100644 --- a/src/js_native_api_v8.cpp +++ b/src/js_native_api_v8.cpp @@ -5398,6 +5398,7 @@ JSVM_EXTERN JSVM_Status OH_JSVM_TraceStart(size_t count, } TraceBuffer* ring_buffer = TraceBuffer::CreateTraceBufferRingBuffer(max_chunks, writer); + DCHECK(controller != nullptr); controller->Initialize(ring_buffer); controller->StartTracing(trace_config); return JSVM_OK; diff --git a/src/jsvm_reference.cpp b/src/jsvm_reference.cpp index ad917b203dae5f2fcbdad1723128e862b8574052..66e298f113455d11c6ec943d1132409ca232e600 100644 --- a/src/jsvm_reference.cpp +++ b/src/jsvm_reference.cpp @@ -46,7 +46,7 @@ UserReference* UserReference::NewData(JSVM_Env env, v8::Local value, u } UserReference::UserReference(JSVM_Env env, v8::Local value, bool isValue, uint32_t initialRefcount) - : persistent(env->isolate, value), isValue(isValue), env(env), refcount(initialRefcount), + : persistent(env->isolate, value), env(env), refcount(initialRefcount), isValue(isValue), canBeWeak(isValue && CanBeHeldWeakly(value.As())) { if (refcount == 0) {