Menu

#7 invalid usage of vector

open-remind
2
2010-02-11
2009-11-18
Progopis
No

Hi developers!

I found a problem while tried to compile project with Visual Studio 2008. All issues are applied to invalid usage of class vector. Here is an example of right code (at least I believe in this):

bool OllyLang::unregMemBlock(void * hMem)
{
vector<t_dbgmemblock>::iterator block;

for (block = tMemBlocks.begin(); block != tMemBlocks.end(); block++) {
if ((*block).hmem == hMem) { // here was a compiler's version independent problem: '=' instead of '=='
tMemBlocks.erase(block);
return true;
}
}
return false;
}

Was:

bool OllyLang::unregMemBlock(void * hMem)
{
t_dbgmemblock * block;
for (int b=0; b<tMemBlocks.size(); b++) {
block = &tMemBlocks[b];
if (block->hmem = hMem) {
tMemBlocks.erase(block);
return true;
}
}
return false;
}

Same problem in the OllyLang::ProcessAddonAction.

P.S. Could I join and help with developing of this nice library?

Discussion

  • Progopis

    Progopis - 2009-12-01
    • priority: 5 --> 6
     
  • Progopis

    Progopis - 2009-12-20

    "if ((*block).hmem == hMem) {" in my fix should be "if (block->hmem == hMem) {"

     
  • Epsylon 3

    Epsylon 3 - 2010-02-11
    • labels: --> script overall bug
    • priority: 6 --> 2
    • assigned_to: nobody --> e-3
    • status: open --> open-remind
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.