* catch EOSError, EIOError and IOutOfMemory exceptions inside the compiler

so a proper error message is written (resolves #19871), 
  EOutOfMemory is not handle perfectly because it could be that the exception
  handling requires again a memory allocation

git-svn-id: trunk@18132 -
This commit is contained in:
florian 2011-08-07 09:18:07 +00:00
parent 28126cf0d5
commit 562961fd42
5 changed files with 611 additions and 573 deletions

View File

@ -107,20 +107,21 @@ type
{ Special file for bug report }
reportbugfile : text;
end;
type
EControlCAbort=class(Exception)
constructor Create;
end;
ECompilerAbort=class(Exception)
constructor Create;
end;
ECompilerAbortSilent=class(Exception)
constructor Create;
end;
var
status : tcompilerstatus;
type
EControlCAbort=class(Exception)
constructor Create;
end;
ECompilerAbort=class(Exception)
constructor Create;
end;
ECompilerAbortSilent=class(Exception)
constructor Create;
end;
{ Default Functions }
Function def_status:boolean;
Function def_comment(Level:Longint;const s:ansistring):boolean;

View File

@ -281,7 +281,6 @@ begin
end;
DoneVerbose;
except
on EControlCAbort do
begin
try
@ -312,6 +311,36 @@ begin
begin
DoneVerbose;
end;
on EOutOfMemory do
begin
try
Message(general_f_no_memory_left);
except
on ECompilerAbort do
;
end;
DoneVerbose;
end;
on e : EInOutError do
begin
try
Message1(general_f_ioerror,e.message);
except
on ECompilerAbort do
;
end;
DoneVerbose;
end;
on e : EOSError do
begin
try
Message1(general_f_oserror,e.message);
except
on ECompilerAbort do
;
end;
DoneVerbose;
end;
on Exception do
begin
{ General catchall, normally not used }

View File

@ -124,6 +124,10 @@ general_i_number_of_hints=01022_I_$1 hint(s) issued
% Total number of hints issued during compilation.
general_i_number_of_notes=01023_I_$1 note(s) issued
% Total number of notes issued during compilation.
general_f_ioerror=01024_F_I/O error: $1
% During compilation an I/O error happened which allows no further compilation.
general_f_oserror=01025_F_Operating system error: $1
% During compilation an operanting system error happened which allows no further compilation.
% \end{description}
#
# Scanner

View File

@ -23,6 +23,8 @@ const
general_i_number_of_warnings=01021;
general_i_number_of_hints=01022;
general_i_number_of_notes=01023;
general_f_ioerror=01024;
general_f_oserror=01025;
scan_f_end_of_file=02000;
scan_f_string_exceeds_line=02001;
scan_f_illegal_char=02002;
@ -895,9 +897,9 @@ const
option_info=11024;
option_help_pages=11025;
MsgTxtSize = 60714;
MsgTxtSize = 60771;
MsgIdxMax : array[1..20] of longint=(
24,89,311,103,85,54,111,23,202,63,
26,89,311,103,85,54,111,23,202,63,
49,20,1,1,1,1,1,1,1,1
);

File diff suppressed because it is too large Load Diff