Browse Source

* fixed s<'', fixes 4925

git-svn-id: trunk@3505 -
florian 19 years ago
parent
commit
5d9f3cf33d
3 changed files with 11 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 3 0
      compiler/nadd.pas
  3. 7 0
      tests/webtbs/tw4925.pp

+ 1 - 0
.gitattributes

@@ -6802,6 +6802,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/tw5001.pp svneol=native#text/plain

+ 3 - 0
compiler/nadd.pas

@@ -1551,6 +1551,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
@@ -1581,6 +1583,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.