# std: Fix edge case in TLS tp calculation · gitcafe/zig

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

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

Visibility: public

Requested revision: 1690b35770a97aec4b8a7b1b31a61b01e04f5656

Requested commit: 1690b35770a97aec4b8a7b1b31a61b01e04f5656

Commit: 1690b35770a97aec4b8a7b1b31a61b01e04f5656

Tree: 33e221f8173d3732e0cb5899dc5e50fe176ace78

Author: LemonBoy

Committer: Andrew Kelley

## Message

```
std: Fix edge case in TLS tp calculation

The TLS area may be located in the upper part of the address space and,
if the platform expects a constant offset to be applied, may make the tp
register calculation overflow.

Use +% instead of +, the overflow is harmless.

```

## Parents

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

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