# C pointer slices are no longer allowzero \(\#4462\) · gitcafe/zig

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

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

Visibility: public

Requested revision: 1b41f2d77ea14de27b0655a35a727d664cfc4ca4

Requested commit: 1b41f2d77ea14de27b0655a35a727d664cfc4ca4

Commit: 1b41f2d77ea14de27b0655a35a727d664cfc4ca4

Tree: d3e5996e16424fa205a0f8072670254a04147545

Author: Alexandros Naskos

Committer: GitHub

## Message

```
C pointer slices are no longer allowzero (#4462)

* Slices from C pointers are no longer allowzero but instead insert a runtime assertion.

* Added a test, fixed code for cases with non-allowzero C pointers

* Create new type when flipping allow_zero, sometimes we get a cached value back from adjust_ptr_len.

* Added comments, changed panic message

* Added runtime safety test.


```

## Parents

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

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