Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

Undefined behavior: zero-initialization of Event #131

@askeksa

Description

@askeksa

As I understand it, we need to fix this to prevent this code from panicking in a future version of Rust.

Quoting @RalfJung from the discussion of #112:

The bug is here:

/// # let mut event: *mut Event = &mut unsafe { std::mem::zeroed() };

and here:

/// # let mut event: *mut Event = &mut unsafe { std::mem::zeroed() };

EventType contains no variant with tag discriminant 0, so creating one via mem::zeroed() is Undefined Behavior.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions