Wasm: Add support for nullref type

Reference types now supports proper a nullref type. This commit changes
the Wasm translator to support this.
This commit is contained in:
Ryan Hunt
2020-01-06 15:36:46 -06:00
parent 32a95a89eb
commit 710182ad26
3 changed files with 17 additions and 2 deletions

View File

@@ -196,6 +196,7 @@ fn declare_locals<FE: FuncEnvironment + ?Sized>(
let constant_handle = builder.func.dfg.constants.insert([0; 16].to_vec().into());
builder.ins().vconst(ir::types::I8X16, constant_handle)
}
NullRef => builder.ins().null(environ.reference_type()),
AnyRef => builder.ins().null(environ.reference_type()),
AnyFunc => builder.ins().null(environ.reference_type()),
ty => return Err(wasm_unsupported!("unsupported local type {:?}", ty)),