remobjects/pascalscript

exception in x64 mode produces AV

Opened this issue · 1 comments

This code work fine in 32bit mode,but in x64 generate AV and stop host application.

{******************************************************************************}
procedure TForm3.myshow(Msg:String);
begin
  ShowMessage(Msg);
end;
{******************************************************************************}
procedure TForm3.exceptinsideme;
begin
  raise Exception.Create('Exception message from my proc');
end;
{******************************************************************************}
procedure TForm3.PSSCompile(Sender: TPSScript);
begin
  Sender.AddMethod(Self,@TForm3.myshow,'procedure myshow(Msg:String);');
  Sender.AddMethod(Self,@TForm3.exceptinsideme,'procedure exceptinsideme;');
end;
{******************************************************************************}
procedure TForm3.Button1Click(Sender: TObject);
begin
  PSS.Script.Text := 'var i:integer; begin try myshow(''Start..''); exceptinsideme; except myshow(''Except ->''+ExceptionToString(ExceptionType,ExceptionParam));   end; end.';
  if PSS.Compile then PSS.Execute;
end;
{******************************************************************************}