Skip to content

Commit

Permalink
HLLize items before testing for type in Buf
Browse files Browse the repository at this point in the history
Fixes RT#125466: https://rt.perl.org/Ticket/Display.html?id=125466

Otherwise, `Buf.new: nqp::bitshift_i(1, 1)` ends up as a BOOTInt,
fails the typecheck, and fails creation of the Buf.
  • Loading branch information
zoffixznet committed Mar 5, 2018
1 parent b5100d6 commit 29fdb75
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/core/Buf.pm6
Expand Up @@ -341,10 +341,13 @@ my role Blob[::T = uint8] does Positional[T] does Stringy is repr('VMArray') is
nqp::setelems(to, $j + $elems); # presize for efficiency
my int $i = -1;
my $got;
nqp::istype(($got := nqp::atpos($from,$i)),Int)
?? nqp::bindpos_i(to,$j++,$got)
!! self!fail-typecheck-element(action,$i,$got).throw
while nqp::islt_i(++$i,$elems);
nqp::while(
nqp::islt_i(++$i,$elems),
nqp::stmts(
($got := nqp::atpos($from,$i)),
nqp::istype(nqp::hllize($got),Int)
?? nqp::bindpos_i(to,$j++,$got)
!! self!fail-typecheck-element(action,$i,$got).throw))
}
}
else {
Expand Down

0 comments on commit 29fdb75

Please sign in to comment.