Skip to content

Commit 0008b79

Browse files
authored
Fuzz fix: fix copying of host node operands (#1464)
1 parent 9ca513a commit 0008b79

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/ir/ExpressionManipulator.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,12 @@ Expression* flexibleCopy(Expression* original, Module& wasm, CustomCopier custom
140140
return builder.makeReturn(copy(curr->value));
141141
}
142142
Expression* visitHost(Host *curr) {
143-
assert(curr->operands.size() == 0);
144-
return builder.makeHost(curr->op, curr->nameOperand, {});
143+
std::vector<Expression*> operands;
144+
for (Index i = 0; i < curr->operands.size(); i++) {
145+
operands.push_back(copy(curr->operands[i]));
146+
}
147+
auto* ret = builder.makeHost(curr->op, curr->nameOperand, std::move(operands));
148+
return ret;
145149
}
146150
Expression* visitNop(Nop *curr) {
147151
return builder.makeNop();

0 commit comments

Comments
 (0)