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

Implementation details leak through in variable interpolation into regexes #2488

Closed
p6rt opened this issue Sep 28, 2011 · 11 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Sep 28, 2011

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

Searchable as RT100232$

@p6rt
Copy link
Author

p6rt commented Sep 28, 2011

From @moritz

08​:19 < moritz> nom​: my $x = '1}; say "pwnd"; #'; 'a' ~~ /<$x>/
08​:19 <+p6eval> nom 317f89​: OUTPUT«pwnd␤pwnd␤»
08​:19 < moritz> ouch
08​:20 < jnthn> ...ouch.
08​:23 * moritz submits rakudobug

@p6rt
Copy link
Author

p6rt commented Nov 21, 2012

From @FROGGS

better?

<FROGGS> r​: my $x = '1}; say "pwnd"; #'; 'a' ~~ /<$x>/
<p6eval> rakudo bf472b​: OUTPUT«pwnd␤»

@p6rt
Copy link
Author

p6rt commented Nov 21, 2012

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

@p6rt
Copy link
Author

p6rt commented Nov 21, 2012

From @moritz

On Wed Nov 21 08​:24​:32 2012, FROGGS.de wrote​:

better?

<FROGGS> r​: my $x = '1}; say "pwnd"; #'; 'a' ~~ /<$x>/
<p6eval> rakudo bf472b​: OUTPUT«pwnd␤»

Not at all. It should complain that
1}; say "pwnd"; #

is not a valid regex.

@p6rt
Copy link
Author

p6rt commented Jan 31, 2015

From @usev6

Nowadays this no longer says "pwnd", but complains about two terms in a row​:

$ perl6 -e 'my $x = Q[1}; say "pwnd"; #]; "a" ~~ /<$x>/'
===SORRY!=== Error while compiling EVAL_0
Two terms in a row
at EVAL_0​:1
------> anon regex { ^1};\c[32]⏏say\c[32]"pwnd";\c[32]#}
  expecting any of​:
  infix stopper
  infix or meta-infix
  statement end
  statement modifier
  statement modifier loop

skids++ added a test to S05-interpolation/regex-in-variable.t (commit Raku/roast@5c539db0a7) which checks whether the command dies.

Is that good enough to close the ticket?

1 similar comment
@p6rt
Copy link
Author

p6rt commented Jan 31, 2015

From @usev6

Nowadays this no longer says "pwnd", but complains about two terms in a row​:

$ perl6 -e 'my $x = Q[1}; say "pwnd"; #]; "a" ~~ /<$x>/'
===SORRY!=== Error while compiling EVAL_0
Two terms in a row
at EVAL_0​:1
------> anon regex { ^1};\c[32]⏏say\c[32]"pwnd";\c[32]#}
  expecting any of​:
  infix stopper
  infix or meta-infix
  statement end
  statement modifier
  statement modifier loop

skids++ added a test to S05-interpolation/regex-in-variable.t (commit Raku/roast@5c539db0a7) which checks whether the command dies.

Is that good enough to close the ticket?

@p6rt
Copy link
Author

p6rt commented Oct 24, 2015

From @usev6

Output has changed​:

$ perl6-m -e 'my $x = Q[1}; say "pwnd"; #]; "a" ~~ /<$x>/'
pwnd
Cannot find method 'CALL-ME'
  in block <unit> at -e​:1

$ perl6-m --version
This is perl6 version 2015.10-7-gca1cf74 built on MoarVM version 2015.10

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 24, 2015

From @usev6

Output has changed​:

$ perl6-m -e 'my $x = Q[1}; say "pwnd"; #]; "a" ~~ /<$x>/'
pwnd
Cannot find method 'CALL-ME'
  in block <unit> at -e​:1

$ perl6-m --version
This is perl6 version 2015.10-7-gca1cf74 built on MoarVM version 2015.10

@p6rt
Copy link
Author

p6rt commented Dec 19, 2015

From @TimToady

A new restricted dialect of regex is implemented in 28ab83f947b4899a4f8698eee5bc056742f356f1 and 19d84be0066978f616ace6fa9f506e742161a378

Tests in 1becd7c9b456b707a14bfba40d672ec28945f199

1 similar comment
@p6rt
Copy link
Author

p6rt commented Dec 19, 2015

From @TimToady

A new restricted dialect of regex is implemented in 28ab83f947b4899a4f8698eee5bc056742f356f1 and 19d84be0066978f616ace6fa9f506e742161a378

Tests in 1becd7c9b456b707a14bfba40d672ec28945f199

@p6rt p6rt closed this as completed Dec 19, 2015
@p6rt
Copy link
Author

p6rt commented Dec 19, 2015

@TimToady - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant