diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-13 17:38:11 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-13 17:38:11 +0800 |
| commit | 5f393fc403ef17fe46f40e8227bd050197775c39 (patch) | |
| tree | 07948209e228168d02774aefadb8bc2229bcca41 /backend/lib | |
| parent | 2aafd0a0d48a2fbca2b75eef0116fe096dc8610b (diff) | |
| download | rcc-project-5f393fc403ef17fe46f40e8227bd050197775c39.tar.gz rcc-project-5f393fc403ef17fe46f40e8227bd050197775c39.tar.xz | |
[Tooling] Avoid unchecked pipeline selectors
Diffstat (limited to 'backend/lib')
| -rw-r--r-- | backend/lib/Tooling/PipelineDriver.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/backend/lib/Tooling/PipelineDriver.cpp b/backend/lib/Tooling/PipelineDriver.cpp index 1a584f7..9e2ba46 100644 --- a/backend/lib/Tooling/PipelineDriver.cpp +++ b/backend/lib/Tooling/PipelineDriver.cpp @@ -310,13 +310,12 @@ runFunction(MachineFunction &Function, mir::MIRDocument &Document, const TargetD } } if (!Started) { - const std::string &Selector = - Controls.StartBefore ? *Controls.StartBefore : *Controls.StartAfter; + const std::string Selector = Controls.StartBefore.value_or(Controls.StartAfter.value_or("")); return makeUnexpected(ErrorCode::InvalidInvocation, "pipeline start selector did not match: '" + Selector + "'"); } if (!StopMatched) { - const std::string &Selector = Controls.StopBefore ? *Controls.StopBefore : *Controls.StopAfter; + const std::string Selector = Controls.StopBefore.value_or(Controls.StopAfter.value_or("")); return makeUnexpected(ErrorCode::InvalidInvocation, "pipeline stop selector did not match: '" + Selector + "'"); } |
