Skip to content

Conversation

@kurtjd
Copy link

@kurtjd kurtjd commented Nov 28, 2025

_heap_size is not actually a valid address anywhere (of course we have to treat it as an address since it is a linker symbol), and therefore creating a reference to it, even as an intermediate step, is undefined behavior. It seems in debug mode rust will panic if we create a reference to null (e.g. if _heap_size is zero) even though we aren't attempting to access it.

This is just quick fix to replace that line with addr_of! which doesn't create an intermediate reference and therefore no longer UB. The macro is apparently now soft deprecated and suggests replacement with &raw const directly, but kept the macro for consistency with its other uses in code base.

@kurtjd kurtjd requested a review from a team as a code owner November 28, 2025 23:35
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