summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/fuzz_opt.py3
-rw-r--r--src/passes/Print.cpp4
2 files changed, 4 insertions, 3 deletions
diff --git a/scripts/fuzz_opt.py b/scripts/fuzz_opt.py
index e3a59a690..c8f67b2ae 100644
--- a/scripts/fuzz_opt.py
+++ b/scripts/fuzz_opt.py
@@ -146,7 +146,7 @@ def test_one(infile, opts):
# fuzz vms
# gather VM outputs on input file
- run([in_bin('wasm-opt'), infile, '-ttf', '--emit-js-wrapper=a.js', '--emit-spec-wrapper=a.wat', '-o', 'a.wasm', '--mvp-features', '--enable-nontrapping-float-to-int'])
+ run([in_bin('wasm-opt'), infile, '-ttf', '--emit-js-wrapper=a.js', '--emit-spec-wrapper=a.wat', '-o', 'a.wasm', '--mvp-features'])
wasm_size = os.stat('a.wasm').st_size
bytes += wasm_size
print('pre js size :', os.stat('a.js').st_size, ' wasm size:', wasm_size)
@@ -202,6 +202,7 @@ opt_choices = [
["--pick-load-signs"],
["--precompute"],
["--precompute-propagate"],
+ ["--print"],
["--remove-unused-brs"],
["--remove-unused-nonfunction-module-elements"],
["--remove-unused-module-elements"],
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index 761c9e3d4..c511af434 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -206,7 +206,7 @@ struct PrintExpressionContents : public Visitor<PrintExpressionContents> {
case Xor: o << "xor"; break;
case Xchg: o << "xchg"; break;
}
- if (curr->bytes != getTypeSize(curr->type)) {
+ if (curr->type != unreachable && curr->bytes != getTypeSize(curr->type)) {
o << "_u";
}
restoreNormalColor(o);
@@ -218,7 +218,7 @@ struct PrintExpressionContents : public Visitor<PrintExpressionContents> {
prepareColor(o);
printRMWSize(o, curr->type, curr->bytes);
o << "cmpxchg";
- if (curr->bytes != getTypeSize(curr->type)) {
+ if (curr->type != unreachable && curr->bytes != getTypeSize(curr->type)) {
o << "_u";
}
restoreNormalColor(o);