소스 검색

+ 204,205 CVS:
----------------------------------------------------------------------
readme.txt CVS: Added Files: CVS: bug0204.pp bug0205.pp CVS:
----------------------------------------------------------------------

peter 27 년 전
부모
커밋
a53d748739
4개의 변경된 파일42개의 추가작업 그리고 3개의 파일을 삭제
  1. 4 3
      bugs/bug0124.pp
  2. 5 0
      bugs/bug0204.pp
  3. 31 0
      bugs/bug0205.pp
  4. 2 0
      bugs/readme.txt

+ 4 - 3
bugs/bug0124.pp

@@ -1,4 +1,4 @@
-{ Compile with -Rintel switch }
+{$asmmode intel}
 var
  l : longint;
 begin
@@ -6,6 +6,7 @@ begin
  { relative to stack, and the parser thinks all wrong  }
  { because of this.                                    }
  asm
-   mov eax, [eax*4+l]    
+        lea     eax,[eax*4+eax]
+        mov     eax,[eax*4+l]
  end;
-end. 
+end.

+ 5 - 0
bugs/bug0204.pp

@@ -0,0 +1,5 @@
+var
+  b : boolean;
+begin
+  byte(b):=1;
+end.

+ 31 - 0
bugs/bug0205.pp

@@ -0,0 +1,31 @@
+program bug_show;
+{ By PAV ([email protected]) }
+
+function bad_uppercase(s:string):string;
+var i:integer;
+begin
+  for i:=1 to length(s) do
+    if (ord(s[i])>=97 and ord(s[i])<=122) then s[i]:=chr(ord(s[i])-97+65);
+  bad_uppercase:=s;
+end;
+
+function good_uppercase(s:string):string;
+var i:integer;
+begin
+  for i:=1 to length(s) do
+    if (ord(s[i])>=97) and (ord(s[i])<=122) then s[i]:=chr(ord(s[i])-97+65);
+  good_uppercase:=s;
+end;
+
+const cadena='Free Paskal Compiler 0.99.8  !!! (bug)';
+begin
+  writeln('This is the original string before convert it');
+  writeln(cadena);
+  writeln();
+  writeln('This is a bad result, using "if (  and  )"');
+  writeln(bad_uppercase(cadena));
+  writeln();
+  writeln('This is a good result, using "if () and ()"');
+  writeln(good_uppercase(cadena));
+  writeln();
+end.

+ 2 - 0
bugs/readme.txt

@@ -267,3 +267,5 @@ bug0198.pp   calling specifications aren't allowed in class declarations,
 bug0200.pp   array of char overloading problem with strings
 bug0202.pp   flag results not supported with case
 bug0203.pp   problem with changed mangledname of procedures after use
+bug0204.pp   can typecast the result var in an assignment
+bug0205.pp   and parsing bug, generates wrong code (tp7 gives parser error)