Skip to content

Commit

Permalink
Added failing testcase for #3197
Browse files Browse the repository at this point in the history
  • Loading branch information
fschutt committed Oct 10, 2022
1 parent 07c2add commit b948b46
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/api/src/sys/externals/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,18 @@ impl<'a> Exportable<'a> for Table {
}
}
}

#[test]
fn test_table_grow_3197() {
use crate::{imports, Instance, Module, Store, Table, TableType, Type, Value};

const WAT:&str = r#"(module (table (import "env" "table") 100 funcref))"#;

let mut store = Store::default();
let module = Module::new(&store, WAT).unwrap();
let ty = TableType::new(Type::FuncRef, 0, None);
let table = Table::new(&mut store, ty, Value::FuncRef(None)).unwrap();
table.grow(&mut store, 100, Value::FuncRef(None)).unwrap();
let imports = imports! {"env" => {"table" => table}};
let _instance = Instance::new(&mut store, &module, &imports).unwrap();
}

0 comments on commit b948b46

Please sign in to comment.