Changeset 80 for trunk/Target


Ignore:
Timestamp:
Jan 1, 2017, 11:34:52 AM (8 years ago)
Author:
chronos
Message:
  • Fixed: Exception if optimization for empty code was used.
  • Fixed: Correctly show used memory cells.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Target/UTargetInterpretter.pas

    r79 r80  
    228228  if MemoryPosition < MemorySize then Inc(MemoryPosition, FProgram[FProgramIndex].Parameter)
    229229    else raise Exception.Create(SProgramUpperLimit);
    230   if MemoryPosition > MemoryMaxUsed then
    231     MemoryMaxUsed := MemoryPosition;
     230  if (MemoryPosition + 1) > MemoryMaxUsed then
     231    MemoryMaxUsed := MemoryPosition + 1;
    232232end;
    233233
     
    255255  OutputPosition := 1;
    256256  MemoryPosition := 0;
    257   MemoryMaxUsed := 0;
     257  MemoryMaxUsed := 1;
    258258  //FillChar(Pointer(Memory)^, Length(Memory), 0);
    259259  for I := 0 to Length(Memory) - 1 do
Note: See TracChangeset for help on using the changeset viewer.