Sfoglia il codice sorgente

* fixed 'cannot convert type' error when comparing two voidhugepointers with
= or <>

git-svn-id: trunk@28158 -

nickysn 11 anni fa
parent
commit
c8130843b2
3 ha cambiato i file con 10 aggiunte e 2 eliminazioni
  1. 6 2
      compiler/nadd.pas
  2. 3 0
      compiler/psystem.pas
  3. 1 0
      compiler/symdef.pas

+ 6 - 2
compiler/nadd.pas

@@ -1642,11 +1642,15 @@ implementation
                     inserttypeconv_internal(left,java_jlobject);
                     inserttypeconv_internal(right,java_jlobject);
 {$elseif defined(i8086)}
-                    if is_farpointer(left.resultdef) then
+                    if is_hugepointer(left.resultdef) then
+                      inserttypeconv_internal(left,charhugepointertype)
+                    else if is_farpointer(left.resultdef) then
                       inserttypeconv_internal(left,charfarpointertype)
                     else
                       inserttypeconv_internal(left,charnearpointertype);
-                    if is_farpointer(right.resultdef) then
+                    if is_hugepointer(right.resultdef) then
+                      inserttypeconv_internal(right,charhugepointertype)
+                    else if is_farpointer(right.resultdef) then
                       inserttypeconv_internal(right,charfarpointertype)
                     else
                       inserttypeconv_internal(right,charnearpointertype);

+ 3 - 0
compiler/psystem.pas

@@ -306,6 +306,7 @@ implementation
         voidhugepointertype:=tcpupointerdefclass(cpointerdef).createx86(voidtype,x86pt_huge);
         charnearpointertype:=tcpupointerdefclass(cpointerdef).createx86(cansichartype,x86pt_near);
         charfarpointertype:=tcpupointerdefclass(cpointerdef).createx86(cansichartype,x86pt_far);
+        charhugepointertype:=tcpupointerdefclass(cpointerdef).createx86(cansichartype,x86pt_huge);
         bytefarpointertype:=tcpupointerdefclass(cpointerdef).createx86(u8inttype,x86pt_far);
         wordfarpointertype:=tcpupointerdefclass(cpointerdef).createx86(u16inttype,x86pt_far);
         longintfarpointertype:=tcpupointerdefclass(cpointerdef).createx86(s32inttype,x86pt_far);
@@ -447,6 +448,7 @@ implementation
         addtype('$void_hugepointer',voidhugepointertype);
         addtype('$char_nearpointer',charnearpointertype);
         addtype('$char_farpointer',charfarpointertype);
+        addtype('$char_hugepointer',charhugepointertype);
         addtype('$byte_farpointer',bytefarpointertype);
         addtype('$word_farpointer',wordfarpointertype);
         addtype('$longint_farpointer',longintfarpointertype);
@@ -584,6 +586,7 @@ implementation
         loadtype('void_hugepointer',voidhugepointertype);
         loadtype('char_nearpointer',charnearpointertype);
         loadtype('char_farpointer',charfarpointertype);
+        loadtype('char_hugepointer',charhugepointertype);
         loadtype('byte_farpointer',bytefarpointertype);
         loadtype('word_farpointer',wordfarpointertype);
         loadtype('longint_farpointer',longintfarpointertype);

+ 1 - 0
compiler/symdef.pas

@@ -942,6 +942,7 @@ interface
        voidhugepointertype,
        charnearpointertype,
        charfarpointertype,
+       charhugepointertype,
        bytefarpointertype,        { used for Mem[] }
        wordfarpointertype,        { used for MemW[] }
        longintfarpointertype,     { used for MemL[] }