Skip to content

Commit 40724e8

Browse files
authored
Merge pull request #62613 from rintaro/refactoring-asan-rdar103369305
[Refactoring] Fix stack-use-after-scope in ContextFinder
2 parents b46eb23 + 25c4c99 commit 40724e8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/Refactoring/Refactoring.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class ContextFinder : public SourceEntityWalker {
4949
ASTContext &Ctx;
5050
SourceManager &SM;
5151
SourceRange Target;
52-
function_ref<bool(ASTNode)> IsContext;
52+
std::function<bool(ASTNode)> IsContext;
5353
SmallVector<ASTNode, 4> AllContexts;
5454
bool contains(ASTNode Enclosing) {
5555
auto Result = SM.rangeContains(Enclosing.getSourceRange(), Target);
@@ -59,12 +59,12 @@ class ContextFinder : public SourceEntityWalker {
5959
}
6060
public:
6161
ContextFinder(SourceFile &SF, ASTNode TargetNode,
62-
function_ref<bool(ASTNode)> IsContext =
62+
std::function<bool(ASTNode)> IsContext =
6363
[](ASTNode N) { return true; }) :
6464
SF(SF), Ctx(SF.getASTContext()), SM(Ctx.SourceMgr),
6565
Target(TargetNode.getSourceRange()), IsContext(IsContext) {}
6666
ContextFinder(SourceFile &SF, SourceLoc TargetLoc,
67-
function_ref<bool(ASTNode)> IsContext =
67+
std::function<bool(ASTNode)> IsContext =
6868
[](ASTNode N) { return true; }) :
6969
SF(SF), Ctx(SF.getASTContext()), SM(Ctx.SourceMgr),
7070
Target(TargetLoc), IsContext(IsContext) {

0 commit comments

Comments
 (0)