Explorar o código

Patched a case where a size was erroneously identified with unsigned integer:

    MODULE Test;
    VAR s: SIZE;
    BEGIN
        s := 080000000H; (* ok *)
        s := 080000000H + s; (* FoxIntermediateCode.Assert fails *)
        s := s + 080000000H; (* error "conversion failed ?" *)
    END Test. 

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@6608 8c9fc860-2736-0410-a75d-ab315db34111
felixf %!s(int64=9) %!d(string=hai) anos
pai
achega
5c9166e17c
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      source/FoxSyntaxTree.Mod

+ 1 - 1
source/FoxSyntaxTree.Mod

@@ -845,7 +845,7 @@ TYPE
 
 		PROCEDURE SameType*(this: Type): BOOLEAN;
 		BEGIN RETURN (this = SELF) OR (this IS IntegerType) & (this.sizeInBits = sizeInBits) & (this(IntegerType).signed = signed)
-			OR (this IS SizeType) & (this.sizeInBits=sizeInBits)
+			OR signed & (this IS SizeType) & (this.sizeInBits=sizeInBits)
 		END SameType;
 
 		PROCEDURE CompatibleTo*(to: Type): BOOLEAN;