Skip to content

emit: support casts from size_t to fixed-width integers#120

Merged
gebner merged 3 commits into
mainfrom
kimaya/addnewcast
Jun 5, 2026
Merged

emit: support casts from size_t to fixed-width integers#120
gebner merged 3 commits into
mainfrom
kimaya/addnewcast

Conversation

@KimayaBedarkar

Copy link
Copy Markdown
Collaborator

Add the SizeT → Int { signed, width } cast case, mirroring the existing inverse case. Emits UIntN.uint_to_t (SizeT.v val) (or IntN.int_to_t for signed targets), generating the natural verification obligation that the size_t value fits in the narrower type.

Add the SizeT → Int { signed, width } cast case, mirroring the existing
inverse case. Emits `UIntN.uint_to_t (SizeT.v val)` (or `IntN.int_to_t`
for signed targets), generating the natural verification obligation that
the size_t value fits in the narrower type.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread test/cast_sizet_to_uint32/cast_sizet_to_uint32.c
Comment thread test/cast_sizet_to_uint32/cast_sizet_to_uint32.c
KimayaBedarkar and others added 2 commits June 5, 2026 11:53
Co-authored-by: Gabriel Ebner <gebner@gebner.org>
Exercises the signed branch of the new SizeT \xE2\x86\x92 Int cast handling.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@gebner gebner merged commit ea24ee5 into main Jun 5, 2026
3 checks passed
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.

2 participants