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

             Bug #: 11362
           Summary: Undefined behavior in pop_heap_comp.pass.cpp
           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


I was running the libcxx tests with gcc-4.7.0 and noticed:

 % c++ -std=c++11 pop_heap_comp.pass.cpp
 % ./a.out
*** glibc detected *** ./a.out: double free or corruption (out):
0x0000000002443010 ***

This is because of:
 std::pop_heap(ia, ia, std::greater<int>());
 delete [] ia;

(ia, ia) is not a valid range and will send the ia pointer to lala land.

-- 
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