Skip to content

Commit ed01d41

Browse files
authored
fix: patterns were not handling the last byte of the input file correctly. (#518) (#519)
Changes are needed to pass pattern unit tests to latest changes in input file size handling
1 parent eb8e69f commit ed01d41

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

patterns/7z.hexpat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ struct EndHeader {
4646
// Set padding to place End Header in right position
4747
padding[startheader.relativeOffsetEndHeader];
4848
// Mark link to meta block
49-
u8 linkToMetaBlock [[color("FF0000")]];
49+
u8 linkToMetaBlock [[color("FF0000"), no_unique_address]];
5050
// Mark all End Header
5151
char fullEndHeader[startheader.theLengthOfEndHeader] [[color("63954A")]];
5252
// Detect LZMA signature

patterns/nbt.hexpat

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#pragma description Minecraft NBT
33

44
import std.sys;
5+
import std.mem;
56

67
#pragma endian big
78

@@ -73,7 +74,7 @@ struct Element {
7374
};
7475

7576
struct NBT {
76-
Element element[while(true)] [[inline]];
77+
Element element[while(!std::mem::eof())] [[inline]];
7778
};
7879

7980
NBT nbt @ 0x00;

0 commit comments

Comments
 (0)