forked from OSchip/llvm-project
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 llvm-svn: 128998
This commit is contained in:
parent
ce5d9aedb9
commit
3337ca5f95
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue