tpftch1.pp 416 B

12345678910111213141516171819202122232425262728
  1. { %OPT=-S2 -O1 }
  2. { check if we don't cause sigsegvs when attempting to prefetch if }
  3. { typecasts are involved }
  4. type
  5. tc1 = class
  6. a: tc1;
  7. x: boolean;
  8. end;
  9. tc2 = class(tc1)
  10. b: array[1..1000000000] of byte;
  11. c: tc1;
  12. end;
  13. var
  14. a: tc1;
  15. begin
  16. a := tc1.create;
  17. while assigned(a) do
  18. if a.x then
  19. a := tc2(a).c
  20. else
  21. a := a.a;
  22. end.