wasm_module: create const ValueType::VOID to use as block type

This commit is contained in:
Brian Carroll 2022-11-26 00:38:41 +00:00
parent b69be0e12d
commit d9fe907684
No known key found for this signature in database
GPG key ID: 5C7B2EC4101703C0
2 changed files with 5 additions and 3 deletions

View file

@ -20,8 +20,6 @@ macro_rules! log_instruction {
};
}
const BLOCK_NO_RESULT: u8 = 0x40;
/// A control block in our model of the VM
/// Child blocks cannot "see" values from their parent block
struct VmBlock<'a> {
@ -531,7 +529,7 @@ impl<'a> CodeBuilder<'a> {
self.inst_base(opcode, pops, false);
// We don't support block result types. Too hard to track types through arbitrary control flow.
self.code.push(BLOCK_NO_RESULT);
self.code.push(ValueType::VOID);
// Start a new block with a fresh value stack
self.vm_block_stack.push(VmBlock {