mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 04:59:26 +02:00
* properly detect when we can't take the address of a with-expression
and assign it to a temp in that case (mantis #8141) git-svn-id: trunk@6071 -
This commit is contained in:
parent
4ed3ef645b
commit
2ad3ef968f
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -7964,6 +7964,7 @@ tests/webtbs/tw8028.pp svneol=native#text/plain
|
||||
tests/webtbs/tw8049.pp svneol=native#text/plain
|
||||
tests/webtbs/tw8055.pp svneol=native#text/plain
|
||||
tests/webtbs/tw8090.pp svneol=native#text/plain
|
||||
tests/webtbs/tw8141.pp svneol=native#text/plain
|
||||
tests/webtbs/ub1873.pp svneol=native#text/plain
|
||||
tests/webtbs/ub1883.pp svneol=native#text/plain
|
||||
tests/webtbs/uw0555.pp svneol=native#text/plain
|
||||
|
@ -508,8 +508,9 @@ implementation
|
||||
calltempnode:=nil;
|
||||
{ complex load, load in temp first }
|
||||
newblock:=internalstatements(newstatement);
|
||||
{ when right is a call then load it first in a temp }
|
||||
if p.nodetype=calln then
|
||||
{ when we can't take the address of p, load it in a temp }
|
||||
{ since we may need its address later on }
|
||||
if not valid_for_addr(p,false) then
|
||||
begin
|
||||
calltempnode:=ctempcreatenode.create(p.resultdef,p.resultdef.size,tt_persistent,true);
|
||||
addstatement(newstatement,calltempnode);
|
||||
|
10
tests/webtbs/tw8141.pp
Normal file
10
tests/webtbs/tw8141.pp
Normal file
@ -0,0 +1,10 @@
|
||||
{ %norun }
|
||||
uses
|
||||
Classes, SysUtils;
|
||||
|
||||
var
|
||||
List : TList;
|
||||
begin
|
||||
with LongRec(Pointer(List.Last)) do
|
||||
lo := 1;
|
||||
end.
|
Loading…
Reference in New Issue
Block a user