diff options
| author | Matthew Lugg <mlugg@mlugg.co.uk> | 2025-11-17 01:54:49 +0100 |
|---|---|---|
| committer | Alex Rønne Petersen <alex@alexrp.com> | 2025-11-18 11:10:52 +0100 |
| commit | 891f1870320000205291940ba2e276c1fa043cd0 (patch) | |
| tree | 336c97a163394c7795e76794fd2b3811342d7076 /test/src/StackTrace.zig | |
| parent | 73f863a6fb1e844ec312345b3160e3987fe6586d (diff) | |
| download | zig-891f1870320000205291940ba2e276c1fa043cd0.tar.gz zig-891f1870320000205291940ba2e276c1fa043cd0.zip | |
cbe: fix big-endian unnatural integer bitcast
Integers with padding bits on big-endian targets cannot quite be bitcast
with a trivial memcpy, because the padding bits (which are zext or sext)
are the most-significant, so are at the *lowest* addresses. So to
bitcast to something which doesn't have padding bits, we need to offset
past the padding.
The logic I've added here definitely doesn't handle all possibilities
correctly; I think that would actually be quite complicated. However, it
handles a common case, and so prevents the Zig compiler itself from
being miscompiled on big-endian targets (hence fixing a bootstrapping
problem on big-endian).
Diffstat (limited to 'test/src/StackTrace.zig')
0 files changed, 0 insertions, 0 deletions
