Max Vlasov schrieb:
On Mon, Jul 11, 2011 at 4:45 AM, Chad Berchek <ad...@vobarian.com> wrote:
1. It seems that if a string is a (non-const) local variable it should be
safe. I base this on the following reasoning:


looks like it's not:

procedure TForm1.Button1Click(Sender: TObject);
var
  S: string;

  procedure SideEffectCall;
  begin
    SetLength(S, 0);
  end;

Replace it by
  S: TObject;
and
  S.Free
to see that you can force any undesireable effect with reference types by alias.

DoDi

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to