# Fix chunks peek_with_bitmaps panic \(\#38430\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 55d130a166d43618d014408d3b2bd9d39ceb47d2

Requested commit: 55d130a166d43618d014408d3b2bd9d39ceb47d2

Commit: 55d130a166d43618d014408d3b2bd9d39ceb47d2

Tree: d150902d899a655d6da297624a1ae1c2dd49c7e1

Author: Anthony Eid

Committer: GitHub

## Message

```
Fix chunks peek_with_bitmaps panic (#38430)

This panic only happened in debug builds because of a left shift
overflow. The slice range has bounds between 0 and 128. The 128 case
caused the overflow.

We now do an unbounded shift and a wrapped sub to get the correct
bitmask. If the slice range is 128 left, it should make 1 zero. Then the
wrapped sub would flip all bits, which is expected behavior.

Release Notes:

- N/A

Co-authored-by: Nia <nia@zed.dev>
```

## Parents

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

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