Skip to content

Commit

Permalink
utf8::upgrade: Don't coerce undef arg
Browse files Browse the repository at this point in the history
This fixes GH #20419
  • Loading branch information
khwilliamson committed Oct 28, 2022
1 parent fdc8a0b commit 6ea2a51
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions universal.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,10 +593,13 @@ XS(XS_utf8_upgrade)
croak_xs_usage(cv, "sv");
else {
SV * const sv = ST(0);
STRLEN RETVAL;
STRLEN RETVAL = 0;
dXSTARG;

RETVAL = sv_utf8_upgrade(sv);
if (LIKELY(sv && SvANY(sv))) {
RETVAL = sv_utf8_upgrade(sv);
}

XSprePUSH; PUSHi((IV)RETVAL);
}
XSRETURN(1);
Expand Down

0 comments on commit 6ea2a51

Please sign in to comment.