Sfoglia il codice sorgente

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 9 anni fa
parent
commit
5c9166e17c
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  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;