From c93bd38fcc4bd1bd18b34609aab048cbe48d3faf Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Wed, 3 Dec 2025 14:51:11 +1100 Subject: [PATCH] pp_multiconcat: use the new AMGf_force_scalar instead of a special case in amagic_call() --- gv.c | 3 +-- pp_hot.c | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gv.c b/gv.c index bb505c5bf1..9ad566c01b 100644 --- a/gv.c +++ b/gv.c @@ -4154,8 +4154,7 @@ Perl_amagic_call(pTHX_ SV *left, SV *right, int method, int flags) * with the context of individual concats being scalar, * regardless of the overall context of the multiconcat op */ - U8 gimme = (force_scalar || (flags & AMGf_force_scalar) - || !PL_op || PL_op->op_type == OP_MULTICONCAT) + U8 gimme = (force_scalar || (flags & AMGf_force_scalar) || !PL_op ) ? G_SCALAR : GIMME_V; CATCH_SET(TRUE); diff --git a/pp_hot.c b/pp_hot.c index ff48f99e61..35467dd988 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -1377,7 +1377,8 @@ PP(pp_multiconcat) ) { SV * const tmpsv = amagic_call(left, right, concat_amg, - (nextappend ? AMGf_assign: 0)); + (nextappend ? AMGf_assign: 0) + | AMGf_force_scalar); if (tmpsv) { /* NB: tryAMAGICbin_MG() includes an OPpTARGET_MY test * here, which isn't needed as any implicit