# compiler: be more cautious about source locations · gitcafe/zig

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

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

Visibility: public

Requested revision: 50960fac80b1d04f7858215d963fa64a7583210b

Requested commit: 50960fac80b1d04f7858215d963fa64a7583210b

Commit: 50960fac80b1d04f7858215d963fa64a7583210b

Tree: 5d407fb1c0bd21ddfcaddadcb835084674b0376e

Author: mlugg

Committer: Jacob Young

## Message

```
compiler: be more cautious about source locations

Two fixes here.

* Prevent a crash when sorting the list of analysis errors when some
  errors refer to lost source locations. These errors can be sorted
  anywhere in the list, because they are (in theory) guaranteed to never
  be emitted by the `resolveReferences` logic. This case occurs, for
  instance, when a declaration has compile errors in the initial update
  and is deleted in the second update.

* Prevent a crash when resolving the source location for `entire_file`
  errors for a non-existent file. This is the bug underlying #20954.

Resolves: #20954.

```

## Parents

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

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