This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
change #25129 was overzealous in delaying the call to ckWARN
[perl5.git] / pp_hot.c
index 35558f1..1e3d5ea 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1611,8 +1611,8 @@ Perl_do_readline(pTHX)
             const STRLEN len = SvCUR(sv) - offset;
             const U8 *f;
             
-            if (!Perl_is_utf8_string_loc(aTHX_ s, len, &f)
-               && ckWARN(WARN_UTF8))
+            if (ckWARN(WARN_UTF8) &&
+                   !Perl_is_utf8_string_loc(aTHX_ s, len, &f))
                  /* Emulate :encoding(utf8) warning in the same case. */
                  Perl_warner(aTHX_ packWARN(WARN_UTF8),
                              "utf8 \"\\x%02X\" does not map to Unicode",