summaryrefslogtreecommitdiff
path: root/crates/parser
diff options
context:
space:
mode:
Diffstat (limited to 'crates/parser')
-rw-r--r--crates/parser/src/conversion.rs8
-rw-r--r--crates/parser/src/lib.rs2
2 files changed, 7 insertions, 3 deletions
diff --git a/crates/parser/src/conversion.rs b/crates/parser/src/conversion.rs
index 1ebe392..273dd44 100644
--- a/crates/parser/src/conversion.rs
+++ b/crates/parser/src/conversion.rs
@@ -251,8 +251,12 @@ pub(crate) fn process_const_operators(ops: OperatorsReader<'_>) -> Result<ConstI
assert!(matches!(ops[ops.len() - 1], wasmparser::Operator::End));
match &ops[ops.len() - 2] {
- wasmparser::Operator::RefNull { hty } => Ok(ConstInstruction::RefNull(convert_heaptype(*hty))),
- wasmparser::Operator::RefFunc { function_index } => Ok(ConstInstruction::RefFunc(*function_index)),
+ wasmparser::Operator::RefNull { hty } => match convert_heaptype(*hty) {
+ ValType::RefFunc => Ok(ConstInstruction::RefFunc(None)),
+ ValType::RefExtern => Ok(ConstInstruction::RefExtern(None)),
+ _ => unimplemented!("Unsupported heap type: {:?}", hty),
+ },
+ wasmparser::Operator::RefFunc { function_index } => Ok(ConstInstruction::RefFunc(Some(*function_index))),
wasmparser::Operator::I32Const { value } => Ok(ConstInstruction::I32Const(*value)),
wasmparser::Operator::I64Const { value } => Ok(ConstInstruction::I64Const(*value)),
wasmparser::Operator::F32Const { value } => Ok(ConstInstruction::F32Const(f32::from_bits(value.bits()))),
diff --git a/crates/parser/src/lib.rs b/crates/parser/src/lib.rs
index dcb05f0..04da9da 100644
--- a/crates/parser/src/lib.rs
+++ b/crates/parser/src/lib.rs
@@ -65,6 +65,7 @@ impl Parser {
memory64: true,
custom_page_sizes: true,
+ extended_const: false,
wide_arithmetic: false,
gc_types: true,
stack_switching: false,
@@ -73,7 +74,6 @@ impl Parser {
component_model_values: false,
component_model_more_flags: false,
exceptions: false,
- extended_const: false,
gc: false,
memory_control: false,
relaxed_simd: false,