# stage2: fix error reporting not loading AST · gitcafe/zig

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

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

Visibility: public

Requested revision: d5f77c0babb83e5e9d651fa96b84f374dd3f0c57

Requested commit: d5f77c0babb83e5e9d651fa96b84f374dd3f0c57

Commit: d5f77c0babb83e5e9d651fa96b84f374dd3f0c57

Tree: baf1769e190bbddd727fe21f08491630612cf961

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
stage2: fix error reporting not loading AST

In the byteOffset function, compile errors may need to compute the AST
from source bytes in order to resolve source locations. Previously there
were a few lines trying to access the AST before it was loaded. Trivial
fix, just move load the tree at the beginning.

```

## Parents

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

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