Skip to content

Commit fa0dfb6

Browse files
bnjbvrkripken
authored andcommitted
wasm-opt: Add an option to select generation of atomic opcodes at runtime (#1751)
partially solves #1676.
1 parent 82685ae commit fa0dfb6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/tools/wasm-opt.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ int main(int argc, const char* argv[]) {
6969
bool fuzzBinary = false;
7070
std::string extraFuzzCommand;
7171
bool translateToFuzz = false;
72+
bool fuzzAtomics = true;
7273
bool fuzzPasses = false;
7374
std::string emitJSWrapper;
7475
std::string emitSpecWrapper;
@@ -105,6 +106,9 @@ int main(int argc, const char* argv[]) {
105106
.add("--translate-to-fuzz", "-ttf", "Translate the input into a valid wasm module *somehow*, useful for fuzzing",
106107
Options::Arguments::Zero,
107108
[&](Options *o, const std::string& arguments) { translateToFuzz = true; })
109+
.add("--no-fuzz-atomics", "-nfa", "Disable generation of atomic opcodes with translate-to-fuzz (on by default)",
110+
Options::Arguments::Zero,
111+
[&](Options *o, const std::string& arguments) { fuzzAtomics = false; })
108112
.add("--fuzz-passes", "-fp", "Pick a random set of passes to run, useful for fuzzing. this depends on translate-to-fuzz (it picks the passes from the input)",
109113
Options::Arguments::Zero,
110114
[&](Options *o, const std::string& arguments) { fuzzPasses = true; })
@@ -165,7 +169,7 @@ int main(int argc, const char* argv[]) {
165169
if (fuzzPasses) {
166170
reader.pickPasses(options);
167171
}
168-
reader.build();
172+
reader.build(fuzzAtomics);
169173
if (options.passOptions.validate) {
170174
if (!WasmValidator().validate(wasm, features)) {
171175
WasmPrinter::printModule(&wasm);

0 commit comments

Comments
 (0)