Re: ITERATOR LIST CORRUPTED error
I've migrated from VS2003 to VS2005. The followign code does not work
anymore -it shows assertion. Here is the test program:
#include "stdafx.h"
#include <windows.h>
#include <hash_map>
int _tmain(int argc, _TCHAR* argv[])
{
stdext::hash_map<DWORD_PTR, int> map;
map[100] = 1; map[200] = 2; map[300] = 3;
stdext::hash_map<DWORD_PTR, int>::iterator itr =
map.find(100);
map.erase(itr); // assertion here
return 0;
}
The program works well (Debug configuation) until I turn on Full
Optimization (/0x) compiler option. In this case I receive assertion:
ITERATOR LIST CORRUPTED.
If I turn off optimization - there is no assertion.
What is the problem ?
I can repro your problem by setting /Ox on the debug build (and
changing the /RTC1 and /ZI options).
I suggest that you submit a bug report containing your repro project
to MS here:
http://lab.msdn.microsoft.com/productfeedback/default.aspx
Post back a link to your bug report and I'll validate it.
Dave