Skip to content

Commit 2ad5b43

Browse files
authored
Merge pull request swiftlang#34083 from DougGregor/function-builders-fixits-use-after-free
[Type checker] Eliminate a use-after-free due to C++ temporaries.
2 parents 0b3d0ab + f07c7d1 commit 2ad5b43

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

include/swift/AST/Decl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5946,7 +5946,7 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
59465946
/// Returns true if the function is an @asyncHandler.
59475947
bool isAsyncHandler() const;
59485948

5949-
/// Returns true if the function if the signature matches the form of an
5949+
/// Returns true if the function signature matches the form of an
59505950
/// @asyncHandler.
59515951
bool canBeAsyncHandler() const;
59525952

lib/Sema/BuilderTransform.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1979,7 +1979,8 @@ void swift::printFunctionBuilderBuildFunction(
19791979
componentTypeString = "<#Component#>";
19801980

19811981
// Render the code.
1982-
ExtraIndentStreamPrinter printer(out, stubIndent.getValueOr(std::string()));
1982+
std::string stubIndentStr = stubIndent.getValueOr(std::string());
1983+
ExtraIndentStreamPrinter printer(out, stubIndentStr);
19831984

19841985
// If we're supposed to provide a full stub, add a newline and the introducer
19851986
// keywords.

0 commit comments

Comments
 (0)