[fpc-devel]Compiler hangs on invalid exports clause

Jeff Pohlmeyer yetanothergeek at yahoo.com
Wed Apr 2 13:01:22 CEST 2003


Free Pascal Compiler version 1.0.7
Compiler Date  : 2003/04/01
Compiler Target: i386
Linux 2.4.0-4GB #1 Wed Jan 24 15:55:09 GMT 2001 i686 unknown


The compiler hangs on this one:

[CODE]

    program freeze;

    procedure something;
    begin
    end;

    exports something; // can't export from a program!

    begin
    end.

[/CODE]


The compiler gets caught in the repeat...until loop of 
read_declarations() in pdecl.pas 
 - it never consumes the "exports" token :

[PATCH]

--- pdecl.old	Tue Jan  7 13:21:53 2003
+++ pdecl.new	Wed Apr  2 04:22:38 2003
@@ -1325,7 +1325,13 @@
                         consume_all_until(_SEMICOLON);
                      end
                    else if islibrary or (target_info.target=target_i386_WIN32) then
-                     read_exports;
+                     read_exports
+                   else
+                     begin
+                        Message(parser_w_unsupported_feature);
+                        Message2(scan_f_syn_expected, 'BEGIN', 'EXPORTS');
+                        consume(_EXPORTS);
+                     end;
                 end
               else break;
            end;

[/PATCH]


__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com



More information about the fpc-devel mailing list