Hi all,

After upgrading fpc 2.6.4 -> 3.0.0, I'm seeing a bug where (as noted in subject) reference-counted function results are not being initialized to nil.

Is this a known bug?

I am seeing it in ansistrings and also dynamic arrays. Here is an example program to see it with ansistrings:

function new_string : ansistring;
  begin
    new_string := new_string + 'x';
  end;

begin
 writeln (new_string); // outputs: x
 writeln (new_string); // outputs: xx
 writeln (new_string); // outputs: xxx
end.

Reproducing with dynamic arrays seems to be a bit trickier, I haven't made a test case yet, but I think I will be able to if required.

What to do?

Thanks,
David


_______________________________________________
fpc-pascal maillist  -  [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to