Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix running with PERL6LIB on JVM
Apparently, you cannot nqp::getattr into a native int on the JVM,
even if the attribute in question *is* a native int.
  • Loading branch information
lizmat committed Nov 10, 2015
1 parent f6d7f4d commit c9cb7f4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/core/Str.pm
Expand Up @@ -828,10 +828,20 @@ my class Str does Stringy { # declared in BOOTSTRAP
nqp::setelems($result,$elems + 1);
while nqp::islt_i($i,$elems) {
$match := nqp::decont(nqp::atpos($matches,$i));
#?if jvm
$found = $match.from;
#?endif
#?if !jvm
$found = nqp::getattr($match,Match,'$!from');
#?endif
nqp::bindpos($result,$i,
nqp::substr($str,$pos,nqp::sub_i($found,$pos)));
#?if jvm
$pos = $match.to;
#?endif
#?if !jvm
$pos = nqp::getattr($match,Match,'$!to');
#?endif
$i = nqp::add_i($i,1);
}
nqp::bindpos($result,$i,nqp::substr($str,$pos));
Expand Down

0 comments on commit c9cb7f4

Please sign in to comment.