소스 검색

* let is_conststringnode() and is_constwidestringnode() also recognise string
constants that have a stringdef as resultdef

git-svn-id: trunk@32969 -

Jonas Maebe 9 년 전
부모
커밋
9ace5ad038
1개의 변경된 파일7개의 추가작업 그리고 2개의 파일을 삭제
  1. 7 2
      compiler/node.pas

+ 7 - 2
compiler/node.pas

@@ -711,13 +711,18 @@ implementation
     function is_conststringnode(p : tnode) : boolean;
       begin
          is_conststringnode :=
-           (p.nodetype = stringconstn) and is_chararray(p.resultdef);
+           (p.nodetype = stringconstn) and
+           (is_chararray(p.resultdef) or
+            is_shortstring(p.resultdef) or
+            is_ansistring(p.resultdef));
       end;
 
     function is_constwidestringnode(p : tnode) : boolean;
       begin
          is_constwidestringnode :=
-           (p.nodetype = stringconstn) and is_widechararray(p.resultdef);
+           (p.nodetype = stringconstn) and
+           (is_widechararray(p.resultdef) or
+            is_wide_or_unicode_string(p.resultdef));
       end;
 
     function is_conststring_or_constcharnode(p : tnode) : boolean;