[Lazarus] Bug on library project while accessing string
Darmawan Sugiarto
darmawan_sugiarto at yahoo.com
Thu Jan 24 06:57:44 CET 2013
hello guys, I got some bug on library project. When I uses Lazarus 0.9.28.2 I write this code and work well, then I recompile it use Lazarus 1.0.2 and 1.0.4 and got this error....
Project project_test raised exception class 'External: SIGEGV'.
At address 7C91B1FA
I have 2 project
first project is library project...
Here is the code for first project
function test(_str:string):string; cdecl; export;
implementation
function test(_str:string):string; cdecl; export;
var
_i,_l,_k,_d:integer;
_h:string;
_char:Char;
begin
if _str<>'' then
begin
_l:=length(_str);
//SetLength(_h,_l);
_h:=_str;
_char:='t';
_h[1]:=_char;
end else _h:='';
Result :=_h;
end;
Then second project is application project.
I got 1 button to execute function in the library project.
Here is the code.
function test(_str:string):string; cdecl; external 'project1.dll' name 'TEST';
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(test('alex'));
end;
I got that error when I click the button.
If I delete this selection, It work well
_h[1]:=_char;
=============INTOSOFT============
ALEXIO CHAOS
Darmawan_Sugiarto at yahoo.com
Yahoo Messager
=================================
________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20130124/ababfbfd/attachment-0003.html>
More information about the Lazarus
mailing list