diff --git a/ecmascript/dfx/hprof/rawheap_translate/rawheap_translate.cpp b/ecmascript/dfx/hprof/rawheap_translate/rawheap_translate.cpp index bc2a80154d24d43f92254369ed820ea9c93f33ab..5ddf6dabe384a59d143b05bb15d5bf5d56ac97b8 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; }