Skip to content

Use MaybeUninit for uninitialized packing buffer memory#103

Merged
bluss merged 2 commits into
masterfrom
uninit
Jul 3, 2026
Merged

Use MaybeUninit for uninitialized packing buffer memory#103
bluss merged 2 commits into
masterfrom
uninit

Conversation

@bluss

@bluss bluss commented Jun 30, 2026

Copy link
Copy Markdown
Owner

This resolves a soundness issue; we cannot use &mut [T] to refer to uninitialized memory. It's only used as a brief argument passing mechanism in fact, see pack functions, where we previously found that using a slice improves pointer aliasing information and optimization (this was not verified when working on this change; except that benchmarks show no difference).

Fixes #102

bluss added 2 commits June 30, 2026 16:01
This resolves a soundness issue; we cannot use &mut [T] to refer to
uninitialized memory. It's only used as a brief argument passing
mechanism in fact, see pack functions, where we previously found that
using a slice improves pointer aliasing information and optimization
(this was not verified when working on this change; except that
benchmarks show no difference).
@bluss bluss merged commit a80dc29 into master Jul 3, 2026
15 checks passed
@bluss bluss deleted the uninit branch July 3, 2026 14:36
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.

Soundness: Forming mutable slices over uninitialized packing buffer memory causes UB

1 participant