Parcourir la source

* fixed (harmless) range error

git-svn-id: trunk@7511 -
Jonas Maebe il y a 18 ans
Parent
commit
628ddfa160
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      compiler/ncgcon.pas

+ 2 - 1
compiler/ncgcon.pas

@@ -525,7 +525,8 @@ implementation
                { not plongint, because that will "sign extend" the set on 64 bit platforms }
                { not plongint, because that will "sign extend" the set on 64 bit platforms }
                { if changed to "paword", please also modify "32-resultdef.size*8" and      }
                { if changed to "paword", please also modify "32-resultdef.size*8" and      }
                { cross-endian code below                                                   }
                { cross-endian code below                                                   }
-               location.value:=pCardinal(value_set)^
+               { Extra aint type cast to avoid range errors                                }
+               location.value:=aint(pCardinal(value_set)^)
 {$else}
 {$else}
                location.value:=reverse_byte(Psetbytes(value_set)^[0]);
                location.value:=reverse_byte(Psetbytes(value_set)^[0]);
                location.value:=location.value or (reverse_byte(Psetbytes(value_set)^[1]) shl 8);
                location.value:=location.value or (reverse_byte(Psetbytes(value_set)^[1]) shl 8);