fix: short read bug in matchStructScalar and matchStructAlloc
This commit is contained in:
parent
d1f35f9725
commit
0b1c94eae2
1 changed files with 2 additions and 2 deletions
|
|
@ -663,7 +663,7 @@ fn matchStructScalar(comptime T: type, iter_: *[]const u8, val_: *T) Error!bool
|
||||||
const info = @typeInfo(T).@"struct";
|
const info = @typeInfo(T).@"struct";
|
||||||
|
|
||||||
const len = decodeMapHeader(&iter) catch |err| switch (err) {
|
const len = decodeMapHeader(&iter) catch |err| switch (err) {
|
||||||
error.TooShort => return false,
|
error.TooShort => return err,
|
||||||
error.InvalidMapType => return err,
|
error.InvalidMapType => return err,
|
||||||
error.InvalidPIntType => return err,
|
error.InvalidPIntType => return err,
|
||||||
};
|
};
|
||||||
|
|
@ -705,7 +705,7 @@ fn matchStructAlloc(comptime T: type, iter_: *[]const u8, val_: *T, allocator: s
|
||||||
const info = @typeInfo(T).@"struct";
|
const info = @typeInfo(T).@"struct";
|
||||||
|
|
||||||
const len = decodeMapHeader(&iter) catch |err| switch (err) {
|
const len = decodeMapHeader(&iter) catch |err| switch (err) {
|
||||||
error.TooShort => return false,
|
error.TooShort => return err,
|
||||||
error.InvalidMapType => return err,
|
error.InvalidMapType => return err,
|
||||||
error.InvalidPIntType => return err,
|
error.InvalidPIntType => return err,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue