Ver código fonte

* stringconst+pchar returns a string

git-svn-id: trunk@1283 -
peter 20 anos atrás
pai
commit
2a6623a97f
1 arquivos alterados com 4 adições e 3 exclusões
  1. 4 3
      compiler/nadd.pas

+ 4 - 3
compiler/nadd.pas

@@ -1089,12 +1089,13 @@ implementation
          else if (
                   (rd.deftype=pointerdef) and (ld.deftype=pointerdef)
                  ) or
-                 { compare/add pchar to char arrays by addresses like BP/Delphi }
+                 { compare/add pchar to variable (not stringconst) char arrays
+                   by addresses like BP/Delphi }
                  (
                   (nodetype in [equaln,unequaln,subn,addn]) and
                   (
-                   ((is_pchar(ld) or (lt=niln)) and is_chararray(rd)) or
-                   ((is_pchar(rd) or (rt=niln)) and is_chararray(ld))
+                   ((is_pchar(ld) or (lt=niln)) and is_chararray(rd) and (rt<>stringconstn)) or
+                   ((is_pchar(rd) or (rt=niln)) and is_chararray(ld) and (lt<>stringconstn))
                   )
                  ) then
           begin