diff options
author | Brad King <brad.king@kitware.com> | 2008-04-21 15:15:56 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-04-21 15:15:56 (GMT) |
commit | 52898fe9250aaa16904640874852c45bfc4c325b (patch) | |
tree | 33eaa264d38846f3cf75bd8122c4967483f1bc52 /Source/cmDependsFortranLexer.h | |
parent | fd0690fcebc2c7a0e50a51bce62f4774900b9f07 (diff) | |
download | CMake-52898fe9250aaa16904640874852c45bfc4c325b.zip CMake-52898fe9250aaa16904640874852c45bfc4c325b.tar.gz CMake-52898fe9250aaa16904640874852c45bfc4c325b.tar.bz2 |
BUG: Fix Fortran dependency parser preprocessor handling crash.
- Do not crash if a #elseif occurs out of order
- Recognize preprocessor directives only at the beginning of lines.
- See issue #6855
Diffstat (limited to 'Source/cmDependsFortranLexer.h')
-rw-r--r-- | Source/cmDependsFortranLexer.h | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/Source/cmDependsFortranLexer.h b/Source/cmDependsFortranLexer.h index f73f946..bebc522 100644 --- a/Source/cmDependsFortranLexer.h +++ b/Source/cmDependsFortranLexer.h @@ -9,8 +9,8 @@ Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ @@ -25,7 +25,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 33 +#define YY_FLEX_SUBMINOR_VERSION 34 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -47,7 +47,7 @@ /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ -#if __STDC_VERSION__ >= 199901L +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. @@ -110,11 +110,12 @@ typedef unsigned int flex_uint32_t; #else /* ! __cplusplus */ -#if __STDC__ +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) #define YY_USE_CONST -#endif /* __STDC__ */ +#endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST @@ -140,7 +141,10 @@ typedef void* yyscan_t; #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) #define yy_flex_debug yyg->yy_flex_debug_r -int cmDependsFortran_yylex_init (yyscan_t* scanner); +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#define YY_BUF_SIZE 16384 +#endif #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE @@ -150,11 +154,13 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). + * Given that the standard has decreed that size_t exists since 1989, + * I guess we can afford to depend on it. Manoj. */ #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T -typedef unsigned int yy_size_t; +typedef size_t yy_size_t; #endif #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -244,6 +250,10 @@ void cmDependsFortran_yyfree (void * ,yyscan_t yyscanner ); #define YY_EXTRA_TYPE void * #endif +int cmDependsFortran_yylex_init (yyscan_t* scanner); + +int cmDependsFortran_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); + /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ |