Skip to content

Commit d6173d8

Browse files
authored
Merge pull request #7686 from roc-lang/bhansconnect/push-zxrtxsvymluy
Enable optimizing fuzz repro scripts
2 parents 0386b34 + 557dc89 commit d6173d8

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

build.zig

+4-2
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ pub fn build(b: *std.Build) void {
119119
use_system_afl,
120120
check_step,
121121
target,
122+
optimize,
122123
name,
123124
);
124125
}
@@ -131,6 +132,7 @@ fn add_fuzz_target(
131132
use_system_afl: bool,
132133
check_step: *Step,
133134
target: ResolvedTarget,
135+
optimize: OptimizeMode,
134136
name: []const u8,
135137
) void {
136138
// We always include the repro scripts (no dependencies).
@@ -155,7 +157,7 @@ fn add_fuzz_target(
155157
.name = name_repro,
156158
.root_source_file = b.path("src/fuzz-repro.zig"),
157159
.target = target,
158-
.optimize = .Debug,
160+
.optimize = optimize,
159161
.link_libc = true,
160162
});
161163
install_repro.root_module.addImport("fuzz_test", fuzz_obj.root_module);
@@ -172,7 +174,7 @@ fn add_fuzz_target(
172174
.name = name_repro,
173175
.root_source_file = b.path("src/fuzz-repro.zig"),
174176
.target = target,
175-
.optimize = .Debug,
177+
.optimize = optimize,
176178
.link_libc = true,
177179
});
178180
check_repro.root_module.addImport("fuzz_test", fuzz_obj.root_module);

src/check/parse.zig

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ fn lineNum(newlines: std.ArrayList(usize), pos: u32) u32 {
5454
}
5555

5656
fn tokenizeReport(allocator: std.mem.Allocator, source: []const u8, msgs: []const tokenize.Diagnostic) void {
57-
std.debug.print("Found the {d} following issues while parsing:\n", .{msgs.len});
57+
std.debug.print("Found the {d} following issues while tokenizing:\n", .{msgs.len});
5858
var newlines = std.ArrayList(usize).init(allocator);
5959
defer newlines.deinit();
6060
newlines.append(0) catch |err| exitOnOom(err);
@@ -86,7 +86,7 @@ fn tokenizeReport(allocator: std.mem.Allocator, source: []const u8, msgs: []cons
8686
);
8787
},
8888
else => {
89-
std.debug.print("MSG: {any}", .{message});
89+
std.debug.print("MSG: {any}\n", .{message});
9090
},
9191
}
9292
}

0 commit comments

Comments
 (0)