#1 2015-10-23 08:58:49

ma64
Member
Registered: 2011-01-27
Posts: 12

App crashes when using DocVariant in Lazarus

Hello,

I'm working on an application in Lazarus (latest version for Windows available from www.getlazarus.org, i.e. with FPC 3.1.1, Rev. 49965) and noticed a crash when accessing a newly created DocVariant. To reproduce the problem please run the following code:

program project1;

{$IFDEF FPC}
{$mode delphi}
{$ELSE}
{$APPTYPE CONSOLE}
{$ENDIF}

uses
  SynCommons;

var
  j: variant;

begin
  j := TDocVariant.New;
  j.Add('abc');
  WriteLn(VariantSaveJson(j));
  ReadLn;
end.       

In Delphi the expected JSON result is shown, while Lazarus throws an "External: SIGSEGV" exception when executing the .Add().

Offline

Board footer

Powered by FluxBB