Skip to content

Fix ICE when naked_asm uses const pointer operands - #1697

Open
0xmuon wants to merge 2 commits into
rust-lang:mainfrom
0xmuon:fix12
Open

Fix ICE when naked_asm uses const pointer operands#1697
0xmuon wants to merge 2 commits into
rust-lang:mainfrom
0xmuon:fix12

Conversation

@0xmuon

@0xmuon 0xmuon commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Fixes #1690
when naked_asm! uses a ptr valued const operand like const &0, codegen goes through global_asm and used to hit an unreachable!() on GlobalAlloc::Memory so the compiler ICE’d instead of emitting anything useful.This change handles those memory allocations the same way inline asm already does (via data_id_for_alloc_id) wire GlobalAsmContext up with the module and constants context it needs and turns unsupported allocation kinds into proper errors instead of panicking.

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.

ICE: naked_asm! unreachable

1 participant