tw30357.pp 561 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. program tw30357;
  2. {$mode delphi}
  3. type
  4. TMyRecord = record
  5. private
  6. class function GetEmpty: TMyRecord; static;
  7. public
  8. class property Empty: TMyRecord read GetEmpty;
  9. private
  10. FData: IInterface;
  11. end;
  12. class function TMyRecord.GetEmpty: TMyRecord; static;
  13. begin
  14. end;
  15. procedure Main2(Sender: TObject);
  16. var
  17. v1: PtrUInt;
  18. begin
  19. v1 := 42;
  20. end;
  21. procedure Main(Sender: TObject);
  22. var
  23. v1: TMyRecord;
  24. begin
  25. if v1.FData <> nil then
  26. Halt(1);
  27. end;
  28. begin
  29. { with Main2 we ensure that the stack area is not 0 }
  30. Main2(nil);
  31. Main(nil);
  32. end.