When updating the retain summary based on {cf,ns}_consumed attributes,

be sure to consume the argument index that actually had the attribute
rather than always the first.  rdar://problem/9234108



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128998 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
John McCall 2011-04-06 09:02:12 +00:00
Родитель 018e02cc19
Коммит 98b8f16a0b
2 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -1201,7 +1201,7 @@ RetainSummaryManager::updateSummaryFromAnnotations(RetainSummary &Summ,
// Effects on the parameters.
unsigned parm_idx = 0;
for (FunctionDecl::param_const_iterator pi = FD->param_begin(),
pe = FD->param_end(); pi != pe; ++pi) {
pe = FD->param_end(); pi != pe; ++pi, ++parm_idx) {
const ParmVarDecl *pd = *pi;
if (pd->getAttr<NSConsumedAttr>()) {
if (!GCEnabled)

Просмотреть файл

@ -1453,3 +1453,10 @@ static void rdar_8724287(CFErrorRef error)
}
}
// <rdar://problem/9234108> - Make sure the model applies cf_consumed
// correctly in argument positions besides the first.
extern void *CFStringCreate(void);
extern void rdar_9234108_helper(void *key, void * CF_CONSUMED value);
void rdar_9234108() {
rdar_9234108_helper(0, CFStringCreate());
}