-
Notifications
You must be signed in to change notification settings - Fork 91
Undefined behavior: zero-initialization of Event #131
Comments
Yes, thanks for opening an issue. :) The easiest fix is probably to have some variant with discriminant 0, that would then be the one that is used by a |
I just ran into this, my plugin panics when I try to load it, e.g. in the Line 397 in f0b7fd3
because SysExEvent contains an EventType .
Could we please fix this soon? :)
|
Indeed, the UB check that causes a panic here has landed in the mean time. Cc rust-lang/rust#66151 |
I will take a look at this over the weekend. |
RustAudio#138) This avoids panicking on Rust 1.48 and later. Fixes RustAudio#131
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:
vst-rs/src/api.rs
Line 488 in d7d5b6f
and here:
vst-rs/src/api.rs
Line 503 in d7d5b6f
EventType
contains no variant with tag discriminant 0, so creating one viamem::zeroed()
is Undefined Behavior.The text was updated successfully, but these errors were encountered: