Browse Source

* Do not insert a widestring <-> ansistring conversion node when checking for (un)equal empty string.

Michael VAN CANNEYT 2 years ago
parent
commit
1388f90afa
1 changed files with 4 additions and 2 deletions
  1. 4 2
      compiler/nadd.pas

+ 4 - 2
compiler/nadd.pas

@@ -2827,9 +2827,11 @@ implementation
                   st_unicodestring :
                   st_unicodestring :
                     begin
                     begin
                       if not(is_unicodestring(rd)) then
                       if not(is_unicodestring(rd)) then
-                        inserttypeconv(right,cunicodestringtype);
+                        if not ((ld.size=0) and (nodetype in [equaln,unequaln])) then
+                          inserttypeconv(right,cunicodestringtype);
                       if not(is_unicodestring(ld)) then
                       if not(is_unicodestring(ld)) then
-                        inserttypeconv(left,cunicodestringtype);
+                        if not ((rd.size=0) and (nodetype in [equaln,unequaln])) then
+                          inserttypeconv(left,cunicodestringtype);
                     end;
                     end;
                   st_ansistring :
                   st_ansistring :
                     begin
                     begin