mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +00:00
19 lines
376 B
Zig
19 lines
376 B
Zig
pub fn main() void {
|
|
@setRuntimeSafety(true);
|
|
var x: u8 = 255;
|
|
// Let's overflow this integer!
|
|
x += 1;
|
|
}
|
|
|
|
pub const panic = std.debug.FullPanic(myPanic);
|
|
|
|
fn myPanic(msg: []const u8, first_trace_addr: ?usize) noreturn {
|
|
_ = first_trace_addr;
|
|
std.debug.print("Panic! {s}\n", .{msg});
|
|
std.process.exit(1);
|
|
}
|
|
|
|
const std = @import("std");
|
|
|
|
// exe=fail
|