summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig4
1 files changed, 4 insertions, 0 deletions
diff --git a/build.zig b/build.zig
index d99f3985..acd402b6 100644
--- a/build.zig
+++ b/build.zig
@@ -400,7 +400,11 @@ pub fn build(b: *std.Build) void {
if (std.mem.count(u8, backed, end_anchor) != 1) @panic("mvzr's parser changed: redo its `$` before `|` in build.zig");
var patched = std.mem.replaceOwned(u8, b.allocator, backed, end_anchor, end_before_alt) catch @panic("OOM");
// Zig 0.17 removed `**`; mvzr still has it (its PR #16 replaces it upstream).
+ // A class's range ending at `\xff` counted to 256 in a u8, an
+ // overflow (a panic in a safe build, a runaway loop in a fast one):
+ // `[\x80-\xff]` in any search took the editor down.
for ([_][3][]const u8{
+ .{ "for (c1..c2 + 1) |c_range|", "for (c1..@as(usize, c2) + 1) |c_range|", "1" },
.{ "[1]RegOp{.{ .unused = {} }} ** ops", "@splat(.{ .unused = {} })", "1" },
.{ "[1]CharSet{.{ .low = 0, .hi = 0 }} ** char_sets", "@splat(.{ .low = 0, .hi = 0 })", "1" },
.{ "\"a\" ** 2048", "&@as([2048]u8, @splat('a'))", "2" },