Menu

#1418 check array

Undefined
wont-fix
nobody
wxSmith (62)
Bug_Report
2023-09-22
2023-09-20
No
src/plugins/contrib/wxSmithSTC/stc/scintilla/src/CellBuffer.cxx line 584
Code:
int UndoHistory::StartRedo() {
    // Drop any leading startAction
    if (actions[currentAction].at == startAction && currentAction < maxAction) //<--  change conditions
        currentAction++;
    // Count the steps in this action
    int act = currentAction;
    while (actions[act].at != startAction && act < maxAction) { ) //<--  change conditions
        act++;
    }
    return act - currentAction;
}

Discussion

  • ollydbg

    ollydbg - 2023-09-21
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,3 +1,4 @@
    +~~~
     src/plugins/contrib/wxSmithSTC/stc/scintilla/src/CellBuffer.cxx line 584
     Code:
     int UndoHistory::StartRedo() {
    @@ -11,4 +12,5 @@
        }
        return act - currentAction;
     }
    +~~~
    
     
  • ollydbg

    ollydbg - 2023-09-21
    • labels: --> wxSmith
     
  • Miguel Gimenez

    Miguel Gimenez - 2023-09-21

    maxAction is not the array capacity, IMHO in this case the conditions can be checked in any order. Also both have similar execution times, so there is no gain in swapping them.

     
  • Miguel Gimenez

    Miguel Gimenez - 2023-09-22
    • status: open --> wont-fix
     

Log in to post a comment.

MongoDB Logo MongoDB