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
Using %() to coerce hash context causes core dump #1774
Comments
From snarkyboojum@gmail.comUsing %() to coerce hash context causes Rakudo to core dump. e.g. Using Rakudo @ 18d99603b2e546702ebe7ff6133b63d3f17e83f8 $ ./perl6 -e '%()' $ ./perl6 -e '%(1,2)' |
From @cognominal%() # crashes whatever the way it launched, perl shell, -e, or as a programs The stack trace indicates an infinite recursion in the GC. -- |
From snarkyboojum@gmail.comFWIW, this has already been raised as #75502. Cheers, |
The RT System itself - Status changed from 'new' to 'open' |
From @TimbusSince I can't seem to find any 'hash' sub anywhere in rakudos source |
From @Timbushashfix.patchdiff --git a/src/builtins/Parcel.pir b/src/builtins/Parcel.pir
index ed2017c..8dd9d9b 100644
--- a/src/builtins/Parcel.pir
+++ b/src/builtins/Parcel.pir
@@ -50,7 +50,7 @@ A Parcel in item context becomes a Seq.
=cut
.sub 'hash' :method
- .tailcall 'hash'(self)
+ .tailcall '&hash'(self)
.end
|
The RT System itself - Status changed from 'new' to 'open' |
From @bbkrPisa build $ perl6 -e '%()' We highly suggest you notify the Parrot team if you have not been working on Version : 2.7.0-devel Dumping Core... |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S03-operators/context-forcers.t commit bcf95590569868d70c6181cc5ebceb0f911234dd [t/spec] tests for %() hash context forcer; also tests RT #75502 Inline Patchdiff --git a/t/spec/S03-operators/context-forcers.t b/t/spec/S03-operators/context-forcers.t
index c155fd3..7eb2f24 100644
--- a/t/spec/S03-operators/context-forcers.t
+++ b/t/spec/S03-operators/context-forcers.t
@@ -2,7 +2,7 @@ use v6;
use Test;
-plan 95;
+plan 100;
#?DOES 1
sub iis(Mu $a, Mu $b, $descr) {
@@ -198,6 +198,15 @@ sub eval_elsewhere($code){ eval($code) }
is (@total[8], 888, "total[1] is 100");
}
+{
+ ok %() ~~ Hash, '%() returns a Hash';
+ is +%(), 0, '%() is an empty Hash';
+ my $x = %(a => 3, b => 5);
+ is $x<a>, 3, 'hash constructor worked (1)';
+ is $x<b>, 5, 'hash constructor worked (1)';
+ is $x.keys.join(', '), 'a, b', 'hash constructor produced the right keys';
+}
+
# the "upto" operator
# L<S03/Symbolic unary precedence/"prefix:<^>">
|
From @moritzOn Tue Aug 03 06:32:34 2010, TiMBuS wrote:
Thanks for the patch; I've applied it, and it does make the segfault go Moritz |
@moritz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#75502 (status was 'resolved')
Searchable as RT75502$
The text was updated successfully, but these errors were encountered: