Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #559 from ugexe/patch-6
Fix unpack for templates using `*`
  • Loading branch information
lizmat committed Oct 23, 2015
2 parents f25bbe7 + d97f0b2 commit 75ac71b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/Buf.pm
Expand Up @@ -169,12 +169,14 @@ my role Blob[::T = uint8] does Positional[T] does Stringy is repr('VMArray') is
}
when 'S' | 'v' {
for ^$pa {
last if @bytes.elems < 2;
@fields.append: shift(@bytes)
+ (shift(@bytes) +< 0x08);
}
}
when 'L' | 'V' {
for ^$pa {
last if @bytes.elems < 4;
@fields.append: shift(@bytes)
+ (shift(@bytes) +< 0x08)
+ (shift(@bytes) +< 0x10)
Expand All @@ -183,12 +185,14 @@ my role Blob[::T = uint8] does Positional[T] does Stringy is repr('VMArray') is
}
when 'n' {
for ^$pa {
last if @bytes.elems < 2;
@fields.append: (shift(@bytes) +< 0x08)
+ shift(@bytes);
}
}
when 'N' {
for ^$pa {
last if @bytes.elems < 4;
@fields.append: (shift(@bytes) +< 0x18)
+ (shift(@bytes) +< 0x10)
+ (shift(@bytes) +< 0x08)
Expand Down

0 comments on commit 75ac71b

Please sign in to comment.