forked from WebAssembly/binaryen
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fuzzer: Better fuzzing of globals (WebAssembly#6611)
With this PR we generate global.gets in globals, which we did not do before. We do that by replacing makeConst (the only thing we did before, for the contents of globals) with makeTrivial, and add code to makeTrivial to sometimes make a global.get. When no suitable global exists, makeGlobalGet will emit a constant, so there is no danger in trying. Also raise the number of globals a little. Also explicitly note the current limitation of requiring all tuple globals to contain tuple.make and nothing else, including not global.get, and avoid adding such invalid global.gets in tuple globals in the fuzzer.
- Loading branch information
Showing
7 changed files
with
147 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
total | ||
[exports] : 18 | ||
[funcs] : 21 | ||
[exports] : 23 | ||
[funcs] : 34 | ||
[globals] : 9 | ||
[imports] : 4 | ||
[memories] : 1 | ||
[memory-data] : 2 | ||
[table-data] : 7 | ||
[table-data] : 6 | ||
[tables] : 1 | ||
[tags] : 0 | ||
[total] : 11685 | ||
[vars] : 64 | ||
Binary : 848 | ||
Block : 1846 | ||
Break : 456 | ||
Call : 275 | ||
CallIndirect : 117 | ||
Const : 1952 | ||
Drop : 86 | ||
GlobalGet : 844 | ||
GlobalSet : 679 | ||
If : 625 | ||
Load : 236 | ||
LocalGet : 1050 | ||
LocalSet : 764 | ||
Loop : 301 | ||
Nop : 143 | ||
RefFunc : 7 | ||
Return : 103 | ||
Select : 77 | ||
Store : 111 | ||
Switch : 3 | ||
Unary : 835 | ||
Unreachable : 327 | ||
[total] : 4303 | ||
[vars] : 100 | ||
Binary : 355 | ||
Block : 684 | ||
Break : 149 | ||
Call : 219 | ||
CallIndirect : 23 | ||
Const : 643 | ||
Drop : 50 | ||
GlobalGet : 367 | ||
GlobalSet : 258 | ||
If : 206 | ||
Load : 78 | ||
LocalGet : 339 | ||
LocalSet : 236 | ||
Loop : 93 | ||
Nop : 41 | ||
RefFunc : 6 | ||
Return : 45 | ||
Select : 41 | ||
Store : 36 | ||
Switch : 1 | ||
Unary : 304 | ||
Unreachable : 129 |
84 changes: 48 additions & 36 deletions
84
test/passes/translate-to-fuzz_all-features_metrics_noprint.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,59 @@ | ||
total | ||
[exports] : 5 | ||
[funcs] : 7 | ||
[globals] : 14 | ||
[exports] : 3 | ||
[funcs] : 4 | ||
[globals] : 24 | ||
[imports] : 5 | ||
[memories] : 1 | ||
[memory-data] : 20 | ||
[table-data] : 2 | ||
[table-data] : 3 | ||
[tables] : 1 | ||
[tags] : 1 | ||
[total] : 467 | ||
[vars] : 40 | ||
ArrayGet : 1 | ||
ArrayLen : 1 | ||
ArrayNew : 6 | ||
[total] : 750 | ||
[vars] : 30 | ||
ArrayCopy : 1 | ||
ArrayGet : 2 | ||
ArrayLen : 5 | ||
ArrayNew : 24 | ||
ArrayNewFixed : 1 | ||
Binary : 67 | ||
Block : 44 | ||
Break : 5 | ||
Call : 21 | ||
Const : 106 | ||
Drop : 7 | ||
GlobalGet : 20 | ||
GlobalSet : 18 | ||
If : 14 | ||
Load : 17 | ||
LocalGet : 45 | ||
LocalSet : 28 | ||
Loop : 3 | ||
MemoryFill : 1 | ||
Nop : 5 | ||
RefAs : 1 | ||
RefCast : 1 | ||
ArraySet : 1 | ||
AtomicCmpxchg : 1 | ||
AtomicFence : 1 | ||
AtomicRMW : 1 | ||
Binary : 84 | ||
Block : 58 | ||
Break : 12 | ||
Call : 13 | ||
Const : 175 | ||
Drop : 2 | ||
GlobalGet : 45 | ||
GlobalSet : 20 | ||
I31Get : 2 | ||
If : 21 | ||
Load : 20 | ||
LocalGet : 70 | ||
LocalSet : 46 | ||
Loop : 7 | ||
MemoryCopy : 1 | ||
Nop : 11 | ||
Pop : 3 | ||
RefAs : 7 | ||
RefEq : 1 | ||
RefFunc : 3 | ||
RefI31 : 4 | ||
RefNull : 3 | ||
Return : 3 | ||
Select : 2 | ||
RefFunc : 5 | ||
RefI31 : 7 | ||
RefIsNull : 3 | ||
RefNull : 19 | ||
RefTest : 3 | ||
Return : 2 | ||
SIMDTernary : 1 | ||
Select : 3 | ||
Store : 1 | ||
StringConst : 3 | ||
StringConst : 8 | ||
StringEncode : 1 | ||
StringEq : 1 | ||
StructNew : 5 | ||
TupleMake : 5 | ||
Unary : 13 | ||
StringMeasure : 1 | ||
StringWTF16Get : 1 | ||
StructGet : 1 | ||
StructNew : 21 | ||
Try : 3 | ||
TupleMake : 6 | ||
Unary : 19 | ||
Unreachable : 10 |