Skip Menu |
Report information
Id: 129256
Status: resolved
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: perl6 [at] 6dof.xyz
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



From: perl6 [...] 6dof.xyz
To: rakudobug [...] perl.org
Date: Mon, 12 Sep 2016 17:27:52 +0200
Subject: [BUG] Infinite loop on CArray[].new
Download (untitled) / with headers
text/plain 548b
How to reproduce: perl6 -e 'use NativeCall; CArray[uint8].new(())' Fix (not tested): --- a/lib/NativeCall/Types.pm6 +++ b/lib/NativeCall/Types.pm6 @@ -162,7 +162,7 @@ our class CArray is repr('CArray') is array_type(Pointer) { multi method new() { nqp::create(self) } multi method new(*@values) { self.new(@values) } multi method new(@values) { - nextsame unless @values; + nextsame unless @values && @values.elems > 0; my $result := self.new(); my int $n = @values.elems; my int $i;
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 415b
Thanks for the report! Unfortunately the fix you provided is a no-op, because empty arrays are falsy, so the check doesn't add anything extra. The issue was the nextsame candidate was the one with the slurpy that called the current candidate back again, resulting in an infiniloop. The issue has now been resolved in https://github.com/rakudo/rakudo/commit/804bf671f8 Tests added in the same commit. Cheers, ZZ
Date: Tue, 13 Sep 2016 12:41:27 +0200
To: Zoffix Znet via RT <perl6-bugs-followup [...] perl.org>
Subject: Re: [perl #129256] [BUG] Infinite loop on CArray[].new
From: Cédric <cedric [...] 6dof.xyz>
Many thanks!


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org