Prechádzať zdrojové kódy

Merged revisions 3505 via svnmerge from
http://svn.freepascal.org/svn/fpc/trunk

r3505 (florian)
* fixed s<'', fixes 4925

git-svn-id: branches/fixes_2_0@3506 -

florian 19 rokov pred
rodič
commit
85c3e64942
3 zmenil súbory, kde vykonal 11 pridanie a 0 odobranie
  1. 1 0
      .gitattributes
  2. 3 0
      compiler/nadd.pas
  3. 7 0
      tests/webtbs/tw4925.pp

+ 1 - 0
.gitattributes

@@ -6475,6 +6475,7 @@ tests/webtbs/tw4893c.pp svneol=native#text/plain
 tests/webtbs/tw4898.pp -text
 tests/webtbs/tw4902.pp -text
 tests/webtbs/tw4922.pp svneol=native#text/plain
+tests/webtbs/tw4925.pp svneol=native#text/plain
 tests/webtbs/tw4950.pp svneol=native#text/plain
 tests/webtbs/tw4999.pp svneol=native#text/plain
 tests/webtbs/tw5036.pp svneol=native#text/plain

+ 3 - 0
compiler/nadd.pas

@@ -1517,6 +1517,8 @@ implementation
 
 
     function taddnode.first_addstring: tnode;
+      const
+        swap_relation: array [ltn..unequaln] of Tnodetype=(gtn, gten, ltn, lten, equaln, unequaln);
       var
         p: tnode;
       begin
@@ -1547,6 +1549,7 @@ implementation
                       p := left;
                       left := right;
                       right := p;
+                      nodetype:=swap_relation[nodetype];
                     end;
                   if is_shortstring(left.resulttype.def) or
                      (nodetype in [gtn,gten,ltn,lten]) then

+ 7 - 0
tests/webtbs/tw4925.pp

@@ -0,0 +1,7 @@
+var
+  s : string;
+begin
+  s:='asdf';
+   if not(''<s) then
+     halt(1);
+end.