[llvm] r334544 - Add null check to Intel JIT event listener

Matt Morehouse via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 12 17:26:07 PDT 2018


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/20180612/f68fd291/attachment.html>


More information about the llvm-commits mailing list