@@ -227,15 +227,17 @@ template<typename Subtype> struct ChildTyper : OverriddenVisitor<Subtype> {
227227 void visitDataDrop (DataDrop* curr) {}
228228
229229 void visitMemoryCopy (MemoryCopy* curr) {
230+ assert (wasm.getMemory (curr->destMemory )->indexType ==
231+ wasm.getMemory (curr->sourceMemory )->indexType );
230232 notePointer (&curr->dest , curr->destMemory );
231233 notePointer (&curr->source , curr->sourceMemory );
232- note (&curr->size , Type:: i32 );
234+ notePointer (&curr->size , curr-> destMemory );
233235 }
234236
235237 void visitMemoryFill (MemoryFill* curr) {
236238 notePointer (&curr->dest , curr->memory );
237239 note (&curr->value , Type::i32 );
238- note (&curr->size , Type:: i32 );
240+ notePointer (&curr->size , curr-> memory );
239241 }
240242
241243 void visitConst (Const* curr) {}
@@ -666,15 +668,14 @@ template<typename Subtype> struct ChildTyper : OverriddenVisitor<Subtype> {
666668 void visitTableGet (TableGet* curr) { note (&curr->index , Type::i32 ); }
667669
668670 void visitTableSet (TableSet* curr) {
669- auto type = wasm.getTable (curr->table )->type ;
670671 note (&curr->index , Type::i32 );
671- note (&curr->value , type);
672+ note (&curr->value , wasm. getTable (curr-> table )-> type );
672673 }
673674
674675 void visitTableSize (TableSize* curr) {}
675676
676677 void visitTableGrow (TableGrow* curr) {
677- note (&curr->value , Type:: i32 );
678+ note (&curr->value , wasm. getTable (curr-> table )-> type );
678679 note (&curr->delta , Type::i32 );
679680 }
680681
0 commit comments