From c14c083ef6ca1600961fcd6564ba3905f7b34fa5 Mon Sep 17 00:00:00 2001 From: Roland Takacs Date: Fri, 15 Aug 2025 09:25:33 +0200 Subject: [PATCH] Disable unfolding call expressions by lowering Unfolding call expressions during constant expression lowering can lead to incorrect behavior in certain cases. Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/ICT65Y Internal issues: #29043 Signed-off-by: Roland Takacs Change-Id: I81de153456c9a71d20e3e1325ad10ecc5657db34 --- .../compiler/lowering/ets/constantExpressionLowering.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ets2panda/compiler/lowering/ets/constantExpressionLowering.cpp b/ets2panda/compiler/lowering/ets/constantExpressionLowering.cpp index 362503a095..3c581011ec 100644 --- a/ets2panda/compiler/lowering/ets/constantExpressionLowering.cpp +++ b/ets2panda/compiler/lowering/ets/constantExpressionLowering.cpp @@ -1320,6 +1320,11 @@ ir::AstNode *ConstantExpressionLowering::MaybeUnfoldIdentifier(ir::Identifier *n return node; } + // Unfolding call expressions is temporatily disabled (#29043). + if (node->Parent()->IsCallExpression() && node->Parent()->AsCallExpression()->Callee() == node) { + return node; + } + // Left-Hand-Side identifiers in UpdateExpression or BinaryExpression cannot be unfolded if (node->Parent()->IsUpdateExpression() && node->Parent()->AsUpdateExpression()->Argument() == node) { return node; -- Gitee