# Sema: Revert sema.err to null if the Decl already has an error · gitcafe/zig

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

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

Visibility: public

Requested revision: a9c4dc84f487c4764c5787439ea87962f698d511

Requested commit: a9c4dc84f487c4764c5787439ea87962f698d511

Commit: a9c4dc84f487c4764c5787439ea87962f698d511

Tree: 79f795fe801b9fe79dd80bcbf4eb155806331a4b

Author: sin-ack

Committer: Veikka Tuominen

## Message

```
Sema: Revert sema.err to null if the Decl already has an error

Previously we would assign the error message to Sema and then never
clear it even when destroying the error message, which caused memory
corruption.

Closes #12437

```

## Parents

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

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