summaryrefslogtreecommitdiff
path: root/scripts/fuzz_opt.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/fuzz_opt.py')
-rwxr-xr-xscripts/fuzz_opt.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/fuzz_opt.py b/scripts/fuzz_opt.py
index 4b4439e4f..0d720c8f7 100755
--- a/scripts/fuzz_opt.py
+++ b/scripts/fuzz_opt.py
@@ -478,6 +478,9 @@ STACK_LIMIT = '[trap stack limit]'
# and also see the --dce workaround below that also links to those issues.
V8_UNINITIALIZED_NONDEF_LOCAL = 'uninitialized non-defaultable local'
+# JS exceptions are logged as exception thrown: REASON
+EXCEPTION_PREFIX = 'exception thrown: '
+
# given a call line that includes FUZZ_EXEC_CALL_PREFIX, return the export that
# is called
@@ -585,7 +588,7 @@ def fix_output(out):
out = re.sub(r'f64\.const (-?[nanN:abcdefxIity\d+-.]+)', fix_double, out)
# mark traps from wasm-opt as exceptions, even though they didn't run in a vm
- out = out.replace(TRAP_PREFIX, 'exception: ' + TRAP_PREFIX)
+ out = out.replace(TRAP_PREFIX, EXCEPTION_PREFIX + TRAP_PREFIX)
# funcref(0) has the index of the function in it, and optimizations can
# change that index, so ignore it
@@ -595,6 +598,9 @@ def fix_output(out):
# to "N".
out = re.sub(r'i31ref\((-?\d+)\)', r'\1', out)
+ # Tag names may change due to opts, so canonicalize them.
+ out = re.sub(r' tag\$\d+', ' tag', out)
+
lines = out.splitlines()
for i in range(len(lines)):
line = lines[i]
@@ -604,7 +610,7 @@ def fix_output(out):
# developer can see it.
print(line)
lines[i] = None
- elif 'exception' in line:
+ elif EXCEPTION_PREFIX in line:
# exceptions may differ when optimizing, but an exception should
# occur, so ignore their types (also js engines print them out
# slightly differently)