From 5d9f3cf33dcc7b159e93b4c3f5a6342f3a6971c0 Mon Sep 17 00:00:00 2001 From: florian Date: Sat, 13 May 2006 20:10:27 +0000 Subject: [PATCH] * fixed s<'', fixes 4925 git-svn-id: trunk@3505 - --- .gitattributes | 1 + compiler/nadd.pas | 3 +++ tests/webtbs/tw4925.pp | 7 +++++++ 3 files changed, 11 insertions(+) create mode 100644 tests/webtbs/tw4925.pp diff --git a/.gitattributes b/.gitattributes index 0eb0b78ccc..274270ef4f 100644 --- a/.gitattributes +++ b/.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 diff --git a/compiler/nadd.pas b/compiler/nadd.pas index a0fc74e6bd..e7cd84770a 100644 --- a/compiler/nadd.pas +++ b/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 diff --git a/tests/webtbs/tw4925.pp b/tests/webtbs/tw4925.pp new file mode 100644 index 0000000000..63e7ad5729 --- /dev/null +++ b/tests/webtbs/tw4925.pp @@ -0,0 +1,7 @@ +var + s : string; +begin + s:='asdf'; + if not(''