[lld] r264097 - Fix operator= on OwningAtomPtr to call destructor when needed.

Rafael Espíndola via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 23 05:20:53 PDT 2016


Kostya,

Can you change the bot to start reporting errors?

Thanks,
Rafael
On Mar 22, 2016 6:48 PM, "Pete Cooper" <peter_cooper at apple.com> wrote:

> Hi all
>
> Just to note that this has (finally!) fixed the last asan failure in the
> mach-o lld code.  The first passing results are
> http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/11308
>
> We still have to fix the ubsan failures which look to be the same issue
> over and over again, and i’ll work on that next.
>
> Cheers,
> Pete
>
> PS, sorry this took so long.  I really hoped to have something in place at
> the end of last week but it took longer than expected to get my head around
> the YAML parser and its interaction with owning pointers.
> > On Mar 22, 2016, at 2:08 PM, Pete Cooper via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
> >
> > Author: pete
> > Date: Tue Mar 22 16:08:39 2016
> > New Revision: 264097
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=264097&view=rev
> > Log:
> > Fix operator= on OwningAtomPtr to call destructor when needed.
> >
> > If the LHS of 'a = b' already had an atom in it then we wouldn't
> > call the destructor.  This happens when we use something like
> > std::remove_if which is done in the CompactUnwindPass.  Should fix
> > the leaks on the mach-o/unwind-info-simple-x86_64.yaml test case.
> >
> > Lang and I are going to take a look at removing OwningAtomPtr in
> > favour of a std::unique_ptr but just trying to get the bots green
> > so we have a good baseline first.
> >
> > Modified:
> >    lld/trunk/include/lld/Core/Atom.h
> >
> > Modified: lld/trunk/include/lld/Core/Atom.h
> > URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/Atom.h?rev=264097&r1=264096&r2=264097&view=diff
> >
> ==============================================================================
> > --- lld/trunk/include/lld/Core/Atom.h (original)
> > +++ lld/trunk/include/lld/Core/Atom.h Tue Mar 22 16:08:39 2016
> > @@ -100,6 +100,8 @@ public:
> >   }
> >
> >   void operator=(OwningAtomPtr&& ptr) {
> > +    if (atom)
> > +      runDestructor(atom);
> >     atom = ptr.atom;
> >     ptr.atom = nullptr;
> >   }
> >
> >
> > _______________________________________________
> > 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/20160323/ee105bfb/attachment-0001.html>


More information about the llvm-commits mailing list