Handle zero-size structs

This commit is contained in:
Brian Carroll 2021-11-28 09:27:34 +00:00
parent 8eb74da0f3
commit 27af5897d1
2 changed files with 20 additions and 6 deletions

View file

@ -50,6 +50,15 @@ impl BlockType {
}
}
impl From<Option<ValueType>> for BlockType {
fn from(opt: Option<ValueType>) -> Self {
match opt {
Some(ty) => BlockType::Value(ty),
None => BlockType::NoResult,
}
}
}
/// A control block in our model of the VM
/// Child blocks cannot "see" values from their parent block
struct VmBlock<'a> {