# stage2: Remove premature elem_val index check · gitcafe/zig

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

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

Visibility: public

Requested revision: 5374e245c50fde8bbb133bbff2db15efa3604721

Requested commit: 5374e245c50fde8bbb133bbff2db15efa3604721

Commit: 5374e245c50fde8bbb133bbff2db15efa3604721

Tree: f97abf82092e557f0e73a119fe7ac36506b9e8f4

Author: Cody Tapscott

Committer: Andrew Kelley

## Message

```
stage2: Remove premature elem_val index check

We were enforcing bounds on the index of an elem_ptr in pointerDeref,
but we want to support out-of-bounds accesses by reinterpreting memory.
This removes that check, so that the deref falls back to bitcasting, as
usual.

This was masked by another bug that was forcing bitcasts incorrectly,
which is why this wasn't noticed earlier.

```

## Parents

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

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