Skip to content

Commit

Permalink
Decont Range before calling nqp::getattr on it
Browse files Browse the repository at this point in the history
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 a5b2238
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/core/Buf.pm6
Expand Up @@ -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))
),
Expand Down

1 comment on commit a5b2238

@usev6
Copy link
Contributor Author

@usev6 usev6 commented on a5b2238 Mar 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Please sign in to comment.