IDR icon indicating copy to clipboard operation
IDR copied to clipboard

Bug in TFMain_11011981::AnalyzeProc2

Open tmcdos opened this issue 9 years ago • 0 comments

In file Analyze2.cpp in function TFMain_11011981::AnalyzeProc2 there is the following piece of code

if (DisInfo.Ret)
{
  //End of proc
  if (!lastAdr || curAdr == lastAdr)
  {
    if (AnalyzeRetType)
    {
      //Если тип регистра eax не пустой, находим ближайшую сверху инструкцию его инциализации
      if (registers[16].type != "")
      {
        for (Pos = curPos - 1; Pos >= fromPos; Pos--)
        {
          b = Flags[Pos];
          if ((b & cfInstruction) & !(b & cfSkip)) 

On the last row, I think it should be if ((b & cfInstruction) && !(b & cfSkip)) - otherwise, according to the generated code it seems that cfSkip check is effectively ignored shot-1 It is obvious, that compiled code actually resembles other logic.

However, if I change the second & with && - the kind of many InfoRec`s becomes ikFunc instead of ikProc - this is clearly visible on event handlers for visual controls (usually TNotifyEvent) I am not sure whether these are bugs, or not .... shot-2 shot-3 shot-4 shot-5 shot-6 shot-7 shot-8 shot-9 shot-10

tmcdos avatar Jul 02 '16 09:07 tmcdos