tb0247.pp 619 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. { Old file: tbs0288.pp }
  2. { crash with virtual method in except part OK 0.99.13 (PFV) }
  3. {$mode objfpc}
  4. uses sysutils;
  5. const
  6. test_run : boolean = false;
  7. type
  8. zz=class(tobject)
  9. procedure test;virtual;
  10. procedure test1;virtual;
  11. end;
  12. procedure zz.test;
  13. begin
  14. writeln('ok');
  15. test_run:=true;
  16. end;
  17. procedure zz.test1;
  18. begin
  19. try
  20. raise exception.create('zz');
  21. except
  22. on e:exception do test;
  23. end;
  24. end;
  25. var
  26. z:zz;
  27. begin
  28. z:=zz.create;
  29. z.test1;
  30. z.destroy;
  31. if not test_run then
  32. begin
  33. Writeln('Problem with virtual method in except block');
  34. Halt(1);
  35. end;
  36. end.