Skip to content

Commit c7acccf

Browse files
committed
fixes
1 parent 0dcd82f commit c7acccf

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/ir/child-typer.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

src/wasm/wasm-ir-builder.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,6 +1474,7 @@ Result<> IRBuilder::makeTableSize(Name table) {
14741474

14751475
Result<> IRBuilder::makeTableGrow(Name table) {
14761476
TableGrow curr;
1477+
curr.table = table;
14771478
CHECK_ERR(visitTableGrow(&curr));
14781479
push(builder.makeTableGrow(table, curr.value, curr.delta));
14791480
return Ok{};

0 commit comments

Comments
 (0)