ソースを参照

- reverted r10982 (merge of r10450 and r10455) because it depends
on another fix for proper operation, but that one cannot be
safely merged (+ test, mantis #11349)

git-svn-id: branches/fixes_2_2@11062 -

Jonas Maebe 17 年 前
コミット
65610c94e3
5 ファイル変更24 行追加51 行削除
  1. 1 1
      .gitattributes
  2. 5 19
      compiler/nmat.pas
  3. 1 6
      tests/test/cg/tnot.pp
  4. 0 25
      tests/webtbs/tw10966.pp
  5. 17 0
      tests/webtbs/tw11349.pp

+ 1 - 1
.gitattributes

@@ -7980,7 +7980,6 @@ tests/webtbs/tw1092.pp svneol=native#text/plain
 tests/webtbs/tw10920.pp svneol=native#text/plain
 tests/webtbs/tw10927.pp svneol=native#text/plain
 tests/webtbs/tw1096.pp svneol=native#text/plain
-tests/webtbs/tw10966.pp svneol=native#text/plain
 tests/webtbs/tw1097.pp svneol=native#text/plain
 tests/webtbs/tw10979.pp svneol=native#text/plain
 tests/webtbs/tw10998.pp svneol=native#text/plain
@@ -8005,6 +8004,7 @@ tests/webtbs/tw11309.pp svneol=native#text/plain
 tests/webtbs/tw11312.pp svneol=native#text/plain
 tests/webtbs/tw1132.pp svneol=native#text/plain
 tests/webtbs/tw1133.pp svneol=native#text/plain
+tests/webtbs/tw11349.pp svneol=native#text/plain
 tests/webtbs/tw1152.pp svneol=native#text/plain
 tests/webtbs/tw1157.pp svneol=native#text/plain
 tests/webtbs/tw1157b.pp svneol=native#text/plain

+ 5 - 19
compiler/nmat.pas

@@ -844,32 +844,18 @@ implementation
                s8bit,
                u16bit,
                s16bit,
-               s32bit,
-{$ifdef cpu64bit}
                u32bit,
-{$endif cpu64bit}
-               s64bit:
-                 begin
-                   v:=int64(not int64(v));
-                   if (torddef(left.resultdef).ordtype<>s64bit) then
-                     def:=sinttype
-                   else
-                     def:=s64inttype;
-                 end;
-{$ifndef cpu64bit}
-               u32bit,
-{$endif not cpu64bit}
+               s32bit,
+               s64bit,
                u64bit :
                  begin
-                   { Delphi-compatible: not dword = dword (not word = longint) }
-                   { Extension: not qword = qword                              }
-                   v:=qword(not qword(v));
-                   { will be truncated by the ordconstnode for u32bit }
+                   v:=int64(not int64(v)); { maybe qword is required }
+                   int_to_type(v,def);
                  end;
                else
                  CGMessage(type_e_mismatch);
              end;
-             t:=cordconstnode.create(v,def,true);
+             t:=cordconstnode.create(v,def,false);
              result:=t;
              exit;
           end;

+ 1 - 6
tests/test/cg/tnot.pp

@@ -57,8 +57,7 @@ begin
     writeln('Passed!');
 end;
 
-const
-  lb = longbool(false);
+
 
 var
  longres :  longint;
@@ -128,10 +127,6 @@ Begin
    Write('Value should be FALSE...');
    test(ord(byteboolres),0);
 
-  longboolres:=not(lb);
-  Write('Value should be 1...');
-  test(ord(longboolres),1);
-
   { !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! }
   { CURRENT_NODE : LOC_JUMP }
   { ???????????????????????}

+ 0 - 25
tests/webtbs/tw10966.pp

@@ -1,25 +0,0 @@
-{$r+}
-
-const
-  ctnsNeedJITParsing  = 1 shl 1;
-type
-  TCodeTreeNodeSubDesc = word;    
-var
-  SubDesc: TCodeTreeNodeSubDesc;
-  l: longint;
-//  c: cardinal;
-begin
-  SubDesc := 1;
-// fails
-//  SubDesc := not 2;
-  l := not(2);
-// fails
-//  c := not(2);
-  l := not ctnsNeedJITParsing;
-// fails
-//  c := not ctnsNeedJITParsing;
-  SubDesc := SubDesc and (not 2);
-  SubDesc := SubDesc and (not (1 shl 1));
-  SubDesc := SubDesc and (not ctnsNeedJITParsing);
-end.
-

+ 17 - 0
tests/webtbs/tw11349.pp

@@ -0,0 +1,17 @@
+{ %norun }
+
+program bug11349;
+
+{$R+,Q+}
+
+const
+  WS_BORDER = DWORD($800000);
+
+var
+  Style: Cardinal;
+
+begin
+  Style := 0;
+  Style := Style and not WS_BORDER;
+end.
+