From fe1edc733a99ee4d0c81b301062ec425a6748bcc Mon Sep 17 00:00:00 2001 From: anjiaqi Date: Fri, 29 Aug 2025 12:56:46 +0800 Subject: [PATCH] fix assertFail on call toString(number) Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/ICVE3Z Signed-off-by: anjiaqi --- ets2panda/compiler/core/ETSGen.h | 3 +-- ets2panda/compiler/core/ETSemitter.cpp | 5 +---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/ets2panda/compiler/core/ETSGen.h b/ets2panda/compiler/core/ETSGen.h index 72d720e521..fe82f7c757 100644 --- a/ets2panda/compiler/core/ETSGen.h +++ b/ets2panda/compiler/core/ETSGen.h @@ -301,8 +301,7 @@ public: bool IsDevirtualizedSignature(const checker::Signature *signature) { ES2PANDA_ASSERT(signature != nullptr && !signature->HasSignatureFlag(checker::SignatureFlags::STATIC)); - return signature->HasSignatureFlag(checker::SignatureFlags::FINAL | checker::SignatureFlags::PRIVATE | - checker::SignatureFlags::CONSTRUCTOR); + return signature->HasSignatureFlag(checker::SignatureFlags::PRIVATE | checker::SignatureFlags::CONSTRUCTOR); } void EmitEtsTypeof([[maybe_unused]] const ir::AstNode *node, [[maybe_unused]] const VReg reg) diff --git a/ets2panda/compiler/core/ETSemitter.cpp b/ets2panda/compiler/core/ETSemitter.cpp index e7476cd395..68b5b41d83 100644 --- a/ets2panda/compiler/core/ETSemitter.cpp +++ b/ets2panda/compiler/core/ETSemitter.cpp @@ -119,7 +119,6 @@ static pandasm::Function GenScriptFunction(const ir::ScriptFunction *scriptFunc, { auto *funcScope = scriptFunc->Scope(); auto *paramScope = funcScope->ParamScope(); - auto func = pandasm::Function(funcScope->InternalName().Mutf8(), EXTENSION); func.params.reserve(paramScope->Params().size()); @@ -348,9 +347,7 @@ void ETSEmitter::GenExternalRecord(varbinder::RecordTable *recordTable, const pa continue; } - if (Program()->functionStaticTable.find(func.name) == Program()->functionStaticTable.cend()) { - Program()->AddToFunctionTable(std::move(func)); - } + Program()->AddToFunctionTable(std::move(func)); } } -- Gitee