* setelementn cannot be the root node of a cse domain, resolves #37477

git-svn-id: trunk@46299 -
This commit is contained in:
florian 2020-08-06 20:49:07 +00:00
parent 985220d94c
commit af1e6fde5c
3 changed files with 11 additions and 1 deletions

1
.gitattributes vendored
View File

@ -18408,6 +18408,7 @@ tests/webtbs/tw3742.pp svneol=native#text/plain
tests/webtbs/tw37427.pp svneol=native#text/pascal
tests/webtbs/tw37449.pp svneol=native#text/pascal
tests/webtbs/tw37468.pp svneol=native#text/pascal
tests/webtbs/tw37477.pp svneol=native#text/pascal
tests/webtbs/tw37493.pp svneol=native#text/pascal
tests/webtbs/tw3751.pp svneol=native#text/plain
tests/webtbs/tw3758.pp svneol=native#text/plain

View File

@ -307,7 +307,10 @@ unit optcse;
begin
result:=fen_false;
nodes:=nil;
if n.nodetype in cseinvariant then
if (n.nodetype in cseinvariant) and
{ a setelement node is cseinvariant, but it might not be replaced by a block so
it cannot be the root of the cse search }
(n.nodetype<>setelementn) then
begin
csedomain:=true;
foreachnodestatic(pm_postprocess,n,@searchsubdomain,@csedomain);

6
tests/webtbs/tw37477.pp Normal file
View File

@ -0,0 +1,6 @@
{ %OPT=-O3 }
{ %norun }
var a : integer;
begin
write(a = a in[a in[a], a / 0 > a])
end.