New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
utf8::downgrade() FAIL_OK argument should not be treated as an integer #13684
Comments
From @demerphqutf8::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. Yves -- |
From @demerphqOn 21 March 2014 17:50, demerphq <demerphq@gmail.com> wrote:
smoke-me/fix_perl121486 passes all test. I am told we are under a code freeze so I have not commit 939b91a utf8::downgrade($x,FAIL_OK) is not supposed to treat FAIL_OK as an integer Inline Patchdiff --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); |
From @khwilliamsonThis was fixed by 3ca75ec |
The RT System itself - Status changed from 'new' to 'open' |
@khwilliamson - Status changed from 'open' to 'resolved' |
From @khwilliamsonReopening so can change to pending release |
@khwilliamson - Status changed from 'resolved' to 'open' |
@khwilliamson - Status changed from 'open' to 'pending release' |
From @khwilliamsonThanks for submitting this ticket The issue should be resolved with the release today of Perl v5.22. If you find that the problem persists, feel free to reopen this ticket -- |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#121486 (status was 'resolved')
Searchable as RT121486$
The text was updated successfully, but these errors were encountered: