[LLVMbugs] [Bug 13797] New: std::__1::__function::__func::destroy invokes destructor multiple times

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Sep 8 07:29:21 PDT 2012


             Bug #: 13797
           Summary: std::__1::__function::__func::destroy invokes
                    destructor multiple times
           Product: libc++
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
        AssignedTo: hhinnant at apple.com
        ReportedBy: lcid-fire at gmx.net
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

First off - I would consider explicitly invoking a destructor very bad style.
Regardless - destroy may and is (when you do moving of function) called
multiple times - which (correctly) crashes for some compilers.
For now I patched the explicit destructor calls to __compressed_pair in destroy
and destroy_deallocate with a boolean guard.
The more correct solution IMO would be to implement a destroy in
__compressed_pair, too, which checks for multiple invokation.

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