[fpc-devel] Patch: Exception handling without SysUtils

Yury Sidorov jura at ce.blagovest.com
Thu Jul 7 15:51:56 CEST 2005


Hello,

I found that try...except and try...finally do not work if SysUtils unit is
not used (exception handling code is not called).
The following patch fixes this issue.


Index: system.inc
===================================================================
--- system.inc (revision 594)
+++ system.inc (working copy)
@@ -674,7 +674,10 @@
 Procedure HandleErrorAddrFrame (Errno : longint;addr,frame : 
Pointer);[public,alias:'FPC_BREAK_ERROR'];
 begin
   If pointer(ErrorProc)<>Nil then
-    ErrorProc(Errno,addr,frame);
+    ErrorProc(Errno,addr,frame)
+  else
+    if frame <> nil then
+      raise TObject(nil) at addr,frame;
   errorcode:=word(Errno);
   erroraddr:=addr;
   errorbase:=frame;


By the way, messages with attachment are not posted to mailing list. Is it 
ok?

Yury Sidorov, jura at ce.blagovest.com






More information about the fpc-devel mailing list