From 7dd86b021d2c8bf60cc68d517864e50556d649cf Mon Sep 17 00:00:00 2001 From: Kbz-8 Date: Wed, 11 Mar 2026 12:37:08 +0100 Subject: [PATCH] fixing tests failure --- src/Result.zig | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Result.zig b/src/Result.zig index dc4e322..0617256 100644 --- a/src/Result.zig +++ b/src/Result.zig @@ -374,7 +374,7 @@ pub const Value = union(Type) { inline for (0..4) |i| { const start = i * 4; const end = (i + 1) * 4; - if (start >= input.len or end >= input.len) return RuntimeError.OutOfBounds; + if (start >= input.len or end > input.len) return RuntimeError.OutOfBounds; std.mem.copyForwards(u8, std.mem.asBytes(&vec[i]), input[start..end]); } return 4 * 4; @@ -383,7 +383,7 @@ pub const Value = union(Type) { inline for (0..3) |i| { const start = i * 4; const end = (i + 1) * 4; - if (start >= input.len or end >= input.len) return RuntimeError.OutOfBounds; + if (start >= input.len or end > input.len) return RuntimeError.OutOfBounds; std.mem.copyForwards(u8, std.mem.asBytes(&vec[i]), input[start..end]); } return 3 * 4; @@ -392,7 +392,7 @@ pub const Value = union(Type) { inline for (0..2) |i| { const start = i * 4; const end = (i + 1) * 4; - if (start >= input.len or end >= input.len) return RuntimeError.OutOfBounds; + if (start >= input.len or end > input.len) return RuntimeError.OutOfBounds; std.mem.copyForwards(u8, std.mem.asBytes(&vec[i]), input[start..end]); } return 2 * 4; @@ -401,7 +401,7 @@ pub const Value = union(Type) { inline for (0..4) |i| { const start = i * 4; const end = (i + 1) * 4; - if (start >= input.len or end >= input.len) return RuntimeError.OutOfBounds; + if (start >= input.len or end > input.len) return RuntimeError.OutOfBounds; std.mem.copyForwards(u8, std.mem.asBytes(&vec[i]), input[start..end]); } return 4 * 4; @@ -410,7 +410,7 @@ pub const Value = union(Type) { inline for (0..3) |i| { const start = i * 4; const end = (i + 1) * 4; - if (start >= input.len or end >= input.len) return RuntimeError.OutOfBounds; + if (start >= input.len or end > input.len) return RuntimeError.OutOfBounds; std.mem.copyForwards(u8, std.mem.asBytes(&vec[i]), input[start..end]); } return 3 * 4; @@ -419,7 +419,7 @@ pub const Value = union(Type) { inline for (0..2) |i| { const start = i * 4; const end = (i + 1) * 4; - if (start >= input.len or end >= input.len) return RuntimeError.OutOfBounds; + if (start >= input.len or end > input.len) return RuntimeError.OutOfBounds; std.mem.copyForwards(u8, std.mem.asBytes(&vec[i]), input[start..end]); } return 2 * 4; @@ -428,7 +428,7 @@ pub const Value = union(Type) { inline for (0..4) |i| { const start = i * 4; const end = (i + 1) * 4; - if (start >= input.len or end >= input.len) return RuntimeError.OutOfBounds; + if (start >= input.len or end > input.len) return RuntimeError.OutOfBounds; std.mem.copyForwards(u8, std.mem.asBytes(&vec[i]), input[start..end]); } return 4 * 4; @@ -437,7 +437,7 @@ pub const Value = union(Type) { inline for (0..3) |i| { const start = i * 4; const end = (i + 1) * 4; - if (start >= input.len or end >= input.len) return RuntimeError.OutOfBounds; + if (start >= input.len or end > input.len) return RuntimeError.OutOfBounds; std.mem.copyForwards(u8, std.mem.asBytes(&vec[i]), input[start..end]); } return 3 * 4; @@ -446,7 +446,7 @@ pub const Value = union(Type) { inline for (0..2) |i| { const start = i * 4; const end = (i + 1) * 4; - if (start >= input.len or end >= input.len) return RuntimeError.OutOfBounds; + if (start >= input.len or end > input.len) return RuntimeError.OutOfBounds; std.mem.copyForwards(u8, std.mem.asBytes(&vec[i]), input[start..end]); } return 2 * 4;