From 893f30107051cd36a31da6a667d26ade3d616f37 Mon Sep 17 00:00:00 2001 From: Zelentsov Dmitry Date: Fri, 6 Jun 2025 18:14:18 +0300 Subject: [PATCH] Fix unbox lowering Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/ICEHWE Tests: use Test-U-Runner and CI Signed-off-by: Zelentsov Dmitry --- ets2panda/compiler/lowering/ets/restTupleLowering.cpp | 1 - ets2panda/compiler/lowering/ets/unboxLowering.cpp | 4 ++-- ets2panda/test/test-lists/ets-runtime/ets-runtime-ignored.txt | 2 -- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/ets2panda/compiler/lowering/ets/restTupleLowering.cpp b/ets2panda/compiler/lowering/ets/restTupleLowering.cpp index 36554fe955..9d388f9afb 100644 --- a/ets2panda/compiler/lowering/ets/restTupleLowering.cpp +++ b/ets2panda/compiler/lowering/ets/restTupleLowering.cpp @@ -268,7 +268,6 @@ ir::ScriptFunction *CreateNewScriptFunction(public_lib::Context *ctx, ir::Script for (auto *annotationUsage : scriptFunc->Annotations()) { annotationUsages.push_back(annotationUsage->Clone(allocator, newScriptFunc)->AsAnnotationUsage()); } - std::cerr << "CreateNewScriptFunction SetAnnotations for newScriptFunc " << newScriptFunc << std::endl; newScriptFunc->SetAnnotations(std::move(annotationUsages)); ir::Identifier *newScriptFuncId = scriptFunc->Id()->Clone(allocator, newScriptFunc); diff --git a/ets2panda/compiler/lowering/ets/unboxLowering.cpp b/ets2panda/compiler/lowering/ets/unboxLowering.cpp index 2f60dd17e0..8a9c49e31d 100644 --- a/ets2panda/compiler/lowering/ets/unboxLowering.cpp +++ b/ets2panda/compiler/lowering/ets/unboxLowering.cpp @@ -923,8 +923,8 @@ struct UnboxVisitor : public ir::visitor::EmptyAstVisitor { ES2PANDA_ASSERT(!call->Arguments().empty()); call->SetTsType(call->Arguments()[0]->TsType()); } - } else { - call->SetTsType(call->Signature()->ReturnType()); + } else if (auto *returnType = call->Signature()->ReturnType(); returnType->IsETSPrimitiveType()) { + call->SetTsType(returnType); } } diff --git a/ets2panda/test/test-lists/ets-runtime/ets-runtime-ignored.txt b/ets2panda/test/test-lists/ets-runtime/ets-runtime-ignored.txt index 0b82d086c3..93b868ca78 100644 --- a/ets2panda/test/test-lists/ets-runtime/ets-runtime-ignored.txt +++ b/ets2panda/test/test-lists/ets-runtime/ets-runtime-ignored.txt @@ -113,8 +113,6 @@ lambda_with_restparameter_optinal.ets overload-primitive-and-object.ets lambda_with_restparameter_optinal_fixedarray.ets finallyTryAbruptedByReturn.ets -generic_lambda_3.ets -generic_lambda_6.ets Recursive_Parameter_2.ets Recursive_Parameter_3.ets -- Gitee