# AstGen: use null string to communicate non-string-literal asm · gitcafe/zig

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

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

Visibility: public

Requested revision: 1912ec0323af9a9077a8706157beb8207f6e3eb9

Requested commit: 1912ec0323af9a9077a8706157beb8207f6e3eb9

Commit: 1912ec0323af9a9077a8706157beb8207f6e3eb9

Tree: 7e94761acb4c3b773ee0d9ae0d0206f7417b3204

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
AstGen: use null string to communicate non-string-literal asm

dd62a6d2e8de522187fd096354e7156cca1821c5 short-circuited the logic of
`asmExpr` by emitting ZIR for `@compileError("...")`. This caused false
positive "unreachable code" errors for stage1 when there was an
expression in the asm template.

This commit makes such cases instead go through logic of `asmExpr` like
normal, however the asm template is set to 0. This is then picked up in
Sema (part of stage2, not stage1) and reported as "assembly code must
use string literal syntax".

```

## Parents

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

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