Skip to content

Commit 075c07c

Browse files
committed
fix
1 parent 74ca4eb commit 075c07c

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

scripts/fuzz_opt.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2219,6 +2219,7 @@ def do_handle_pair(self, input, before_wasm, after_wasm, opts):
22192219
def do_run(self, vm, js, wasm):
22202220
out = vm.run_js(js, wasm, checked=False)
22212221

2222+
# Clean up stack traces.
22222223
cleaned = []
22232224
for line in out.splitlines():
22242225
if 'RuntimeError:' in line or 'TypeError:' in line:
@@ -2240,7 +2241,14 @@ def do_run(self, vm, js, wasm):
22402241
# Ignore it, as details of traces differ based on optimizations.
22412242
continue
22422243
cleaned.append(line)
2243-
return '\n'.join(cleaned)
2244+
cleaned = '\n'.join(cleaned)
2245+
2246+
# Clean up function references, which can differ after opts, things like
2247+
#
2248+
# function 77() { [native code] }
2249+
#
2250+
cleaned = re.sub(r'function \d+\(\) ', 'function <ID>() ', cleaned)
2251+
return cleaned
22442252

22452253
def can_run_on_wasm(self, wasm):
22462254
return all_disallowed(DISALLOWED_FEATURES_IN_V8)

0 commit comments

Comments
 (0)