pp_multiconcat: use the new AMGf_force_scalar

instead of a special case in amagic_call()
This commit is contained in:
Tony Cook 2025-12-03 14:51:11 +11:00
parent 46a4ed5f61
commit c93bd38fcc
2 changed files with 3 additions and 3 deletions

3
gv.c
View File

@ -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);

View File

@ -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