From 18ff905233d91107e787bf56fc478e3ce1d6a447 Mon Sep 17 00:00:00 2001 From: Elizabeth Mattijsen Date: Fri, 4 Oct 2019 22:29:30 +0200 Subject: [PATCH] Make Buf.write-bits really work on type objects --- src/core.c/Buf.pm6 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core.c/Buf.pm6 b/src/core.c/Buf.pm6 index 5a1a5ad3925..548f578acda 100644 --- a/src/core.c/Buf.pm6 +++ b/src/core.c/Buf.pm6 @@ -872,7 +872,7 @@ my role Buf[::T = uint8] does Blob[T] is repr('VMArray') is array_type(T) { # all done in a single byte if $first-byte == $last-byte { nqp::bindpos_i($self,$first-byte, - $value +| (nqp::atpos_i(self,$first-byte) +& ($lmask +| $rmask)) + $value +| (nqp::atpos_i($self,$first-byte) +& ($lmask +| $rmask)) ); } @@ -883,7 +883,7 @@ my role Buf[::T = uint8] does Blob[T] is repr('VMArray') is array_type(T) { # process last byte first if it is a partial if $last-bit { nqp::bindpos_i($self,$i, - ($value +& 255) +| (nqp::atpos_i(self,$i) +& $rmask) + ($value +& 255) +| (nqp::atpos_i($self,$i) +& $rmask) ); $value := $value +> 8; }