immunant / c2rust

Migrate C code to Rust
https://c2rust.com/
Other
3.81k stars 220 forks source link

analyze: assertion failure on enum construction #987

Open spernsteiner opened 1 year ago

spernsteiner commented 1 year ago

c2rust-transpile uses Option<fn(...)> to represent C function pointers, which can be null. This means it often emits code like fp = Some(f). dataflow::type_check currently fails on this code, since the Rvalue::Aggregate case assumes the ADT being constructed is either a struct or an enum.