Skip to content

Commit 2578b41

Browse files
authored
Fix elem.drop interpretation (#7668)
Don't drop the segment in the module as the module can be used again later. Instead add the segment to the dropped segments set. Fixes the fuzzing issue described in #7658 (comment).
1 parent 4360007 commit 2578b41

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/wasm-interpreter.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3654,9 +3654,8 @@ class ModuleRunnerBase : public ExpressionRunner<SubType> {
36543654
}
36553655

36563656
Flow visitElemDrop(ElemDrop* curr) {
3657-
Module& wasm = *self()->getModule();
36583657
ElementSegment* seg = wasm.getElementSegment(curr->segment);
3659-
seg->data.clear();
3658+
droppedElementSegments.insert(seg->name);
36603659
return {};
36613660
}
36623661

0 commit comments

Comments
 (0)