This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Crash during preprocessing


Tested on i686-linux, committed on trunk

When using the integrated preprocessor (for example through the use of
the -gnateD command line switch), style checks must be disabled to prevent
incorrect accesses to the Source_File_Index_Table. Specifically, some
checks are performed at end of line during the Scan phase of the compiler
(line ending convention, line length...), and these checks rely on
Get_Source_File_Index for the Source_Ptr value at the end of line. This
in turns requires that the Source_File_Index_Table have been set up for
the file being scanned, which is not the case when that file is being
preprocessed (because in that case the table is set up only after the
preprocessing phase). This change disables the style checks during
preprocessing to avoid the unwanted access.

The declaration of an empty package with a 5000 character long comment line
as the first line must be accepted quietly with the following command:

$ gcc -c -gnateDADACORE -gnatyM32000 empty_pkg_long_first_comment.ads

2007-12-13  Thomas Quinot  <quinot@adacore.com>

	* sinput-l.adb (Load_File): Disable style checks when preprocessing.

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]