[Patch] Make llvm::Regex non-copyable

Maciej Piechotka uzytkownik2 at gmail.com
Wed Jan 1 16:38:34 PST 2014


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 --------------
A non-text attachment was scrubbed...
Name: 0001-Prohibit-copy-construction-of-the-llvm-Regex-as-it-c.patch
Type: text/x-patch
Size: 2542 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140102/fc71c8f0/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140102/fc71c8f0/attachment.sig>


More information about the llvm-commits mailing list