Browse Source

* fixed crash in psub
* ansistringcompare fixed
* support for #$0b8

peter 26 years ago
parent
commit
0274f3a08b
3 changed files with 41 additions and 22 deletions
  1. 23 15
      compiler/globals.pas
  2. 9 3
      compiler/psub.pas
  3. 9 4
      compiler/scanner.pas

+ 23 - 15
compiler/globals.pas

@@ -177,7 +177,7 @@ unit globals;
          this should dramatically decrease the number of
          recompilations needed PM }
        simplify_ppu : boolean = false;
-       
+
        { should we allow non static members ? }
        allow_only_static : boolean = false;
 
@@ -633,19 +633,22 @@ unit globals;
       begin
          compareansistrings:=0;
          j:=min(length1,length2);
-         for i:=1  to j do
-           begin
-              if p1[i]>p2[i] then
-                begin
-                   compareansistrings:=1;
-                   exit;
-                end
-              else if p1[i]<p2[i] then
-                begin
-                   compareansistrings:=-1;
-                   exit;
-                end;
-           end;
+         i:=0;
+         while (i<j) do
+          begin
+            if p1[i]>p2[i] then
+             begin
+               compareansistrings:=1;
+               exit;
+             end
+            else
+             if p1[i]<p2[i] then
+              begin
+                compareansistrings:=-1;
+                exit;
+              end;
+            inc(i);
+          end;
          if length1>length2 then
           compareansistrings:=1
          else
@@ -1247,7 +1250,12 @@ begin
 end.
 {
   $Log$
-  Revision 1.21  1999-08-27 10:45:00  pierre
+  Revision 1.22  1999-08-30 10:17:56  peter
+    * fixed crash in psub
+    * ansistringcompare fixed
+    * support for #$0b8
+
+  Revision 1.21  1999/08/27 10:45:00  pierre
    options -Ca sets simply_ppu to true
 
   Revision 1.20  1999/08/19 13:02:12  pierre

+ 9 - 3
compiler/psub.pas

@@ -573,7 +573,8 @@ begin
   _CONSTRUCTOR : begin
                    consume(_CONSTRUCTOR);
                    parse_proc_head(potype_constructor);
-                   if procinfo._class^.is_class then
+                   if assigned(procinfo._class) and
+                      procinfo._class^.is_class then
                     begin
                       { CLASS constructors return the created instance }
                       aktprocsym^.definition^.retdef:=procinfo._class;
@@ -584,7 +585,7 @@ begin
 {$IfDef GDB}
                       { GDB doesn't like unnamed types !}
                       aktprocsym^.definition^.retdef:=globaldef('boolean');
-{$Else GDB}
+{$else GDB}
                       aktprocsym^.definition^.retdef:=new(porddef,init(bool8bit,0,1));
 {$Endif GDB}
                     end;
@@ -2051,7 +2052,12 @@ end.
 
 {
   $Log$
-  Revision 1.16  1999-08-27 10:41:46  pierre
+  Revision 1.17  1999-08-30 10:17:57  peter
+    * fixed crash in psub
+    * ansistringcompare fixed
+    * support for #$0b8
+
+  Revision 1.16  1999/08/27 10:41:46  pierre
     * pi_is_global was missing for global methods
     + code to restore overloaded list order
       (necessary to get same CRC values after interface and after

+ 9 - 4
compiler/scanner.pas

@@ -1064,7 +1064,7 @@ implementation
         low,high,mid : longint;
         m       : longint;
         mac     : pmacrosym;
-        asciinr : string[3];
+        asciinr : string[6];
       label
          exit_label;
       begin
@@ -1436,7 +1436,7 @@ implementation
                            begin
                               readchar; { read leading $ }
                               asciinr:='$';
-                              while (upcase(c) in ['A'..'F','0'..'9']) and (length(asciinr)<3) do
+                              while (upcase(c) in ['A'..'F','0'..'9']) and (length(asciinr)<6) do
                                begin
                                  asciinr:=asciinr+c;
                                  readchar;
@@ -1445,7 +1445,7 @@ implementation
                          else
                            begin
                               asciinr:='';
-                              while (c in ['0'..'9']) and (length(asciinr)<3) do
+                              while (c in ['0'..'9']) and (length(asciinr)<6) do
                                begin
                                  asciinr:=asciinr+c;
                                  readchar;
@@ -1697,7 +1697,12 @@ begin
 end.
 {
   $Log$
-  Revision 1.92  1999-08-06 13:11:44  michael
+  Revision 1.93  1999-08-30 10:17:58  peter
+    * fixed crash in psub
+    * ansistringcompare fixed
+    * support for #$0b8
+
+  Revision 1.92  1999/08/06 13:11:44  michael
   * Removed C style comments.
 
   Revision 1.91  1999/08/05 16:53:11  peter