From 48ce0f39937c135fe1f9164e9c737d980b543c6b Mon Sep 17 00:00:00 2001 From: anjiaqi Date: Fri, 11 Jul 2025 16:46:07 +0800 Subject: [PATCH] 0603-fix-alert include 4 Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/ICLQAO Signed-off-by: anjiaqi --- ets2panda/checker/ETSchecker.cpp | 2 +- ets2panda/checker/types/ets/etsAnyType.cpp | 1 + ets2panda/compiler/core/ETSGen.cpp | 12 +++++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ets2panda/checker/ETSchecker.cpp b/ets2panda/checker/ETSchecker.cpp index eed861a87b..f9e052f39f 100644 --- a/ets2panda/checker/ETSchecker.cpp +++ b/ets2panda/checker/ETSchecker.cpp @@ -426,7 +426,7 @@ bool ETSChecker::IsClassStaticMethod(checker::ETSObjectType *objType, checker::S // Bugs: these types do not appear as a valid TypeKind, as the TypeKind has more then one bit set [[maybe_unused]] static constexpr auto NOT_A_TYPE_KIND = TypeFlag::ETS_DYNAMIC_FLAG; - + CHECK_NOT_NULL(type); auto res = static_cast(type->TypeFlags() & ~(TO_CLEAR)); ES2PANDA_ASSERT_POS(res == TypeFlag::NONE || helpers::math::IsPowerOfTwo(res & ~(NOT_A_TYPE_KIND)), ark::es2panda::GetPositionForDiagnostic()); diff --git a/ets2panda/checker/types/ets/etsAnyType.cpp b/ets2panda/checker/types/ets/etsAnyType.cpp index 811705455b..63dc4d1417 100644 --- a/ets2panda/checker/types/ets/etsAnyType.cpp +++ b/ets2panda/checker/types/ets/etsAnyType.cpp @@ -64,6 +64,7 @@ void ETSAnyType::Cast(TypeRelation *relation, Type *target) if (relation->ApplyUnboxing()) { auto *const boxedTarget = relation->GetChecker()->AsETSChecker()->MaybeBoxInRelation(target); + ES2PANDA_ASSERT(boxedTarget != nullptr); conversion::Unboxing(relation, boxedTarget->AsETSObjectType()); relation->Result(true); } diff --git a/ets2panda/compiler/core/ETSGen.cpp b/ets2panda/compiler/core/ETSGen.cpp index bd7cb0bcbe..040790ec1b 100644 --- a/ets2panda/compiler/core/ETSGen.cpp +++ b/ets2panda/compiler/core/ETSGen.cpp @@ -788,6 +788,7 @@ void ETSGen::IsInstanceDynamic(const ir::BinaryExpression *const node, const VRe void ETSGen::TestIsInstanceConstituent(const ir::AstNode *const node, std::tuple