Skip Menu |
Report information
Id: 128738
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors:
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: (no value)
Severity: low
Type:
Perl Version: (no value)
Fixed In: (no value)



Subject: \x{ffffffff} as string delim preserves \\
Download (untitled) / with headers
text/plain 507b
OK, so this is the *real* bug I was after when I opened ticket #128737 (when I wasn’t thinking): $ ./miniperl -e 'eval "print q \x{fffffff}Hello, \\\\whirled!\n\x{fffffff}" or die;' Hello, \whirled! That is expected. But add another f: $ ./miniperl -e 'eval "print q \x{ffffffff}Hello, \\\\whirled!\n\x{ffffffff}" or die;' Hello, \\whirled! And \\ in a q() string is now being preserved, instead of being changed to a single backslash. Same results from 5.8.7 to 5.25.3. -- Father Chrysostomos
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 836b
On Tue Jul 26 00:28:37 2016, sprout wrote: Show quoted text
> OK, so this is the *real* bug I was after when I opened ticket #128737 > (when I wasn’t thinking): > > $ ./miniperl -e 'eval "print q \x{fffffff}Hello, > \\\\whirled!\n\x{fffffff}" or die;' > Hello, \whirled! > > That is expected. But add another f: > > $ ./miniperl -e 'eval "print q \x{ffffffff}Hello, > \\\\whirled!\n\x{ffffffff}" or die;' > Hello, \\whirled! > > And \\ in a q() string is now being preserved, instead of being > changed to a single backslash. > > Same results from 5.8.7 to 5.25.3.
Another symptom of the same bug: \x{100000027} acts as a single quote for regexps: $ ./miniperl -le 'eval "print qr \x{100000027}\$^O\x{100000027}" || die' (?^:$^O) $ ./miniperl -le 'eval "print qr \x{10000002}\$^O\x{10000002}" || die' (?^:darwin) -- Father Chrysostomos
Date: Wed, 27 Jul 2016 20:48:30 -0600
From: Karl Williamson <public [...] khwilliamson.com>
CC: perl5-porters [...] perl.org
Subject: Re: [perl #128738] \x{ffffffff} as string delim preserves \\
To: perlbug-followup [...] perl.org
On 07/26/2016 01:39 AM, Father Chrysostomos via RT wrote: Show quoted text
> On Tue Jul 26 00:28:37 2016, sprout wrote:
>> OK, so this is the *real* bug I was after when I opened ticket #128737 >> (when I wasn’t thinking): >> >> $ ./miniperl -e 'eval "print q \x{fffffff}Hello, >> \\\\whirled!\n\x{fffffff}" or die;' >> Hello, \whirled! >> >> That is expected. But add another f: >> >> $ ./miniperl -e 'eval "print q \x{ffffffff}Hello, >> \\\\whirled!\n\x{ffffffff}" or die;' >> Hello, \\whirled! >> >> And \\ in a q() string is now being preserved, instead of being >> changed to a single backslash. >> >> Same results from 5.8.7 to 5.25.3.
> > Another symptom of the same bug: > > \x{100000027} acts as a single quote for regexps: > > $ ./miniperl -le 'eval "print qr \x{100000027}\$^O\x{100000027}" || die' > (?^:$^O) > $ ./miniperl -le 'eval "print qr \x{10000002}\$^O\x{10000002}" || die' > (?^:darwin) > >
This is because termcode in scan_str() needs to be IV and not I32. Probably a test should be added to croak when out-of-range.
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 550b
Fixed by commit 2aa61ac397079a33eb3c36c2e7c1f41be224c657 Author: Karl Williamson <khw@cpan.org> Date: Thu Aug 4 14:07:53 2016 -0600 PATCH: [perl #128738] Large code pt as string delim The bug here is simply an I32 was used when an IV was needed. One could argue that the parser should refuse to accept something larger than an IV. I chose not to do that, as this is a deprecated usage, which generates a warning by default and will be a syntax error anyway in a future release. -- Karl Williamson
Download (untitled) / with headers
text/plain 313b
Thank you for filing this report. You have helped make Perl better. With the release today of Perl 5.26.0, this and 210 other issues have been resolved. Perl 5.26.0 may be downloaded via: https://metacpan.org/release/XSAWYERX/perl-5.26.0 If you find that the problem persists, feel free to reopen this ticket.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org