Skip to content

Commit 3beb927

Browse files
committed
make self-hosted the default compiler
stage1 is available behind the -fstage1 flag. closes ziglang#89
1 parent e6e1ce6 commit 3beb927

4 files changed

+6
-6
lines changed

safety/empty slice with sentinel out of bounds.zig

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const std = @import("std");
22

33
pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace) noreturn {
44
_ = stack_trace;
5-
if (std.mem.eql(u8, message, "attempt to index out of bound: index 1, len 0")) {
5+
if (std.mem.eql(u8, message, "index out of bounds: index 1, len 0")) {
66
std.process.exit(0);
77
}
88
std.process.exit(1);

safety/out of bounds slice access.zig

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@ const std = @import("std");
22

33
pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace) noreturn {
44
_ = stack_trace;
5-
if (std.mem.eql(u8, message, "attempt to index out of bound: index 4, len 4")) {
5+
if (std.mem.eql(u8, message, "index out of bounds: index 4, len 4")) {
66
std.process.exit(0);
77
}
88
std.process.exit(1);
99
}
1010
pub fn main() !void {
11-
const a = [_]i32{1, 2, 3, 4};
11+
const a = [_]i32{ 1, 2, 3, 4 };
1212
baz(bar(&a));
1313
return error.TestFailed;
1414
}
1515
fn bar(a: []const i32) i32 {
1616
return a[4];
1717
}
18-
fn baz(_: i32) void { }
18+
fn baz(_: i32) void {}
1919
// run
2020
// backend=llvm
2121
// target=native

safety/slice with sentinel out of bounds - runtime len.zig

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const std = @import("std");
22

33
pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace) noreturn {
44
_ = stack_trace;
5-
if (std.mem.eql(u8, message, "attempt to index out of bound: index 5, len 4")) {
5+
if (std.mem.eql(u8, message, "index out of bounds: index 5, len 4")) {
66
std.process.exit(0);
77
}
88
std.process.exit(1);

safety/slice with sentinel out of bounds.zig

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const std = @import("std");
22

33
pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace) noreturn {
44
_ = stack_trace;
5-
if (std.mem.eql(u8, message, "attempt to index out of bound: index 5, len 4")) {
5+
if (std.mem.eql(u8, message, "index out of bounds: index 5, len 4")) {
66
std.process.exit(0);
77
}
88
std.process.exit(1);

0 commit comments

Comments
 (0)