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 Perl#22542
  • Loading branch information
tonycoz committed Sep 10, 2024
1 parent 6f14737 commit 4fde31c
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 4fde31c

Please sign in to comment.