tb0118.pp 674 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. { Old file: tbs0138.pp }
  2. { with problem, %esi can be crushed and is not restored OK 0.99.6 (PM) }
  3. {program p; uncomment for a crash}
  4. type
  5. tpt=^tpo;
  6. tpo=object
  7. constructor init;
  8. procedure pi1;
  9. procedure pi2;
  10. end;
  11. constructor tpo.init;
  12. begin
  13. end;
  14. procedure tpo.pi1;
  15. begin
  16. end;
  17. procedure tpo.pi2;
  18. begin
  19. end;
  20. procedure crushesi;assembler;
  21. asm
  22. movl %eax,%esi
  23. end ['EAX','ESI'];
  24. var
  25. p1 : tpt;
  26. begin
  27. p1:=new(tpt,init);
  28. with p1^ do
  29. begin
  30. pi1;
  31. crushesi; { After this the %esi should be reloaded from the tempvariable }
  32. pi1;
  33. end;
  34. { There is here already a tempvar for %esi, why not use it here too ? }
  35. p1^.pi2;
  36. p1^.pi2;
  37. end.