View Issue Details

IDProjectCategoryView StatusLast Update
0003577JEDI VCL00 JVCL Componentspublic2006-03-20 04:53
Reporterivan_raAssigned ToAHUser 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.10 
Target VersionFixed in Version3.30 
Summary0003577: JvInterpreter: incorrect finally/except block handling (workaround)
Descriptionfor scripts having "Exit" statement inside "try" block Jvinterpreter executes only first statement from finally/except block. This is example:

procedure TestScript;
var
  StringList:TStringList;
begin
  StringList:=TStringList.Create;
  try
    Exit;
  finally
    ShowMessage('one'); // 1
    ShowMessage('two'); // 2
    StringList.Free; //3
  end;
end;

In this script JvInterpreter executes only first statement
Additional InformationThe cause of problem is incorrect using of FExit flag in TJvInterpreterFunction.InterpretTry.DoFinallyExcept procedure. It calls InterpretBegin and InterpretBegin exits after first statement because FExit=true.
DoFinallyExcept must save FExit, substitute it and restore in on exit:

  procedure DoFinallyExcept(E: Exception);
  var OldExit:boolean;
  begin
    OldExit:=FExit;
    try
      FExit:=false;
      ...
    finally
      FExit:=FExit or OldExit;
    end;
  end;
TagsNo tags attached.

Activities

ivan_ra

2006-03-14 05:35

developer   ~0008663

I can not make patch right now because anonimous CVS not working. May be later

AHUser

2006-03-20 04:53

developer   ~0008704

Fixed in CVS.

Issue History

Date Modified Username Field Change
2006-03-14 05:32 ivan_ra New Issue
2006-03-14 05:35 ivan_ra Note Added: 0008663
2006-03-20 04:53 AHUser Status new => resolved
2006-03-20 04:53 AHUser Resolution open => fixed
2006-03-20 04:53 AHUser Assigned To => AHUser
2006-03-20 04:53 AHUser Note Added: 0008704