On Fri, 11 Mar 2016, dinmil wrote:

program project1;

{$mode delphi}

uses
 cmem,
 Classes, SysUtils;
var
 VBuffer: TBytes;
 VStream: TStream;
begin
 VStream := TBytesStream.Create;
 try
   VBuffer := TEncoding.UTF8.GetBytes('abc');
   VStream.WriteBuffer(VBuffer[0], Length(VBuffer));
 finally
   VStream.Free;
 end;
 writeln('Press any key to finish...');
 readln;
end.

I tried this with CT540 - it is OK
CT570 with newer compiler gets access violation when in debug.
If you try application from command prompt then it is OK.

This points to an error in CodeTyphon, not Free Pascal.
What are the options used to compile the program ? Does it include -gh ?
If so, then that is almost certainly the problem.

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to