You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix the bug: Static union values can panic Kani (#4112)
This PR fixes the bug: Static union values can panic Kani.
The reason behind the bug is Kani's translation of Union type is not
consistent with its layout defined by Rust. Specifically, the size of
the Union is not just the max of its fields but that maximum should be
round up to a multiple of its alignment.
See:
https://web.mit.edu/rust-lang_v1.25/arch/amd64_ubuntu1404/share/doc/rust/html/reference/type-layout.html#:~:text=The%20layout%20of%20a%20type,also%20part%20of%20type%20layout
In this PR, I add another variant for DataComponent:
DataComponent::UnionField, with a padded_type of a Union (a struct which
contains a padding and the real field type) to fix the translated layout
and support reasoning about transmute function for union type.
Resolves#4097
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.
0 commit comments