# New Ticket Created by yves orton # Please include the string: [perl #121487] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/Ticket/Display.html?id=121487 > On 21 March 2014 17:50, demerphq <demerphq@gmail.com> wrote: > utf8::downgrade($foo,"fail_ok"); > > Produces: > > Argument "fail_ok" isn't numeric in subroutine entry > > Cause is calling SvIV() on the argument: > > const bool failok = (items < 2) ? 0 : (int)SvIV(ST(1)); > > Solution is to use SvTRUE() instead. > > Fix is complete and is waiting test pass to push. smoke-me/fix_perl121486 passes all test. I am told we are under a code freeze so I have not merged the commit, but it is a simple path: commit 939b91ab41c36da4a0ba52c515c7c8344b51fede Author: Yves Orton <demerphq@gmail.com> Date: Fri Mar 21 17:47:45 2014 +0100 utf8::downgrade($x,FAIL_OK) is not supposed to treat FAIL_OK as an integer diff --git a/universal.c b/universal.c index bccc8fb..dde37bc 100644 --- a/universal.c +++ b/universal.c @@ -513,7 +513,7 @@ XS(XS_utf8_downgrade) croak_xs_usage(cv, "sv, failok=0"); else { SV * const sv = ST(0); - const bool failok = (items < 2) ? 0 : (int)SvIV(ST(1)); + const bool failok = (items < 2) ? 0 : SvTRUE(ST(1)) ? 1 : 0; const bool RETVAL = sv_utf8_downgrade(sv, failok); ST(0) = boolSV(RETVAL);