tbug934.pp 327 B

12345678910111213141516171819
  1. { $OPT=-Or }
  2. {$mode objfpc}
  3. Type
  4. t = class(TObject)
  5. f1,f2:dword;
  6. constructor Init(p1, p2:dword);
  7. end;
  8. constructor t.Init(p1, p2:dword);
  9. begin
  10. f1:=p1; f2:=p2;
  11. end;
  12. var ti:t;
  13. begin
  14. ti:=t.Init(1,2);
  15. writeln(ti.f1, ', ', ti.f2); // prints garbage instead of t2
  16. if ti.f2<>2 then
  17. Halt(1);
  18. end.