# stage2: fix source location of Decl compile errors · gitcafe/zig

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

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

Visibility: public

Requested revision: c102e1371088cf34aac28627a8523e66f0525098

Requested commit: c102e1371088cf34aac28627a8523e66f0525098

Commit: c102e1371088cf34aac28627a8523e66f0525098

Tree: 786815a6ee8539a363a2c7f5268031d531f9f317

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
stage2: fix source location of Decl compile errors

In `Module.semaDecl`, the source location being used was double-relative
to the `Decl`, causing a crash when trying to compute byte offset for
the compile error.

Change the source location to node_offset = 0 since the scope being used
makes the source location relative to the Decl, which already has the
source node index populated.

```

## Parents

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

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