Browse Source

* partial fix (not for 64 bit CPUs yet) for #5641 (tested only lower byte of result of object constructors)

git-svn-id: trunk@4455 -
florian 19 years ago
parent
commit
22146e2bcf
4 changed files with 15 additions and 6 deletions
  1. 2 2
      compiler/pdecobj.pas
  2. 2 2
      compiler/pdecsub.pas
  3. 8 2
      compiler/psystem.pas
  4. 3 0
      compiler/symdef.pas

+ 2 - 2
compiler/pdecobj.pas

@@ -76,9 +76,9 @@ implementation
            { Set return type, class constructors return the
            { Set return type, class constructors return the
              created instance, object constructors return boolean }
              created instance, object constructors return boolean }
            if is_class(pd._class) then
            if is_class(pd._class) then
-            pd.rettype.setdef(pd._class)
+             pd.rettype.setdef(pd._class)
            else
            else
-            pd.rettype:=booltype;
+             pd.rettype:=bool32type;
            constructor_head:=pd;
            constructor_head:=pd;
         end;
         end;
 
 

+ 2 - 2
compiler/pdecsub.pas

@@ -1013,9 +1013,9 @@ implementation
                   { Set return type, class constructors return the
                   { Set return type, class constructors return the
                     created instance, object constructors return boolean }
                     created instance, object constructors return boolean }
                   if is_class(pd._class) then
                   if is_class(pd._class) then
-                   pd.rettype.setdef(pd._class)
+                    pd.rettype.setdef(pd._class)
                   else
                   else
-                   pd.rettype:=booltype;
+                    pd.rettype:=bool32type;
                 end;
                 end;
             end;
             end;
 
 

+ 8 - 2
compiler/psystem.pas

@@ -136,6 +136,8 @@ implementation
         u64inttype.setdef(torddef.create(u64bit,low(qword),TConstExprInt(high(qword))));
         u64inttype.setdef(torddef.create(u64bit,low(qword),TConstExprInt(high(qword))));
         s64inttype.setdef(torddef.create(s64bit,low(int64),high(int64)));
         s64inttype.setdef(torddef.create(s64bit,low(int64),high(int64)));
         booltype.setdef(torddef.create(bool8bit,0,1));
         booltype.setdef(torddef.create(bool8bit,0,1));
+        bool16type.setdef(torddef.create(bool16bit,0,1));
+        bool32type.setdef(torddef.create(bool32bit,0,1));
         cchartype.setdef(torddef.create(uchar,0,255));
         cchartype.setdef(torddef.create(uchar,0,255));
         cwidechartype.setdef(torddef.create(uwidechar,0,65535));
         cwidechartype.setdef(torddef.create(uwidechar,0,65535));
         cshortstringtype.setdef(tstringdef.createshort(255));
         cshortstringtype.setdef(tstringdef.createshort(255));
@@ -249,8 +251,8 @@ implementation
         addtype('OpenString',openshortstringtype);
         addtype('OpenString',openshortstringtype);
         addtype('Boolean',booltype);
         addtype('Boolean',booltype);
         addtype('ByteBool',booltype);
         addtype('ByteBool',booltype);
-        adddef('WordBool',torddef.create(bool16bit,0,1));
-        adddef('LongBool',torddef.create(bool32bit,0,1));
+        addtype('WordBool',bool16type);
+        addtype('LongBool',bool32type);
         addtype('Byte',u8inttype);
         addtype('Byte',u8inttype);
         addtype('ShortInt',s8inttype);
         addtype('ShortInt',s8inttype);
         addtype('Word',u16inttype);
         addtype('Word',u16inttype);
@@ -285,6 +287,8 @@ implementation
         addtype('$widestring',cwidestringtype);
         addtype('$widestring',cwidestringtype);
         addtype('$openshortstring',openshortstringtype);
         addtype('$openshortstring',openshortstringtype);
         addtype('$boolean',booltype);
         addtype('$boolean',booltype);
+        addtype('$boolean16',bool16type);
+        addtype('$boolean32',bool32type);
         addtype('$void_pointer',voidpointertype);
         addtype('$void_pointer',voidpointertype);
         addtype('$char_pointer',charpointertype);
         addtype('$char_pointer',charpointertype);
         addtype('$widechar_pointer',widecharpointertype);
         addtype('$widechar_pointer',widecharpointertype);
@@ -367,6 +371,8 @@ implementation
         loadtype('s80real',s80floattype);
         loadtype('s80real',s80floattype);
         loadtype('s64currency',s64currencytype);
         loadtype('s64currency',s64currencytype);
         loadtype('boolean',booltype);
         loadtype('boolean',booltype);
+        loadtype('boolean16',bool16type);
+        loadtype('boolean32',bool32type);
         loadtype('void_pointer',voidpointertype);
         loadtype('void_pointer',voidpointertype);
         loadtype('char_pointer',charpointertype);
         loadtype('char_pointer',charpointertype);
         loadtype('widechar_pointer',widecharpointertype);
         loadtype('widechar_pointer',widecharpointertype);

+ 3 - 0
compiler/symdef.pas

@@ -651,6 +651,9 @@ interface
        cchartype,                 { Char }
        cchartype,                 { Char }
        cwidechartype,             { WideChar }
        cwidechartype,             { WideChar }
        booltype,                  { boolean type }
        booltype,                  { boolean type }
+       bool16type,
+       bool32type,
+       bool64type,                { implement me }
        u8inttype,                 { 8-Bit unsigned integer }
        u8inttype,                 { 8-Bit unsigned integer }
        s8inttype,                 { 8-Bit signed integer }
        s8inttype,                 { 8-Bit signed integer }
        u16inttype,                { 16-Bit unsigned integer }
        u16inttype,                { 16-Bit unsigned integer }