# Sema: provide source location when analyzing panic handler · gitcafe/zig

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

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

Visibility: public

Requested revision: 8f3ccbbe367bea66d7f0f364a957870eb2cc95a0

Requested commit: 8f3ccbbe367bea66d7f0f364a957870eb2cc95a0

Commit: 8f3ccbbe367bea66d7f0f364a957870eb2cc95a0

Tree: 33dad0b953904d39e75490b05f414bdbc09869bb

Author: mlugg

Committer: Andrew Kelley

## Message

```
Sema: provide source location when analyzing panic handler

The panic handler decl_val was previously given a `unneeded` source
location, which was then added to the reference trace, resulting in a
crash if the source location was used in the reference trace. This
commit makes two trivial changes:

* Don't add unneeded source locations to the ref table (panic in debug, silently ignore in release)
* Pass a real source location when analyzing the panic handler

```

## Parents

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

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