From aac81f8bfe8298aa0839bb2d7c70ea75149cdffb Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 30 Jul 2014 13:34:17 +0200 Subject: [PATCH] Bug 733856 - segfault in QGListIterator while parsing fortran code Problem with variables with the name type versus type definitions. type followed by = is recognized as not being a type definition instead of the use of a variable. --- src/fortrancode.l | 2 ++ src/fortranscanner.l | 1 + 2 files changed, 3 insertions(+) diff --git a/src/fortrancode.l b/src/fortrancode.l index e6cfddeb031..03baeede29c 100644 --- a/src/fortrancode.l +++ b/src/fortrancode.l @@ -1128,6 +1128,8 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I } YY_FTN_RESET } +<*>^{BS}"type"{BS}"=" { g_code->codify(yytext); } + <*>. { g_code->codify(yytext); } diff --git a/src/fortranscanner.l b/src/fortranscanner.l index 449b05d2dd7..1f52110a604 100644 --- a/src/fortranscanner.l +++ b/src/fortranscanner.l @@ -739,6 +739,7 @@ private { {ID} { } ^{BS}"type"{BS_}"is"/{BS_} { } +^{BS}"type"{BS}"=" { } } { {COMMA} {}