From 1bf9880c5531602665778bfde6b7c7f79ccea084 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 20 Mar 2026 11:16:13 -0700 Subject: [PATCH] go --- scripts/fuzz_opt.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/fuzz_opt.py b/scripts/fuzz_opt.py index 143a9ffaf39..c878b2d4cc8 100755 --- a/scripts/fuzz_opt.py +++ b/scripts/fuzz_opt.py @@ -1379,8 +1379,12 @@ class CtorEval(TestCaseHandler): frequency = 0.1 def handle(self, wasm): - # get the list of func exports, so we can tell ctor-eval what to eval. + # Get the list of func exports, so we can tell ctor-eval what to eval. func_exports = get_exports(wasm, ['func']) + # Avoid names that need escaping. Just allow simple names like func_256, + # which the fuzzer emits + # TODO: fix escaping in the tool and here + func_exports = [export for export in func_exports if re.fullmatch(r'^\w+$', export)] ctors = ','.join(func_exports) if not ctors: return @@ -1397,11 +1401,6 @@ def handle(self, wasm): # get the expected execution results. wasm_exec = run_bynterp(wasm, ['--fuzz-exec-before']) - # Fix escaping of the names, as we will be passing them as commandline - # parameters below (e.g. we want --ctors=foo\28bar and not - # --ctors=foo\\28bar; that extra escaping \ would cause an error). - ctors = ctors.replace('\\\\', '\\') - # eval the wasm. # we can use --ignore-external-input because the fuzzer passes in 0 to # all params, which is the same as ctor-eval assumes in this mode.