44 lines
1.4 KiB
Diff
44 lines
1.4 KiB
Diff
From 9c6b56dc65cdd9256fbe04a7baf4f085db1c04dd Mon Sep 17 00:00:00 2001
|
|
From: Tony Cook <tony@develop-help.com>
|
|
Date: Tue, 8 Aug 2017 14:45:29 +1000
|
|
Subject: [PATCH] (perl #131646) make the test less fragile
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
The original pattern "UXp>" with the $_ that causes the failure, 5,
|
|
so we end up packing exp(5) or 148.... with U packs:
|
|
|
|
- U (148), producing C2 94, with the UTF8 flag set
|
|
- X - back up a byte,
|
|
- p> - write the address of PL_sv_no's PV in big-ending
|
|
|
|
The final p> will typically overwrite the 94 with a zero on 64-bit
|
|
systems, but with the smaller address space of 32-bit systems that
|
|
high-byte is more likely to be a valid continuation byte, causing
|
|
the comparison to fail.
|
|
|
|
Instead just pack a zero byte.
|
|
|
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
|
---
|
|
t/lib/warnings/utf8 | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/t/lib/warnings/utf8 b/t/lib/warnings/utf8
|
|
index dfc58c1..a9a6388 100644
|
|
--- a/t/lib/warnings/utf8
|
|
+++ b/t/lib/warnings/utf8
|
|
@@ -779,7 +779,7 @@ BEGIN{
|
|
}
|
|
no warnings;
|
|
use warnings 'utf8';
|
|
-for(uc 0..t){0~~pack"UXp>",exp}
|
|
+for(uc 0..t){0~~pack"UXc",exp}
|
|
EXPECT
|
|
OPTIONS regex
|
|
Malformed UTF-8 character: \\x([[:xdigit:]]{2})\\x([[:xdigit:]]{2}) \(unexpected non-continuation byte 0x\2, immediately after start byte 0x\1; need 2 bytes, got 1\) in smart match at - line 9.
|
|
--
|
|
2.9.4
|
|
|