Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/tools/fuzzing/fuzzing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ void TranslateToFuzzReader::addImportCallingSupport() {

auto choice = upTo(16);

if (choice & 1) {
if (wasm.features.hasExceptionHandling() && (choice & 1)) {
// Given an export index, call it from JS.
// A second parameter has flags. The first bit determines whether we catch
// and rethrow all exceptions. (This ends up giving us the same signature
Expand All @@ -1007,7 +1007,7 @@ void TranslateToFuzzReader::addImportCallingSupport() {
wasm.addFunction(std::move(func));
}

if (choice & 2) {
if (wasm.features.hasExceptionHandling() && (choice & 2)) {
// Given an export index, call it from JS and catch all exceptions. Return
// whether we caught. Exceptions are common (if the index is invalid, in
// particular), so a variant that catches is useful to avoid halting.
Expand Down
70 changes: 39 additions & 31 deletions test/passes/fuzz_metrics_noprint.bin.txt
Original file line number Diff line number Diff line change
@@ -1,35 +1,43 @@
Metrics
total
[exports] : 139
[funcs] : 217
[globals] : 7
[imports] : 6
[exports] : 59
[funcs] : 75
[globals] : 9
[imports] : 9
[memories] : 1
[memory-data] : 23
[table-data] : 71
[tables] : 1
[tags] : 0
[total] : 15952
[vars] : 628
Binary : 1172
Block : 2734
Break : 525
Call : 628
CallIndirect : 146
Const : 2648
Drop : 185
GlobalGet : 1418
GlobalSet : 1052
If : 866
Load : 259
LocalGet : 1011
LocalSet : 708
Loop : 309
Nop : 227
RefFunc : 71
Return : 159
Select : 83
Store : 105
Switch : 1
Unary : 1112
Unreachable : 533
[table-data] : 8
[tables] : 2
[tags] : 2
[total] : 8420
[vars] : 330
Binary : 560
Block : 1409
Break : 214
Call : 354
CallIndirect : 54
Const : 1338
Drop : 87
GlobalGet : 685
GlobalSet : 527
If : 418
Load : 149
LocalGet : 628
LocalSet : 408
Loop : 183
Nop : 78
Pop : 66
RefFunc : 23
RefIsNull : 33
RefNull : 35
Return : 73
Select : 77
Store : 31
TableGet : 1
TableSet : 5
Throw : 9
ThrowRef : 5
Try : 85
TryTable : 82
Unary : 543
Unreachable : 260
2 changes: 1 addition & 1 deletion test/passes/fuzz_metrics_noprint.passes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
translate-to-fuzz_metrics
translate-to-fuzz_metrics_enable-exception-handling_enable-reference-types
Loading