[lld] r207690 - [ELF] Return result from the function ASAP.

Simon Atanasyan simon at atanasyan.com
Sat May 3 11:05:28 PDT 2014


On Wed, Apr 30, 2014 at 11:55 PM, Reid Kleckner <rnk at google.com> wrote:
> On Wed, Apr 30, 2014 at 12:03 PM, Simon Atanasyan <simon at atanasyan.com>
> wrote:

[...]

>> +      if (llvm::sys::fs::exists(path.str()))
>> +        return StringRef(*new (_allocator) std::string(path.str()));
>
> I don't think this commit introduces a leak, but how does this not leak
> memory?  BumpPtrAllocator doesn't call the destructors of things allocated
> in it.

It looks like you are right - the memory might leak here. I will
investigate it later. Thanks for the pointing out to the problem.

-- 
Simon Atanasyan



More information about the llvm-commits mailing list