Skip to content
Permalink
Browse files

Decont Range before calling nqp::getattr on it

Makes the method work on the JVM backend. Calling the method did fail with a
RuntimeException "No such attribute '6298is-int' for this object" before.
  • Loading branch information...
usev6 committed Mar 30, 2019
1 parent adba017 commit a5b22387a37c56c6a8bb16dc3b23606deeed57d0
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/core/Buf.pm6
@@ -386,15 +386,15 @@ my role Blob[::T = uint8] does Positional[T] does Stringy is repr('VMArray') is
proto method subbuf(|) {*}
multi method subbuf(Blob:D: Range:D $fromto) {
nqp::if(
nqp::getattr_i($fromto,Range,'$!is-int'),
nqp::getattr_i(nqp::decont($fromto),Range,'$!is-int'),
nqp::stmts(
(my int $start = nqp::add_i(
nqp::unbox_i(nqp::getattr($fromto,Range,'$!min')),
nqp::getattr_i($fromto,Range,'$!excludes-min')
nqp::unbox_i(nqp::getattr(nqp::decont($fromto),Range,'$!min')),
nqp::getattr_i(nqp::decont($fromto),Range,'$!excludes-min')
)),
(my int $end = nqp::sub_i(
nqp::unbox_i(nqp::getattr($fromto,Range,'$!max')),
nqp::getattr_i($fromto,Range,'$!excludes-max')
nqp::unbox_i(nqp::getattr(nqp::decont($fromto),Range,'$!max')),
nqp::getattr_i(nqp::decont($fromto),Range,'$!excludes-max')
)),
subbuf-end(self, $start, $end, nqp::elems(self))
),

1 comment on commit a5b2238

@usev6

This comment has been minimized.

Copy link
Contributor Author

commented on a5b2238 Mar 30, 2019

Oops I didn't properly escape $!is-int in my commit message and it got interpreted by the shell.

Please sign in to comment.
You can’t perform that action at this time.