Skip to content

Commit

Permalink
builtin::stringify: duplicate the implementation for XS
Browse files Browse the repository at this point in the history
I'm not entirely happy with this, but pp_stringify is in pp_hot.c
for a reason, so:
a) I don't want to move it
b) I don't want to complicate it

so just duplicate the trivial implementation.

Fixes #22542

(cherry picked from commit 8df7878)
  • Loading branch information
tonycoz authored and steve-m-hay committed Oct 26, 2024
1 parent 2c13bf0 commit 0ecd188
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion builtin.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,16 @@ XS(XS_builtin_func1_scalar)
break;

case OP_STRINGIFY:
Perl_pp_stringify(aTHX);
{
/* we could only call pp_stringify if we're sure there is a TARG
and if the XSUB is called from call_sv() or goto it may not
have one.
*/
dXSTARG;
sv_copypv(TARG, *PL_stack_sp);
SvSETMAGIC(TARG);
rpp_replace_1_1_NN(TARG);
}
break;

default:
Expand Down

0 comments on commit 0ecd188

Please sign in to comment.