tb0239.pp 532 B

123456789101112131415161718192021222324252627282930313233343536
  1. { Old file: tbs0279.pp }
  2. { crash with ansistring and new(^ansistring) OK 0.99.13 (PFV) }
  3. {$H+}
  4. Program AnsiTest;
  5. Type
  6. PS=^String;
  7. procedure test;
  8. var
  9. P:PS;
  10. Begin
  11. New(P);
  12. P^:='';
  13. P^:=P^+'BLAH';
  14. P^:=P^+' '+P^;
  15. Writeln(P^);
  16. Dispose(P);
  17. end;
  18. var
  19. membefore : longint;
  20. begin
  21. membefore:=memavail;
  22. test;
  23. if membefore<>memavail then
  24. begin
  25. Writeln('Memory hole using pointers to ansi strings');
  26. Halt(1);
  27. end
  28. else
  29. Writeln('No memory hole with pointers to ansi strings');
  30. end.