# improved behavior on debug safety crash · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/07a71fc3221dfba05caea5a50ebe3dac5c76d643)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 07a71fc3221dfba05caea5a50ebe3dac5c76d643

Requested commit: 07a71fc3221dfba05caea5a50ebe3dac5c76d643

Commit: 07a71fc3221dfba05caea5a50ebe3dac5c76d643

Tree: a7c56f5069bd9a04cbc2b590f4120691deb8fa06

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
improved behavior on debug safety crash

 * instead of emitting a breakpoint for a debug safety crash,
   zig calls a panic function which prints an error message
   and a stack trace and then calls abort.
 * on freestanding OS, this panic function has a default
   implementation of a simple infinite loop.
 * users can override the panic implementation by providing
   `pub fn panic(message: []const u8) -> unreachable { }`
 * workaround for LLVM segfaulting when you try to use cold
   calling convention on ARM.

closes #245

```

## Parents

- [28f63b8a4f2e55d2596a0e3daea106500a479791](https://git.cafe/gitcafe/zig/commit/28f63b8a4f2e55d2596a0e3daea106500a479791?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/07a71fc3221dfba05caea5a50ebe3dac5c76d643?format=markdown)
