Skip to content

Commit 6cb5010

Browse files
authored
Fuzzer: Fix handling of Rethrow and Try fixups (#8008)
We need to call the super (`visitExpression`) if they do not entirely replace the contents, as the super has general logic (like name fixups for Try) that we need.
1 parent 13fab92 commit 6cb5010

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/tools/fuzzing/fuzzing.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2160,13 +2160,17 @@ void TranslateToFuzzReader::fixAfterChanges(Function* func) {
21602160
void visitRethrow(Rethrow* curr) {
21612161
if (!isValidTryRef(curr->target, curr)) {
21622162
replace();
2163+
} else {
2164+
visitExpression(curr);
21632165
}
21642166
}
21652167

21662168
void visitTry(Try* curr) {
21672169
if (curr->delegateTarget.is() &&
21682170
!isValidTryRef(curr->delegateTarget, curr)) {
21692171
replace();
2172+
} else {
2173+
visitExpression(curr);
21702174
}
21712175
}
21722176

@@ -2203,8 +2207,7 @@ void TranslateToFuzzReader::fixAfterChanges(Function* func) {
22032207
i--;
22042208
}
22052209
}
2206-
};
2207-
Fixer fixer(wasm, *this);
2210+
} fixer(wasm, *this);
22082211
fixer.walk(func->body);
22092212

22102213
// Refinalize at the end, after labels are all fixed up.

0 commit comments

Comments
 (0)