Skip to content
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

\x{ffffffff} as string delim preserves \\ #15477

Closed
p5pRT opened this issue Jul 26, 2016 · 8 comments
Closed

\x{ffffffff} as string delim preserves \\ #15477

p5pRT opened this issue Jul 26, 2016 · 8 comments

Comments

@p5pRT
Copy link
Collaborator

@p5pRT p5pRT commented Jul 26, 2016

Migrated from rt.perl.org#128738 (status was 'resolved')

Searchable as RT128738$

@p5pRT

This comment has been minimized.

Copy link
Collaborator Author

@p5pRT p5pRT commented Jul 26, 2016

From @cpansprout

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

@p5pRT

This comment has been minimized.

Copy link
Collaborator Author

@p5pRT p5pRT commented Jul 26, 2016

From @cpansprout

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)

--

Father Chrysostomos

@p5pRT

This comment has been minimized.

Copy link
Collaborator Author

@p5pRT p5pRT commented Jul 26, 2016

The RT System itself - Status changed from 'new' to 'open'

@p5pRT

This comment has been minimized.

Copy link
Collaborator Author

@p5pRT p5pRT commented Jul 28, 2016

From @khwilliamson

On 07/26/2016 01​:39 AM, Father Chrysostomos via RT wrote​:

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.

@p5pRT

This comment has been minimized.

Copy link
Collaborator Author

@p5pRT p5pRT commented Aug 5, 2016

From @khwilliamson

Fixed by

commit 2aa61ac
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

@p5pRT

This comment has been minimized.

Copy link
Collaborator Author

@p5pRT p5pRT commented Aug 5, 2016

@khwilliamson - Status changed from 'open' to 'pending release'

@p5pRT

This comment has been minimized.

Copy link
Collaborator Author

@p5pRT p5pRT commented May 30, 2017

From @khwilliamson

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.

@p5pRT

This comment has been minimized.

Copy link
Collaborator Author

@p5pRT p5pRT commented May 30, 2017

@khwilliamson - Status changed from 'pending release' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.