Skip to content

Commit f7549df

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

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/AST/Attr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1951,7 +1951,7 @@ SPIAccessControlAttr *SPIAccessControlAttr::clone(ASTContext &C,
19511951
bool implicit) const {
19521952
auto *attr = new (C) SPIAccessControlAttr(
19531953
implicit ? SourceLoc() : AtLoc, implicit ? SourceRange() : getRange(),
1954-
getSPIGroups());
1954+
C.AllocateCopy(getSPIGroups()));
19551955
attr->setImplicit(implicit);
19561956
return attr;
19571957
}

0 commit comments

Comments
 (0)