Skip to content
Permalink
Browse files

Make sure read-int128/uint128 take endianness into account

  • Loading branch information...
lizmat committed Dec 12, 2018
1 parent 3c2cfb2 commit f0279313040d08730a105f4c01d4f8686cc20e36
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/core/Buf.pm6
@@ -188,8 +188,11 @@ my role Blob[::T = uint8] does Positional[T] does Stringy is repr('VMArray') is
method read-uint128(
int $offset, Endian $endian = native-endian --> uint
) is raw {
self.read-uint64($offset + 8, $endian) +< 64
+| self.read-uint64($offset, $endian)
my \first := self.read-uint64($offset, $endian);
my \second := self.read-uint64($offset + 8, $endian);
$endian == big-endian # XXX fix for native big-endian systems
?? first +< 64 +| second
!! second +< 64 +| first
}

method read-num32(

0 comments on commit f027931

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