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

Owner: Nobody
Requestors: perl6 [at]

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

From: perl6 [...]
To: rakudobug [...]
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) { } multi method new(@values) { - nextsame unless @values; + nextsame unless @values && @values.elems > 0; my $result :=; my int $n = @values.elems; my int $i;
RT-Send-CC: perl6-compiler [...]
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 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 [...]>
Subject: Re: [perl #129256] [BUG] Infinite loop on CArray[].new
From: Cédric <cedric [...]>
Many thanks!

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

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