From 6975f20660ab2bdd5907fa971cdbf097ad2a4753 Mon Sep 17 00:00:00 2001 From: lijiamin2019 Date: Tue, 9 May 2023 14:37:18 +0800 Subject: [PATCH] Bugfix of debugInfo extractor for aot testcases Signed-off-by: lijiamin2019 Change-Id: I1dd518b69791674052a694b35dac1207352689bf --- ecmascript/jspandafile/debug_info_extractor.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ecmascript/jspandafile/debug_info_extractor.cpp b/ecmascript/jspandafile/debug_info_extractor.cpp index 0931067a63..1ededefe70 100644 --- a/ecmascript/jspandafile/debug_info_extractor.cpp +++ b/ecmascript/jspandafile/debug_info_extractor.cpp @@ -242,11 +242,13 @@ const std::string &DebugInfoExtractor::GetSourceCode(const panda_file::File::Ent bool DebugInfoExtractor::ExtractorMethodDebugInfo(const panda_file::File::EntityId methodId) { auto &pandaFile = *jsPandaFile_->GetPandaFile(); - if (!methodId.IsValid() || methodId.GetOffset() > jsPandaFile_->GetFileSize()) { + if (!methodId.IsValid() || methodId.GetOffset() >= jsPandaFile_->GetFileSize()) { return false; } MethodDataAccessor mda(pandaFile, methodId); - ClassDataAccessor cda(pandaFile, mda.GetClassId()); + auto classId = mda.GetClassId(); + ASSERT(classId.IsValid() && !pandaFile.IsExternal(classId)); + ClassDataAccessor cda(pandaFile, classId); auto sourceFileId = cda.GetSourceFileId(); auto debugInfoId = mda.GetDebugInfoId(); if (!debugInfoId) {