From ec46765a2fbc1c332731d4b7cfce7c84264adbd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A9=B9=E6=98=8A?= Date: Tue, 19 Aug 2025 17:10:52 +0800 Subject: [PATCH] fix uint will not less than 0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue:#ICTPD4 Signed-off-by: 詹昊 --- ecmascript/dfx/hprof/rawheap_translate/rawheap_translate.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ecmascript/dfx/hprof/rawheap_translate/rawheap_translate.cpp b/ecmascript/dfx/hprof/rawheap_translate/rawheap_translate.cpp index bc2a80154d..5ddf6dabe3 100644 --- a/ecmascript/dfx/hprof/rawheap_translate/rawheap_translate.cpp +++ b/ecmascript/dfx/hprof/rawheap_translate/rawheap_translate.cpp @@ -766,8 +766,8 @@ void RawHeapTranslateV2::BuildFieldEdges(Node *node, std::vector &refs) } for (auto &field : meta->fields) { - size_t index = field.offset / sizeof(uint64_t) - 1; - if (index >= refs.size() || index < 0) { + int index = field.offset / sizeof(uint64_t) - 1; + if (index < 0 || static_cast(index) >= refs.size()) { continue; } -- Gitee