Skip to content

Commit 9a27ffe

Browse files
Fix subtyping for tables
1 parent ba2c167 commit 9a27ffe

File tree

4 files changed

+4
-399
lines changed

4 files changed

+4
-399
lines changed

scripts/test/shared.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,6 @@ def get_tests(test_dir, extensions=[], recursive=False):
387387
# Requires us to write our own floating point parser
388388
'const.wast',
389389

390-
# Unlinkable module accepted
391-
'linking.wast',
392-
393390
# Invalid module accepted
394391
'unreached-invalid.wast',
395392

@@ -423,7 +420,6 @@ def get_tests(test_dir, extensions=[], recursive=False):
423420
'if.wast', # Requires more precise unreachable validation
424421
'imports.wast', # Requires fixing handling of mutation to imported globals
425422
'proposals/threads/imports.wast', # Missing memory type validation on instantiation
426-
'linking.wast', # Incorrectly allows covariant subtyping for table imports
427423
'proposals/threads/memory.wast', # Missing memory type validation on instantiation
428424
'annotations.wast', # String annotations IDs should be allowed
429425
'instance.wast', # Requires support for table default elements

src/ir/runtime-table.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ class RuntimeTable {
4747
// be imported with the definition of `other`
4848
virtual bool isSubType(const Table& other) {
4949
return tableDefinition.addressType == other.addressType &&
50-
Type::isSubType(tableDefinition.type, other.type) &&
51-
size() >= other.initial && tableDefinition.max <= other.max;
50+
tableDefinition.type == other.type && size() >= other.initial &&
51+
tableDefinition.max <= other.max;
5252
}
5353

5454
const Table* getDefinition() const { return &tableDefinition; }

test/spec/imports.wast

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,11 @@
1010
(func (export "func-i64->i64") (param i64) (result i64) (local.get 0))
1111
(global (export "global-i32") i32 (i32.const 55))
1212
(global (export "global-f32") f32 (f32.const 44))
13-
;;; FIXME: Exporting a mutable global is currently not supported. Make mutable
14-
;;; when support is added.
15-
(global (export "global-mut-i64") i64 (i64.const 66))
13+
(global (export "global-mut-i64") (mut i64) (i64.const 66))
1614
(table (export "table-10-inf") 10 funcref)
1715
(table (export "table-10-20") 10 20 funcref)
1816
(memory (export "memory-2-inf") 2)
19-
;; Multiple memories are not yet supported
20-
;; (memory (export "memory-2-4") 2 4)
17+
(memory (export "memory-2-4") 2 4)
2118
)
2219

2320
(register "test")

0 commit comments

Comments
 (0)