Skip to content

00any_to_opaque_narrow: a u64 keeps as many bytes as a pointer holds - #841

Merged
ASDAlexander77 merged 1 commit into
mainfrom
x86-opaque-narrow-test
Nov 13, 2026
Merged

ASDAlexander77 merged 1 commit into
mainfrom
x86-opaque-narrow-test

Conversation

@ASDAlexander77

Copy link
Copy Markdown
Owner

This fixes a wrong expectation in 00any_to_opaque_narrow.ts. The test expected <Opaque><any><u64>0x123456789A to keep all 8 bytes, but only a 64-bit pointer has room for that. Its x86 twin (TSLANG_TEST_X86) failed with "a u64 is all 8 bytes".

On i686 the compiler keeps the low 4 bytes (0x3456789A) under rc, own and none, which is the correct result for a 4-byte pointer. The expected value now follows sizeof<Opaque>(): 8 bytes on x64, the low 4 on x86. This changes only the test, not the compiler.

Tests

ctest -R any-to-opaque-narrow: all 12 variants pass (JIT and exe on x64, exe on x86, under gc, rc, none and own).

🤖 Generated with Claude Code

The test expected `<Opaque><any><u64>0x123456789A` to keep all 8 bytes, which only a 64-bit
pointer has room for: its x86 twin failed with "a u64 is all 8 bytes". On i686 the compiler
keeps the low 4 bytes (0x3456789A) under every model, as it should, so the expectation now
follows sizeof<Opaque>().

All 12 variants pass: JIT, x64 and x86, under gc/rc/none/own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ASDAlexander77
ASDAlexander77 merged commit 32b5c50 into main Nov 13, 2026
8 checks passed
@ASDAlexander77
ASDAlexander77 deleted the x86-opaque-narrow-test branch November 13, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant