2
0
Эх сурвалжийг харах

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

git-svn-id: trunk@46299 -
florian 5 жил өмнө
parent
commit
af1e6fde5c

+ 1 - 0
.gitattributes

@@ -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

+ 4 - 1
compiler/optcse.pas

@@ -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 - 0
tests/webtbs/tw37477.pp

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