瀏覽代碼

two new bugs found

pierre 27 年之前
父節點
當前提交
13c058d6ef
共有 3 個文件被更改,包括 32 次插入0 次删除
  1. 11 0
      bugs/bug0208.pp
  2. 18 0
      bugs/bug0209.pp
  3. 3 0
      bugs/readme.txt

+ 11 - 0
bugs/bug0208.pp

@@ -0,0 +1,11 @@
+program bug0208;
+
+{ implicit boolean to integer conversion should not be
+  allowed }
+var
+  b : boolean;
+  i : longint;
+begin
+  b:=true;
+  i:=b;
+end.

+ 18 - 0
bugs/bug0209.pp

@@ -0,0 +1,18 @@
+program bug0209;
+
+{ problem with boolean expression mixing different boolean sizes }
+
+var
+  b : boolean;
+  wb : wordbool;
+  lb : longbool;
+begin
+  b:=true;
+  wb:=true;
+  lb:=true;
+  if (not b) or (not wb) or (not lb) then
+    begin
+       Writeln('Error with boolean expressions of different sizes');
+       Halt(1);
+    end;
+end.

+ 3 - 0
bugs/readme.txt

@@ -271,3 +271,6 @@ bug0204.pp   can typecast the result var in an assignment
 bug0205.pp   and parsing bug, generates wrong code (tp7 gives parser error)
 bug0205.pp   and parsing bug, generates wrong code (tp7 gives parser error)
 bug0206.pp   sets with variable ranges doesn't work
 bug0206.pp   sets with variable ranges doesn't work
 bug0207.pp   a class destructor doesn't release the memory
 bug0207.pp   a class destructor doesn't release the memory
+bug0208.pp   implicit conversion from boolean to longint should not be allowed
+             (this is the reason of bug0205 !)
+bug0209.pp   problem with boolean expressions of different store sizes