- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, my english is bad!
I am migrating from Intel v9.0/VS2003 to Intel v9.1.037/VS2005 SP1 and Boost v1.3.4
Its a Debug compilation, optimizations are disabled.
I have problems with the implicit bool operator of the boost::shared_ptr class.
Look at the highLighted line:
void * HDEOutlined::Streamer::Read ( ipstream & in , uint32 aVersion ) const { HDEOutlined* lThis = GetObject() ;
if ( in ) { shared_ptr
// Current Version: 4 if ( aVersion > 1 ) // 2->4 { if ( aVersion < 3 ) // 2 lSplitlineList = readList_noFlag else { shared_ptr< HFCurveNodesList> lCNSplitlineList ; if ( aVersion < 4 ) // 3 lCNSplitlineList = readList_noFlag else // 4 lCNSplitlineList = readList if( lCNSplitlineList ) { lSplitline2List.reset( new HFInterpolatedCurveList() ) ; copy(lCNSplitlineList->begin(),lCNSplitlineList->end(),back_inserter(*lSplitline2List)); } } }
if ( lSplitlineList ) { lSplitline2List.reset( ConvertOldSplitlineList (*lSplitlineList) ); }
lThis -> mSplitlineList = lSplitline2List ; }
return lThis ; } |
The highlighted if condition is not evaluated properly.
The shared_ptr operator bool is never called.
The execution evaluate the 'if' as TRUE,when lSplitlineList is a pointer to NULL. The 'if' clearly is FALSE!
The aVersion argument value is 4.
HDotLineList is declared as:
typedef std::vector< shared_ptr
Look at the dissasembly:
if ( lSplitlineList ) 090EB4D5 mov eax,dword ptr [ebp-68h] 090EB4D8 mov edx,dword ptr ds:[91E006Ch] 090EB4DE cmp eax,edx 090EB4E0 jne 090EB510 ; Here jumps 090EB4E2 lea eax,[ebp-6Ch] 090EB4E5 push edi 090EB4E6 mov dword ptr [esp],eax 090EB4E9 lea eax,[lSplitlineList] 090EB4EF mov ecx,eax 090EB4F1 call shared_ptr 090EB4F6 mov eax,dword ptr [ebp-64h] 090EB4F9 mov edx,dword ptr ds:[91E0070h] 090EB4FF cmp eax,edx 090EB501 jne 090EB510 090EB503 mov eax,dword ptr [ebp-6Ch] 090EB506 mov edx,dword ptr ds:[91E0068h] 090EB50C cmp eax,edx 090EB50E je 090EB544 { lSplitline2List.reset ( ConvertOldSplitlineList ( *lSplitlineList ) ) ; 090EB510 lea eax,[lSplitlineList] 090EB516 mov ecx,eax 090EB518 call shared_ptr 090EB51D mov dword ptr [ebp-4Ch],eax 090EB520 push edi 090EB521 mov eax,dword ptr [ebp-4Ch] 090EB524 mov dword ptr [esp],eax 090EB527 call ConvertOldSplitlineList (90F9268h) |
Compiled with Intel v9.0/VS2003 this works fine.
Is this a compiler error?
Help me, how can i solve the problem?
Angel Traversi
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks jljiang
I update boost lib from 1.33 to 1.34 (the last release)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Does adding volatile keyword in front of lSplitlineList variable declaration fix your problem?
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page