File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -1730,6 +1730,31 @@ mod tests {
1730
1730
assert_eq ! ( restored, HACKATOM ) ;
1731
1731
}
1732
1732
1733
+ #[ test]
1734
+ fn func_ref_test ( ) {
1735
+ let wasm = wat:: parse_str (
1736
+ r#"(module
1737
+ (type (func))
1738
+ (type (func (param funcref)))
1739
+ (import "env" "abort" (func $f (type 1)))
1740
+ (func (type 0) nop)
1741
+ (export "add_one" (func 0))
1742
+ (export "allocate" (func 0))
1743
+ (export "interface_version_8" (func 0))
1744
+ (export "deallocate" (func 0))
1745
+ (export "memory" (memory 0))
1746
+ (memory 3)
1747
+ )"# ,
1748
+ )
1749
+ . unwrap ( ) ;
1750
+
1751
+ let cache: Cache < MockApi , MockStorage , MockQuerier > =
1752
+ unsafe { Cache :: new ( make_testing_options ( ) ) . unwrap ( ) } ;
1753
+
1754
+ // making sure this doesn't panic
1755
+ cache. store_code ( & wasm, true , true ) . unwrap ( ) ;
1756
+ }
1757
+
1733
1758
#[ test]
1734
1759
fn test_wasm_limits_checked ( ) {
1735
1760
let tmp_dir = TempDir :: new ( ) . unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -77,7 +77,8 @@ impl<'a> ParsedWasm<'a> {
77
77
| WasmFeatures :: SATURATING_FLOAT_TO_INT
78
78
| WasmFeatures :: SIGN_EXTENSION
79
79
| WasmFeatures :: MULTI_VALUE
80
- | WasmFeatures :: FLOATS ;
80
+ | WasmFeatures :: FLOATS
81
+ | WasmFeatures :: REFERENCE_TYPES ;
81
82
82
83
let mut validator = Validator :: new_with_features ( features) ;
83
84
You can’t perform that action at this time.
0 commit comments