MS Visual Studio 2008, STL
От: Novik65  
Дата: 07.11.08 13:25
Оценка:
Приветствую.
Проект скомпилирован с Maximize Speed (/O2) и Only __inline (/Ob1). Получаю такое вот забавное раскрытие insert:

std::vector<unsigned int,std::allocator<unsigned int> >::insert(std::_Vector_const_iterator<unsigned int,std::allocator<unsigned int> >, const unsigned int &)

iterator insert(const_iterator _Where, const _Ty& _Val)
        {    // insert _Val at _Where
        size_type _Off = size() == 0 ? 0 : _Where - begin();
        _Insert_n(_Where, (size_type)1, _Val);
        return (begin() + _Off);
004A0AAE  mov         edi,dword ptr [esi+0Ch] 
004A0AB1  cmp         edi,dword ptr [esi+10h] 
004A0AB4  jbe         std::vector<unsigned int,std::allocator<unsigned int> >::insert+6Ch (4A0ABCh) 
004A0AB6  call        dword ptr [__imp___invalid_parameter_noinfo (518314h)] 
004A0ABC  mov         esi,dword ptr [esi] 
004A0ABE  mov         ebp,esi 
004A0AC0  mov         dword ptr [esp+14h],edi 
004A0AC4  test        esi,esi 
004A0AC6  jne         std::vector<unsigned int,std::allocator<unsigned int> >::insert+90h (4A0AE0h) 
004A0AC8  call        dword ptr [__imp___invalid_parameter_noinfo (518314h)] 
004A0ACE  xor         eax,eax 
004A0AD0  lea         edi,[edi+ebx*4] 
004A0AD3  cmp         edi,dword ptr [eax+10h] 
004A0AD6  ja          std::vector<unsigned int,std::allocator<unsigned int> >::insert+9Bh (4A0AEBh) 
004A0AD8  test        esi,esi 
004A0ADA  je          std::vector<unsigned int,std::allocator<unsigned int> >::insert+94h (4A0AE4h) 
004A0ADC  mov         esi,dword ptr [esi] 
004A0ADE  jmp         std::vector<unsigned int,std::allocator<unsigned int> >::insert+96h (4A0AE6h) 
004A0AE0  mov         eax,dword ptr [esi] 
004A0AE2  jmp         std::vector<unsigned int,std::allocator<unsigned int> >::insert+80h (4A0AD0h) 
004A0AE4  xor         esi,esi 
004A0AE6  cmp         edi,dword ptr [esi+0Ch] 
004A0AE9  jae         std::vector<unsigned int,std::allocator<unsigned int> >::insert+0A1h (4A0AF1h) 
004A0AEB  call        dword ptr [__imp___invalid_parameter_noinfo (518314h)] 
004A0AF1  mov         eax,dword ptr [esp+1Ch] 
004A0AF5  mov         dword ptr [eax+4],edi 
004A0AF8  pop         edi  
004A0AF9  pop         esi  
004A0AFA  mov         dword ptr [eax],ebp 
004A0AFC  pop         ebp  
004A0AFD  pop         ebx


Ессно, фрагмент
xor         eax,eax
cmp         edi,dword ptr [eax+10h]

приводит к вылету в catch блок ввиду попытки чтения по указателю 0x10. Кто виноват, и что с этим безобразием делать?
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.