Re: [fpc-devel] Capturing addresses

2019-11-11 Thread Marc Weustink via fpc-devel
Jonas Maebe wrote: Hi, Does anyone know what the accepted/excepted behaviour is regarding the capture of addresses of var/out/const-by-address/constref parameters? For example: var g: longint; p: plongint; procedure test(var l: longint); begin p:=@l; end; begin test(g); end.

Re: [fpc-devel] Capturing addresses

2019-11-10 Thread Marco Borsari via fpc-devel
Il 10/11/2019 14:36, Jonas Maebe ha scritto: Hi, Does anyone know what the accepted/excepted behaviour is regarding the capture of addresses of var/out/const-by-address/constref parameters? For example: var g: longint; p: plongint; procedure test(var l: longint); begin p:=@l; end;

Re: [fpc-devel] Capturing addresses

2019-11-10 Thread Martin Frb
On 10/11/2019 15:05, Jonas Maebe wrote: On 10/11/2019 14:58, Martin Frb wrote: So I am trying to understand what the difference (in terms of safety) is? (except that the none "var param" is always unsafe, the "var param" is only sometimes unsafe)? If you are talking about the safety of

Re: [fpc-devel] Capturing addresses

2019-11-10 Thread Jonas Maebe
On 10/11/2019 14:58, Martin Frb wrote: > So I am trying to understand what the difference (in terms of safety) > is? (except that the none "var param" is always unsafe, the "var param" > is only sometimes unsafe)? If you are talking about the safety of accesses after the capturing routine has

Re: [fpc-devel] Capturing addresses

2019-11-10 Thread Martin Frb
On 10/11/2019 14:36, Jonas Maebe wrote: For example: var g: longint; p: plongint; procedure test(var l: longint); begin p:=@l; end; begin test(g); end. After test() executes, p now contains the address of g (the '@' operator does not return the address of g's address on the

[fpc-devel] Capturing addresses

2019-11-10 Thread Jonas Maebe
Hi, Does anyone know what the accepted/excepted behaviour is regarding the capture of addresses of var/out/const-by-address/constref parameters? For example: var g: longint; p: plongint; procedure test(var l: longint); begin p:=@l; end; begin test(g); end. After test() executes, p