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

No protection against huge capture variables ($1, $2...) index #2118

Closed
p6rt opened this issue Aug 31, 2010 · 8 comments
Closed

No protection against huge capture variables ($1, $2...) index #2118

p6rt opened this issue Aug 31, 2010 · 8 comments

Comments

@p6rt
Copy link

p6rt commented Aug 31, 2010

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

Searchable as RT77570$

@p6rt
Copy link
Author

p6rt commented Aug 31, 2010

From @bbkr

$ perl6 -e 'my $code = "\$" ~ 1 x 1024; eval $code;'
error​:imcc​:syntax error, unexpected IDENTIFIER ('Inf')
  in file 'EVAL_10' line 180480091

I'm not sure if produced $code is valid STD syntax, but if not then error
message should be more awesome.

@p6rt
Copy link
Author

p6rt commented Dec 1, 2011

From @bbkr

Doesn't crash on 2011.11

$ perl6 -e 'my $code = "\$" ~ 1 x 1024; eval $code; say "alive"'
alive

But i'm not sure if it also works - testing 111111.manydigitshere.11th
capture is beyond capabilities of machines. Maybe there is a way to
check if it aliases to $/[111111111.manydigitshere.11].

@p6rt
Copy link
Author

p6rt commented Dec 1, 2011

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

@p6rt
Copy link
Author

p6rt commented Mar 29, 2013

From @coke

On Thu Dec 01 03​:44​:40 2011, bbkr wrote​:

Doesn't crash on 2011.11

$ perl6 -e 'my $code = "\$" ~ 1 x 1024; eval $code; say "alive"'
alive

But i'm not sure if it also works - testing 111111.manydigitshere.11th
capture is beyond capabilities of machines. Maybe there is a way to
check if it aliases to $/[111111111.manydigitshere.11].

Behavior has changed

my $code = "\$" ~ 1 x 1024; eval $code; say "alive"
Cannot use negative index -9223372036854775808 on Any

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Feb 16, 2015

From @Mouq

Seems to be okay now, even for larger numbers​:

11​:09 <Mouq> r​: my $code = "\$" ~ 1 x 1000000; EVAL $code; say "alive"
11​:10 <camelia> rakudo-{parrot,moar} f4379c​: OUTPUT«aliveâ�¤Â»

Marking as testneeded

On Fri Mar 29 08​:24​:51 2013, coke wrote​:

On Thu Dec 01 03​:44​:40 2011, bbkr wrote​:

Doesn't crash on 2011.11

$ perl6 -e 'my $code = "\$" ~ 1 x 1024; eval $code; say "alive"'
alive

But i'm not sure if it also works - testing 111111.manydigitshere.11th
capture is beyond capabilities of machines. Maybe there is a way to
check if it aliases to $/[111111111.manydigitshere.11].

Behavior has changed

my $code = "\$" ~ 1 x 1024; eval $code; say "alive"
Cannot use negative index -9223372036854775808 on Any

@p6rt
Copy link
Author

p6rt commented Feb 17, 2015

From @coke

On Mon Feb 16 08​:10​:54 2015, Mouq wrote​:

Seems to be okay now, even for larger numbers​:

11​:09 <Mouq> r​: my $code = "\$" ~ 1 x 1000000; EVAL $code; say "alive"
11​:10 <camelia> rakudo-{parrot,moar} f4379c​: OUTPUT«aliveâ�¤Â»

Marking as testneeded

On Fri Mar 29 08​:24​:51 2013, coke wrote​:

On Thu Dec 01 03​:44​:40 2011, bbkr wrote​:

Doesn't crash on 2011.11

$ perl6 -e 'my $code = "\$" ~ 1 x 1024; eval $code; say "alive"'
alive

But i'm not sure if it also works - testing 111111.manydigitshere.11th
capture is beyond capabilities of machines. Maybe there is a way to
check if it aliases to $/[111111111.manydigitshere.11].

Behavior has changed

my $code = "\$" ~ 1 x 1024; eval $code; say "alive"
Cannot use negative index -9223372036854775808 on Any

Test added in S05-capture/dot.t, closing ticket.
--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Feb 17, 2015

From @usev6

Really closing ;-)

@p6rt p6rt closed this as completed Feb 17, 2015
@p6rt
Copy link
Author

p6rt commented Feb 17, 2015

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

@p6rt p6rt added the testneeded label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant