-- string.unpack — overflow detection on sizes > 8 bytes. -- Mirrors the official tpack.lua "does not fit" checks (lines 88-90, 129). -- Unsigned: any non-zero upper byte means value exceeds u64. Errors. print(pcall(string.unpack, "I9", "\1\0\0\0\0\0\0\0\0")) -- Signed: upper bytes must match sign extension of low 8 bytes. -- BE i9 with high byte 1 and zeros: full value > i64 max. Errors. print(pcall(string.unpack, ">i9", "\1\0\0\0\0\0\0\0\0")) -- BE i16 with 0x03 in every byte: high byte 0x03 != 0x00 sign-fill. Errors. print(pcall(string.unpack, ">i16", string.rep("\3", 16))) -- LE i9: low 8 bytes are 0 (positive), upper byte 0xff. Sign mismatch. Errors. print(pcall(string.unpack, "i16", string.rep("\xff", 16)))