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

             Bug #: 14294
           Summary: std::deque clear() (and destructor too) segfaults
                    because begin() > end()
           Product: libc++
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified


It seems to me looking at it under the debugger, that the problem is somehow _i
(begin) starts further than _e (end) therefore _i is never equal to _e and the
loop continues until it segfaults. This is the problematic loop in file deque,
but obviously the problem is somewhere else.

template <class _Tp, class _Allocator>
void
__deque_base<_Tp, _Allocator>::clear() _NOEXCEPT
{
    allocator_type& __a = __alloc();
    for (iterator __i = begin(), __e = end(); __i != __e; ++__i)

This is for a deque of pointers, so the problem is not in a user destructor.

-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to