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 warning or error when the result of concatenating strings is too large #5258

Closed
p6rt opened this issue Apr 23, 2016 · 4 comments
Closed
Labels

Comments

@p6rt
Copy link

p6rt commented Apr 23, 2016

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

Searchable as RT127971$

@p6rt
Copy link
Author

p6rt commented Apr 23, 2016

From @MasterDuke17

./perl6 -e 'my $a = "a" x 2**30;my $b = "b" x 2**30;my $c = $a ~ $b;my $d
= $b ~ $a;my $e = $c ~ $d;say "length of \$e == {$e.chars}, expecting
{$c.chars+$d.chars}";'

length of $e == 0, expecting 4294967296

./perl6 -version
This is Rakudo version 2016.04-17-g5a14162 built on MoarVM version 2016.04
implementing Perl 6.c.

A Rakudo PR was submitted (rakudo/rakudo#754), but
closed with the suggestion that an RT ticket be created and the solution be
implemented at a lower level than Rakudo/Perl6.

@p6rt
Copy link
Author

p6rt commented Mar 5, 2017

From @zoffixznet

Expected proper char count or an exception​:

16​:29 IOninja m​: (("a" x 1000000) x 1073741824).chars.say
16​:29 camelia rakudo-moar 9cec31​: OUTPUT​: «0␤»

16​:31 IOninja m​: (('a' x 1000000) x 1000000).chars.say
16​:31 camelia rakudo-moar 22f43d​: OUTPUT​: «3567587328␤»

@p6rt
Copy link
Author

p6rt commented Mar 10, 2017

From @MasterDuke17

Fixed to now throw an exception if the result of string repeating or concatenation would result in something larger than strings are allowed to be in MoarVM commit MoarVM/MoarVM@beefd2b
Brought into Rakudo with commit rakudo/rakudo@22f00cd72d
Tests added to roast with commit Raku/roast@40c7c4b

@p6rt
Copy link
Author

p6rt commented Mar 10, 2017

@MasterDuke17 - Status changed from 'new' to 'resolved'

@p6rt p6rt closed this as completed Mar 10, 2017
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant