Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix readfh for Buf[uint8].
  • Loading branch information
jnthn committed Sep 25, 2013
1 parent f3ce73e commit 76820d4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/vm/jvm/runtime/org/perl6/nqp/runtime/Ops.java
Expand Up @@ -490,10 +490,19 @@ public static SixModelObject readfh(SixModelObject io, SixModelObject res, long
arr.start = 0;
arr.slots = array;

return res;
} else if (res instanceof VMArrayInstance_u8) {
VMArrayInstance_u8 arr = (VMArrayInstance_u8)res;

byte[] array = ((IIOSyncReadable)h.handle).read(tc, (int)bytes);
arr.elems = array.length;
arr.start = 0;
arr.slots = array;

return res;
} else {
throw ExceptionHandling.dieInternal(tc,
"readfh requires a buf with the VMArrayInstance_i8 REPR");
"readfh requires a Buf[int8] or a Buf[uint8]");
}
} else {
throw ExceptionHandling.dieInternal(tc,
Expand Down

0 comments on commit 76820d4

Please sign in to comment.