Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const warn = @import("std").debug.warn;
- const T = struct {
- value: []u8,
- };
- var t = T{
- .value = [1]u8{'a'},
- };
- pub fn main() void {
- t.value[0] = 'b';
- warn("Hello '{}'\n", t.value);
- }
- // Segmentation fault at address 0x2013c1
- // main.zig:12:18: 0x228abd in main (run)
- // t.value[0] = 'b';
- // ^
- // /snap/zig/835/lib/zig/std/special/start.zig:148:22: 0x227add in std.special.posixCallMainAndExit (run)
- // root.main();
- // ^
- // /snap/zig/835/lib/zig/std/special/start.zig:56:5: 0x2279bf in std.special._start (run)
- // @noInlineCall(posixCallMainAndExit);
- // ^
- // [1] 17694 abort (core dumped) zig run main.zig
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement