[Patch] Make llvm::Regex non-copyable

dblaikie at gmail.com dblaikie at gmail.com
Thu Jan 2 11:10:12 PST 2014


Committed as r198334 with move assignment support as well. Thanks!

On Wed Jan 01 2014 at 4:38:26 PM, Maciej Piechotka <uzytkownik2 at gmail.com>
wrote:

> Updated tests and brown bug fix to move constructor.
>
> On Wed, 2014-01-01 at 20:24 +0100, Maciej Piechotka wrote:
> > llvm_regfree is not a noop for the nullptr. I can move the check for
> > null there of course.
> >
> > I'll update the patches with tests.
> >
> > On Wed, 2014-01-01 at 19:15 +0000, dblaikie at gmail.com wrote:
> > > Some unit testing of the move ctor might be nice
> > >
> > > Also - do you need the conditional in the dtor? delete nullptr; is a
> > > no-op, but I don't know if llvm_regfree is a safe no-op when the
> > > parameter is null.
> > > On Tue Dec 31 2013 at 9:27:10 AM, Maciej Piechotka
> > > <uzytkownik2 at gmail.com> wrote:
> > >         The current implementation of llvm::Regex does not support
> > >         copy
> > >         construction of it's values. However it is not enforced so
> > >         copying
> > >         llvm::Regex leads to crash (well - technically undefined
> > >         behaviour as
> > >         free'd memory is accessed and then freed once again).
> > >
> > >         Attached patch makes llvm::Regex non-copyable but adds the
> > >         move
> > >         constructor for C++11.
> > >
> > >         Best regards
> > >         _______________________________________________
> > >         llvm-commits mailing list
> > >         llvm-commits at cs.uiuc.edu
> > >         http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140102/0fcaae1c/attachment.html>


More information about the llvm-commits mailing list