Skip to content

Commit 5b1a06f

Browse files
authored
[5.3] Fix analysis invalidation in ClosureLifetimeFixup (#31322)
Accumulate modifiedCFG when calling correctStackNesting. Found this bug with -sil-verify-force-analysis=true flag
1 parent cdeadfe commit 5b1a06f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/SILOptimizer/Mandatory/ClosureLifetimeFixup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,7 @@ class ClosureLifetimeFixup : public SILFunctionTransform {
10031003
if (fixupClosureLifetimes(*getFunction(), checkStackNesting, modifiedCFG)) {
10041004
if (checkStackNesting){
10051005
StackNesting sn;
1006-
modifiedCFG =
1006+
modifiedCFG |=
10071007
sn.correctStackNesting(getFunction()) == StackNesting::Changes::CFG;
10081008
}
10091009
if (modifiedCFG)

test/Interpreter/objc_throw_in_noescape_block.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %empty-directory(%t)
22
//
33
// RUN: %target-clang -fobjc-arc %S/Inputs/ObjCException.m -c -o %t/ObjCException.o
4-
// RUN: %target-build-swift -import-objc-header %S/Inputs/ObjCException.h -Xlinker %t/ObjCException.o %s -o %t/a.out
4+
// RUN: %target-build-swift -Xllvm -sil-verify-force-analysis=true -import-objc-header %S/Inputs/ObjCException.h -Xlinker %t/ObjCException.o %s -o %t/a.out
55
// RUN: %target-codesign %t/a.out
66
// RUN: %target-run %t/a.out
77

0 commit comments

Comments
 (0)