mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-23 18:20:04 +00:00
add some nullptr assert and free/close space/fd
Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/IAJUVD Signed-off-by: linxiang8 <linxiang8@huawei.com> Change-Id: I977bc6e18b3da215808d531adb58f82229ff7908
This commit is contained in:
parent
47e7002658
commit
9849e792fc
@ -1079,7 +1079,7 @@ public:
|
||||
if (index >= bb.succs.size()) {
|
||||
if (bb.loopNumber > 0) {
|
||||
if (visitState_[curState.bbId] == MarkState::ON_STACK) {
|
||||
ASSERT(loopInfo->loopHeadId == curState.bbId);
|
||||
ASSERT(loopInfo != nullptr && loopInfo->loopHeadId == curState.bbId);
|
||||
loopInfo = loopInfo->parentInfo;
|
||||
visitState_[curState.bbId] = MarkState::VISITED1;
|
||||
}
|
||||
|
@ -268,6 +268,7 @@ void HeapSnapshotJSONSerializer::SerializeStringTable(HeapSnapshot *snapshot, St
|
||||
|
||||
void HeapSnapshotJSONSerializer::SerializeString(CString *str, StreamWriter *writer)
|
||||
{
|
||||
ASSERT(str != nullptr);
|
||||
const char *s = str->c_str();
|
||||
while (*s != '\0') {
|
||||
if (*s == '\"' || *s == '\\') {
|
||||
|
@ -58,7 +58,6 @@ bool JsStackGetter::ParseMethodInfo(struct MethodKey &methodKey,
|
||||
bool isCpuProfiler)
|
||||
{
|
||||
auto method = it.CheckAndGetMethod();
|
||||
const JSPandaFile *jsPandaFile = method->GetJSPandaFile();
|
||||
codeEntry.methodKey = methodKey;
|
||||
if (method->IsNativeWithCallField()) {
|
||||
FrameIterator itNext(it.GetSp(), it.GetThread());
|
||||
@ -66,6 +65,10 @@ bool JsStackGetter::ParseMethodInfo(struct MethodKey &methodKey,
|
||||
GetNativeMethodCallPos(itNext, codeEntry);
|
||||
GetNativeStack(vm, it, codeEntry.functionName, sizeof(codeEntry.functionName), isCpuProfiler);
|
||||
} else {
|
||||
const JSPandaFile *jsPandaFile = method->GetJSPandaFile();
|
||||
if (jsPandaFile == nullptr) {
|
||||
return false;
|
||||
}
|
||||
EntityId methodId = reinterpret_cast<MethodLiteral *>(methodKey.methodIdentifier)->GetMethodId();
|
||||
// function name
|
||||
const char *functionName = MethodLiteral::GetMethodName(jsPandaFile, methodId, true);
|
||||
|
@ -164,6 +164,7 @@ const JSPandaFile* FrameHandler::GetJSPandaFile() const
|
||||
std::string FrameHandler::GetFileName() const
|
||||
{
|
||||
auto pandaFile = GetJSPandaFile();
|
||||
ASSERT(pandaFile != nullptr);
|
||||
return pandaFile->GetJSPandaFileDesc().c_str();
|
||||
}
|
||||
|
||||
|
@ -164,6 +164,7 @@ public:
|
||||
if (GetIsEncryptedBundle() > 0) {
|
||||
DecryptRemoveKey(fd);
|
||||
}
|
||||
close(fd);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
@ -469,4 +470,4 @@ private:
|
||||
bool IsEncryptedBundle_{false};
|
||||
};
|
||||
} // namespace panda::ecmascript::kungfu
|
||||
#endif
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user