[lazarus] RTL bug ?? TObject.FieldAddres

Marc Weustink weus at quicknet.nl
Thu Jul 6 20:23:34 EDT 2000


Hi,
While pinpointing the current crashes in lazarus I found it related to the 
TObject.FieldAddres function.

Try the following code, the number of aaaa is important, one less, 
everything is ok, one more you get an illegal instruction. The number of 
chars needed for this also depends on what or how many units are used.

Marc

-------------------------------------------

program vartest;

{$mode objfpc}

uses
   Classes;

type
   TMyComponent = class(TComponent)
     aaaaaaaaaa: TComponent;
     b: TComponent;
   private
   public
     constructor Create(AOwner: TComponent); override;
   end;


constructor TMyComponent.Create(AOwner: TComponent);
begin
   inherited Create(AOwner);
   aaaaaaaaaa := TComponent.Create(Self);
end;

var
   MyComponent: TMyComponent;

begin
   MyComponent := TMyComponent.Create(nil);
end.

-------------------------------------------

marc:~/fpc/lazarus/test$ ppc386 vartest.pp
Target OS: Linux for i386
Compiling vartest.pp
vartest.pp(25,3) Note: Local variable MYCOMPONENT is assigned but never used
Assembling (pipe) vartest.s
Linking vartest
28 Lines compiled, 0.2 sec
marc:~/fpc/lazarus/test$ vartest
An unhandled exception occurred at 0x0805D4AE :
Access violation
   0x0805D4AE
   0x0805DD7A
   0x08079540
   0x08075066
   0x0000D7B2

marc:~/fpc/lazarus/test$







More information about the Lazarus mailing list