diff --git a/ecmascript/dfx/hprof/rawheap_translate/rawheap_translate.cpp b/ecmascript/dfx/hprof/rawheap_translate/rawheap_translate.cpp index 5ddf6dabe384a59d143b05bb15d5bf5d56ac97b8..d8b4e96923c76fffa4c4e1d739cd23c983411ab2 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) { - int index = field.offset / sizeof(uint64_t) - 1; - if (index < 0 || static_cast(index) >= refs.size()) { + size_t index = field.offset / sizeof(uint64_t) - 1; + if (index >= refs.size()) { continue; }