Skip to content

Commit 3401f3c

Browse files
committed
[SILLLVMGen] Fix a stack-use-after-scope
The PSPs need to live long enough for the call to OptimizedIRRequest. rdar://65724385, rdar://65712583
1 parent 500929f commit 3401f3c

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

test/sil-llvm-gen/alloc.sil

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// REQUIRES: CODEGENERATOR=X86
99
// REQUIRES: CODEGENERATOR=ARM
1010

11-
// REQUIRES: rdar65712583
12-
1311
import Builtin
1412

1513
struct Pair<T> {

tools/sil-llvm-gen/SILLLVMGen.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,13 +190,13 @@ int main(int argc, char **argv) {
190190
auto *mod = CI.getMainModule();
191191
assert(mod->getFiles().size() == 1);
192192

193-
auto getDescriptor = [&]() -> IRGenDescriptor {
194-
const auto &TBDOpts = Invocation.getTBDGenOptions();
195-
const auto &SILOpts = Invocation.getSILOptions();
196-
auto &SILTypes = CI.getSILTypes();
197-
auto moduleName = CI.getMainModule()->getName().str();
198-
const PrimarySpecificPaths PSPs(OutputFilename, InputFilename);
193+
const auto &TBDOpts = Invocation.getTBDGenOptions();
194+
const auto &SILOpts = Invocation.getSILOptions();
195+
auto &SILTypes = CI.getSILTypes();
196+
auto moduleName = CI.getMainModule()->getName().str();
197+
const PrimarySpecificPaths PSPs(OutputFilename, InputFilename);
199198

199+
auto getDescriptor = [&]() -> IRGenDescriptor {
200200
if (PerformWMO) {
201201
return IRGenDescriptor::forWholeModule(
202202
mod, Opts, TBDOpts, SILOpts, SILTypes,

0 commit comments

Comments
 (0)