[llvm] r334544 - Add null check to Intel JIT event listener
Reid Kleckner via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 13 11:58:30 PDT 2018
It's more likely that r334543 enabled building the intel jit event code in
the first place. I think the null check is still correct and we should keep
it. There are no owned raw pointers here, everything is handled with RAII.
On Tue, Jun 12, 2018 at 5:26 PM Matt Morehouse <mascasa at google.com> wrote:
> This appears to have caused a memory leak:
> http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/19431
>
> On Tue, Jun 12, 2018 at 1:58 PM Reid Kleckner via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>> Author: rnk
>> Date: Tue Jun 12 13:54:11 2018
>> New Revision: 334544
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=334544&view=rev
>> Log:
>> Add null check to Intel JIT event listener
>>
>> Modified:
>>
>> llvm/trunk/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp
>>
>> Modified:
>> llvm/trunk/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp?rev=334544&r1=334543&r2=334544&view=diff
>>
>> ==============================================================================
>> ---
>> llvm/trunk/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp
>> (original)
>> +++
>> llvm/trunk/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp Tue
>> Jun 12 13:54:11 2018
>> @@ -101,15 +101,17 @@ void IntelJITEventListener::NotifyObject
>> const
>> RuntimeDyld::LoadedObjectInfo &L) {
>>
>> OwningBinary<ObjectFile> DebugObjOwner = L.getObjectForDebug(Obj);
>> - const ObjectFile &DebugObj = *DebugObjOwner.getBinary();
>> + const ObjectFile *DebugObj = DebugObjOwner.getBinary();
>> + if (!DebugObj)
>> + return;
>>
>> // Get the address of the object image for use as a unique identifier
>> - const void* ObjData = DebugObj.getData().data();
>> - std::unique_ptr<DIContext> Context = DWARFContext::create(DebugObj);
>> + const void* ObjData = DebugObj->getData().data();
>> + std::unique_ptr<DIContext> Context = DWARFContext::create(*DebugObj);
>> MethodAddressVector Functions;
>>
>> // Use symbol info to iterate functions in the object.
>> - for (const std::pair<SymbolRef, uint64_t> &P :
>> computeSymbolSizes(DebugObj)) {
>> + for (const std::pair<SymbolRef, uint64_t> &P :
>> computeSymbolSizes(*DebugObj)) {
>> SymbolRef Sym = P.first;
>> std::vector<LineNumberInfo> LineInfo;
>> std::string SourceFileName;
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180613/6cc6bf52/attachment.html>
More information about the llvm-commits
mailing list