Forráskód Böngészése

Use general_e_exception_raised if Compiler generates an uncaught exception

git-svn-id: trunk@31801 -
pierre 10 éve
szülő
commit
7e348a40a3
3 módosított fájl, 16 hozzáadás és 5 törlés
  1. 7 1
      compiler/compiler.pas
  2. 1 0
      compiler/globals.pas
  3. 8 4
      compiler/parser.pas

+ 7 - 1
compiler/compiler.pas

@@ -370,7 +370,13 @@ begin
           { in case of 50 errors, this could cause another exception,
             suppress this exception
           }
-          Message(general_f_compilation_aborted);
+          if not exception_raised then
+            begin
+              exception_raised:=true;
+              Message(general_e_exception_raised);
+            end
+          else
+            Message(general_f_compilation_aborted);
         except
           on ECompilerAbort do
             ;

+ 1 - 0
compiler/globals.pas

@@ -303,6 +303,7 @@ interface
        nwcopyright  : string;
 
        codegenerror : boolean;           { true if there is an error reported }
+       exception_raised : boolean;           { true if there is an exception reported }
 
        block_type : tblock_type;         { type of currently parsed block }
 

+ 8 - 4
compiler/parser.pas

@@ -394,10 +394,14 @@ implementation
                raise;
              on Exception do
                begin
-                 { Increase errorcounter to prevent some
-                   checks during cleanup,
-                   but use GenerateError procedure for this. }
-                 GenerateError;
+                 { Generate exception_raised message,
+                   but avoid multiple messages by
+                   guarding with exception_raised global variable }
+                 if not exception_raised then
+                   begin
+                     exception_raised:=true;
+                     Message(general_e_exception_raised);
+                   end;
                  raise;
                end;
            end;