mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-07-24 10:00:32 +00:00
flex: don't trust YY_USER_INIT
Reported by Bernd Edligner and others. * src/scan-gram.l: here.
This commit is contained in:
@@ -16,6 +16,7 @@ Art Haas [email protected]
|
|||||||
Baron Schwartz [email protected]
|
Baron Schwartz [email protected]
|
||||||
Ben Pfaff [email protected]
|
Ben Pfaff [email protected]
|
||||||
Benoit Perrot [email protected]
|
Benoit Perrot [email protected]
|
||||||
|
Bernd Edligner [email protected]
|
||||||
Bernd Kiefer [email protected]
|
Bernd Kiefer [email protected]
|
||||||
Bert Deknuydt [email protected]
|
Bert Deknuydt [email protected]
|
||||||
Bill Allombert [email protected]
|
Bill Allombert [email protected]
|
||||||
|
|||||||
+9
-3
@@ -45,9 +45,6 @@
|
|||||||
|
|
||||||
#define YY_DECL GRAM_LEX_DECL
|
#define YY_DECL GRAM_LEX_DECL
|
||||||
|
|
||||||
#define YY_USER_INIT \
|
|
||||||
code_start = scanner_cursor = loc->start; \
|
|
||||||
|
|
||||||
/* Location of scanner cursor. */
|
/* Location of scanner cursor. */
|
||||||
static boundary scanner_cursor;
|
static boundary scanner_cursor;
|
||||||
|
|
||||||
@@ -166,6 +163,15 @@ eqopt ([[:space:]]*=)?
|
|||||||
/* Where containing comment or string or character literal started,
|
/* Where containing comment or string or character literal started,
|
||||||
when applicable. */
|
when applicable. */
|
||||||
boundary token_start PACIFY_CC (= scanner_cursor);
|
boundary token_start PACIFY_CC (= scanner_cursor);
|
||||||
|
|
||||||
|
/* We cannot trust YY_USER_INIT, whose semantics changes over time
|
||||||
|
(it moved in Flex 2.5.38). */
|
||||||
|
static bool first = true;
|
||||||
|
if (first)
|
||||||
|
{
|
||||||
|
scanner_cursor = loc->start;
|
||||||
|
first = false;
|
||||||
|
}
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user