# ir: Various fixes for comptime ptr handling · gitcafe/zig

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

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

Visibility: public

Requested revision: 55ea855e2cefe8dcdb5fab9be66aa6ca3acd0370

Requested commit: 55ea855e2cefe8dcdb5fab9be66aa6ca3acd0370

Commit: 55ea855e2cefe8dcdb5fab9be66aa6ca3acd0370

Tree: 8b08c867108b6e589ea5e6504728199a4482fbd5

Author: LemonBoy

Committer: Andrew Kelley

## Message

```
ir: Various fixes for comptime ptr handling

* Correctly fold ptrToInt on optional types
* Generate null as ConstPtrSpecialNull in intToPtr
* Correctly stop ptrToInt on ?*T where T is zero-sized

Closes #4535

```

## Parents

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

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