[cfe-commits] Add PointerEscapeKind to checkPointerEscape callback
Jordan Rose
jordan_rose at apple.com
Fri Jan 18 18:57:02 PST 2013
On Jan 18, 2013, at 18:55 , Anna Zaks <ganna at apple.com> wrote:
>
> On Jan 18, 2013, at 6:43 PM, Jordan Rose <jordan_rose at apple.com> wrote:
>
>>
>>
>> - if (Call && doesNotFreeMemory(Call, State))
>> + if ((Kind == PSK_DirectEscapeOnCall ||
>> + Kind == PSK_IndirectEscapeOnCall) &&
>> + doesNotFreeMemory(Call, State)) {
>>
>> This is not correct. Before, this branch was only taken if the Kind is PSK_DirectEscapeOnCall. Indirect escapes can still possibly free memory (although it's unlikely).
>>
>
> Jordan,
>
> I think the condition is correct. In fact, this is the whole point of this commit.
> For example, previously, we would assume that a call to foo_that_does_not_free_memory(p+1), could free memory.
>
> Branden, can you add a test case that shows this? I know the test cases in the second patch rely on this, but a self contained example would make the change explicit. (Ex: you could call a function from a system header and pass it p+1.)
...ah. Okay, right. Carry on.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130118/96dbed88/attachment.html>
More information about the cfe-commits
mailing list