[fpc-devel] Issue #32913 - Internal Error 200309201

J. Gareth Moreton gareth at moreton-family.com
Sun May 20 17:48:28 CEST 2018


 Hi everyone,
 So I've been taking a look at the issue listed in bug ticket #32913, where
a try...finally block inside the except part of a try...except block either
produces bad assembly language or raises Internal Error 200309201.  So
far, I'm still trying to understand the control flow of the compiler and
how the individual blocks are put together.
 What I've found so far, using the following code example:

 program undefined_symbol_bug;

 uses SysUtils;

 procedure p;
    begin
       try
         {a}
       except
         on e: Exception do
           try
             {b}
           finally
             {c}
           end;
       end;
    end;

 begin
   p;
 end.

 {a}, {b} and {c} are replaced with simple WriteLn or Exit commands, or
left blank.

 - If {a} is empty and {b} is not empty, then Internal Error 200309201 is
raised. Value of {c} doesn't matter, and the error doesn't happen if the
'try...finally' block is removed. Error still occurs if the "on e:
Exception do" line is removed.
 - If {a} is not empty, then the program normally compiles whether or not
{b} or {c} is empty, except in one circumstance...
 - If {b} contains "Exit", then the assembly produced is missing a label
and fails to link.

 So the presence of "Exit" in {b} causes bad code generation, while an
internal error occurs if {a} is empty, but {b} isn't.  I'm still
investigating and wish to fix these problems, but if anyone is able to
offer any insight if not stumble upon the solution yourself, I'll be most
grateful.

 Gareth aka. Kit
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20180520/0603f24d/attachment.html>


More information about the fpc-devel mailing list