[LLVMbugs] [Bug 14022] New: unique_ptr::reset is not checking for self assignment

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Oct 4 09:53:09 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=14022

             Bug #: 14022
           Summary: unique_ptr::reset is not checking for self assignment
           Product: libc++
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: All Bugs
        AssignedTo: hhinnant at apple.com
        ReportedBy: gerald.slacik at flexis.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


_LIBCPP_INLINE_VISIBILITY void reset(pointer __p = pointer()) _NOEXCEPT
    {
        pointer __tmp = __ptr_.first();
        __ptr_.first() = __p;
        if (__tmp)
            __ptr_.second()(__tmp);
    }


is not checking for self assignment like auto_ptr does


    _LIBCPP_INLINE_VISIBILITY void reset(_Tp* __p = 0) throw()
    {
        if (__ptr_ != __p)
            delete __ptr_;
        __ptr_ = __p;
    }

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list