Skip to content

Commit 01a2645

Browse files
authored
Merge pull request swiftlang#21531 from compnerd/sil-opt-use-after-move
sil-opt: fix a use-after-move on Windows
2 parents d414648 + bd05e2e commit 01a2645

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/sil-opt/SILOpt.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -427,10 +427,10 @@ int main(int argc, char **argv) {
427427
llvm::errs() << EC.message() << '\n';
428428
return 1;
429429
}
430-
CI.getSILModule()->setOptRecordStream(
431-
llvm::make_unique<llvm::yaml::Output>(*OptRecordFile,
432-
&CI.getSourceMgr()),
433-
std::move(OptRecordFile));
430+
auto Stream = llvm::make_unique<llvm::yaml::Output>(*OptRecordFile,
431+
&CI.getSourceMgr());
432+
CI.getSILModule()->setOptRecordStream(std::move(Stream),
433+
std::move(OptRecordFile));
434434
}
435435

436436
if (OptimizationGroup == OptGroup::Diagnostics) {

0 commit comments

Comments
 (0)