Changeset 137


Ignore:
Timestamp:
Mar 5, 2022, 4:38:34 PM (3 years ago)
Author:
chronos
Message:
  • Fixed: Wrong index variable used in inc/dec merge optimization.
  • Fixed: Reload output if program is reset.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Languages/LazFuck.cs.po

    r136 r137  
    599599msgstr "Spouštěč \"%s\" nenalezen"
    600600
     601#: utarget.sfirstindexhigherthanlastindex
     602msgid "First index higher than last index"
     603msgstr "První index větší neÅŸ poslední index"
     604
     605#: utarget.sfirstindexoutofrange
     606msgid "First index out of range"
     607msgstr "První index mimo rozsah"
     608
     609#: utarget.slastindexoutofrange
     610msgid "Last index out of range"
     611msgstr "Poslední index mimo rozsah"
     612
    601613#: utarget.snone
    602614msgid "None"
     
    610622msgid "Paused"
    611623msgstr "Zastaveno"
     624
     625#: utarget.sprogramindexerror
     626#, object-pascal-format
     627msgid "Old program index higher than new (old: %d, new: %d)"
     628msgstr "StarÃœ programová index vyšší neÅŸ novÃœ (stará: %d, novÃœ: %d)"
    612629
    613630#: utarget.srunning
  • trunk/Languages/LazFuck.pot

    r136 r137  
    589589msgstr ""
    590590
     591#: utarget.sfirstindexhigherthanlastindex
     592msgid "First index higher than last index"
     593msgstr ""
     594
     595#: utarget.sfirstindexoutofrange
     596msgid "First index out of range"
     597msgstr ""
     598
     599#: utarget.slastindexoutofrange
     600msgid "Last index out of range"
     601msgstr ""
     602
    591603#: utarget.snone
    592604msgid "None"
     
    599611#: utarget.spaused
    600612msgid "Paused"
     613msgstr ""
     614
     615#: utarget.sprogramindexerror
     616#, object-pascal-format
     617msgid "Old program index higher than new (old: %d, new: %d)"
    601618msgstr ""
    602619
  • trunk/Target/UTargetInterpretter.pas

    r136 r137  
    317317    Memory[I] := 0;
    318318  MemoryChanged := True;
     319  OutputChanged := True;
    319320  FStepCount := 0;
    320321  PrepareBreakPoints;
  • trunk/UBFTarget.pas

    r136 r137  
    267267          if NewProgram[NewProgram.Index - 1].Command = cmPointerInc then
    268268            NewProgram.Operations[NewProgram.Index - 1].Parameter := NewProgram[NewProgram.Index - 1].Parameter +
    269               FProgram[FProgram.Index].Parameter
     269              FProgram[FProgramIndex].Parameter
    270270          else
    271271          if NewProgram[NewProgram.Index - 1].Command = cmPointerDec then
    272272            NewProgram.Operations[NewProgram.Index - 1].Parameter := NewProgram[NewProgram.Index - 1].Parameter -
    273               FProgram[FProgram.Index].Parameter;
     273              FProgram[FProgramIndex].Parameter;
    274274          // If value negative then change command
    275275          if NewProgram[NewProgram.Index - 1].Parameter < 0 then begin
  • trunk/UTarget.pas

    r136 r137  
    167167  SNone = 'None';
    168168  SNormal = 'Normal';
     169  SProgramIndexError = 'Old program index higher than new (old: %d, new: %d)';
     170  SFirstIndexHigherThanLastIndex = 'First index higher than last index';
     171  SFirstIndexOutOfRange = 'First index out of range';
     172  SLastIndexOutOfRange = 'Last index out of range';
    169173
    170174const
     
    319323
    320324procedure TDebugSteps.UpdateTargetPos(OldProgramFrom, OldProgramTo, NewProgramFrom,
    321     NewProgramTo: Integer; NewTarget: Integer = 0);
     325  NewProgramTo: Integer; NewTarget: Integer = 0);
    322326var
    323327  I: Integer;
     
    329333  if (First <> -1) and (Last <> -1) then begin
    330334    if First > Last then
    331       raise Exception.Create('First index higher than last index');
     335      raise Exception.Create(SFirstIndexHigherThanLastIndex);
    332336    if (First < 0) or (First >= Count) then
    333       raise Exception.Create('First index out of range');
     337      raise Exception.Create(SFirstIndexOutOfRange);
    334338    if (Last < 0) or (Last >= Count) then
    335       raise Exception.Create('Last index out of range');
     339      raise Exception.Create(SLastIndexOutOfRange);
    336340    for I := Last downto First + 1 do Delete(I);
    337341
     
    343347      Items[First].TargetPosition := NewTarget;
    344348    end else
    345       raise Exception.Create('Old program index higher than new');
     349      raise Exception.Create(Format(SProgramIndexError, [SProgramIndexError, NewProgramTo]));
    346350  end;
    347351end;
Note: See TracChangeset for help on using the changeset viewer.