develooper Front page | perl.perl5.changes | Postings from February 2018

[perl.git] branch smoke-me/leont/less-fragile-encoding updated.v5.27.8-150-gf4e72dbfa4

From:
Leon Timmermans
Date:
February 4, 2018 12:06
Subject:
[perl.git] branch smoke-me/leont/less-fragile-encoding updated.v5.27.8-150-gf4e72dbfa4
Message ID:
E1eiJ49-0000kO-FA@git.dc.perl.space
In perl.git, the branch smoke-me/leont/less-fragile-encoding has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/f4e72dbfa4b0d957dd2dcfcf63b615ddd38ae786?hp=849433b4f0231124f1448973fd44bc044b12e62d>

  discards  849433b4f0231124f1448973fd44bc044b12e62d (commit)
- Log -----------------------------------------------------------------
commit f4e72dbfa4b0d957dd2dcfcf63b615ddd38ae786
Author: Leon Timmermans <fawaka@gmail.com>
Date:   Thu Jan 4 19:56:03 2018 +0100

    Disallow coderef in $PerlIO::encoding::fallback
    
    Encode allows one to pass a coderef instead of a set of flags to handle.
    This however doesn't allow one to pass STOP_AT_PARTIAL, which means it
    has always been buggy on buffer boundaries. With my new automatic
    STOP_AT_PARTIAL passing this would result in an unpredictable value.
    Instead we now disallow it in PerlIO::encoding.

-----------------------------------------------------------------------

Summary of changes:
 ext/PerlIO-encoding/encoding.xs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ext/PerlIO-encoding/encoding.xs b/ext/PerlIO-encoding/encoding.xs
index fd1d45e3de..66728734d6 100644
--- a/ext/PerlIO-encoding/encoding.xs
+++ b/ext/PerlIO-encoding/encoding.xs
@@ -168,7 +168,7 @@ PerlIOEncode_pushed(pTHX_ PerlIO * f, const char *mode, SV * arg, PerlIO_funcs *
     }
 
     e->chk = newSVsv(get_sv("PerlIO::encoding::fallback", 0));
-    if (SvRV(e->chk))
+    if (SvROK(e->chk))
 	Perl_croak(aTHX_ "PerlIO::encoding::fallback must be an integer");
     SvUV_set(e->chk, SvUV(e->chk) | encode_stop_at_partial);
     e->inEncodeCall = 0;

-- 
Perl5 Master Repository



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About