From 8ff55f184bd5a49d2635a65d68695597f9d180e9 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Mon, 6 Oct 2025 11:27:21 +1300 Subject: [PATCH] bugpoint.cc: Quoting fixes Don't strip runner/suffix quotes. Quote script/command argument. --- passes/cmds/bugpoint.cc | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/passes/cmds/bugpoint.cc b/passes/cmds/bugpoint.cc index 21058f50d..9df254513 100644 --- a/passes/cmds/bugpoint.cc +++ b/passes/cmds/bugpoint.cc @@ -468,13 +468,13 @@ struct BugpointPass : public Pass { if (args[argidx] == "-script" && argidx + 1 < args.size()) { if (!yosys_arg.empty()) log_cmd_error("A -script or -command option can be only provided once!\n"); - yosys_arg = stringf("-s %s", args[++argidx]); + yosys_arg = stringf("-s %s", quote(args[++argidx])); continue; } if (args[argidx] == "-command" && argidx + 1 < args.size()) { if (!yosys_arg.empty()) log_cmd_error("A -script or -command option can be only provided once!\n"); - yosys_arg = stringf("-p %s", args[++argidx]); + yosys_arg = stringf("-p %s", quote(args[++argidx])); continue; } if (args[argidx] == "-grep" && argidx + 1 < args.size()) { @@ -547,18 +547,10 @@ struct BugpointPass : public Pass { } if (args[argidx] == "-runner" && argidx + 1 < args.size()) { runner = args[++argidx]; - if (runner.size() && runner.at(0) == '"') { - log_assert(runner.back() == '"'); - runner = runner.substr(1, runner.size() - 2); - } continue; } if (args[argidx] == "-suffix" && argidx + 1 < args.size()) { suffix = args[++argidx]; - if (suffix.size() && suffix.at(0) == '"') { - log_assert(suffix.back() == '"'); - suffix = suffix.substr(1, suffix.size() - 2); - } continue; } break;