Skip to content

Commit

Permalink
environ: Support new wasmparser RecGroup struct
Browse files Browse the repository at this point in the history
  • Loading branch information
lann committed Aug 25, 2023
1 parent 1d4766f commit eb7dc0c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion cranelift/wasm/src/sections_translator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,14 @@ pub fn parse_type_section<'a>(

for entry in types {
let entry = entry?;
if entry.types().len() != 1 {
unimplemented!("gc proposal");
}
let entry = entry.types().first().unwrap();
if entry.is_final || entry.supertype_idx.is_some() {
unimplemented!("gc proposal");
}
match entry.structural_type {
match &entry.structural_type {
StructuralType::Func(wasm_func_ty) => {
let ty = environ.convert_func_type(&wasm_func_ty);
environ.declare_type_func(ty)?;
Expand Down
6 changes: 5 additions & 1 deletion crates/environ/src/module_environ.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,14 @@ impl<'a, 'data> ModuleEnvironment<'a, 'data> {

for ty in types {
let ty = ty?;
if ty.types().len() != 1 {
unimplemented!("gc proposal")
}
let ty = ty.types().first().unwrap();
if ty.is_final || ty.supertype_idx.is_some() {
unimplemented!("gc proposal")
}
match ty.structural_type {
match &ty.structural_type {
StructuralType::Func(wasm_func_ty) => {
let ty = self.convert_func_type(&wasm_func_ty);
self.declare_type_func(ty)?;
Expand Down

0 comments on commit eb7dc0c

Please sign in to comment.