[llvm] r292133 - Fix use-after-free bug in AffectedValueCallbackVH::allUsesReplacedWith

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 17 16:33:00 PST 2017


On Mon, Jan 16, 2017 at 10:03 AM, Dimitry Andric <dimitry at andric.com> wrote:
> On 16 Jan 2017, at 16:22, Hal Finkel via llvm-commits <llvm-commits at lists.llvm.org> wrote:
>> Author: hfinkel
>> Date: Mon Jan 16 09:22:01 2017
>> New Revision: 292133
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=292133&view=rev
>> Log:
>> Fix use-after-free bug in AffectedValueCallbackVH::allUsesReplacedWith
>>
>> When transferring affected values in the cache from an old value, identified by
>> the value of the current callback, to the specified new value we might need to
>> insert a new entry into the DenseMap which constitutes the cache. Doing so
>> might delete the current callback object. Move the copying logic into a new
>> function, a member of the assumption cache itself, so that we don't run into UB
>> should the callback handle itself be removed mid-copy.
>>
>> Differential Revision: https://reviews.llvm.org/D28749
>
> Please merge this to release_40, when it's baked a little.

Merged it in r292312.

Thanks,
Hans


More information about the llvm-commits mailing list