Skip to content

Commit e904e24

Browse files
committed
ModuleInterface: Fix use-after-free when cloning SPI attributes.
Resolves rdar://94176931.
1 parent 7a4c36e commit e904e24

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/AST/Attr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1949,8 +1949,8 @@ SPIAccessControlAttr::create(ASTContext &context,
19491949

19501950
SPIAccessControlAttr *SPIAccessControlAttr::clone(ASTContext &C,
19511951
bool implicit) const {
1952-
auto *attr = new (C) SPIAccessControlAttr(
1953-
implicit ? SourceLoc() : AtLoc, implicit ? SourceRange() : getRange(),
1952+
auto *attr = SPIAccessControlAttr::create(
1953+
C, implicit ? SourceLoc() : AtLoc, implicit ? SourceRange() : getRange(),
19541954
getSPIGroups());
19551955
attr->setImplicit(implicit);
19561956
return attr;

0 commit comments

Comments
 (0)