From: John Millaway Date: Sun, 15 Sep 2002 16:47:31 +0000 (+0000) Subject: Initialization of reject vars and %array vars in reentrant scanner. X-Git-Tag: flex-2-5-20~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aad9f1cd9dcc07a6a923e4bae6cc72d2d0fdecf7;p=flex Initialization of reject vars and %array vars in reentrant scanner. --- diff --git a/flex.skl b/flex.skl index 4c31008..8b51bb0 100644 --- a/flex.skl +++ b/flex.skl @@ -1957,6 +1957,19 @@ static int yy_init_globals YYFARGS0(void) YY_G(yy_start_stack_depth) = 0; YY_G(yy_start_stack) = (int *) 0; +#ifdef YY_USES_REJECT + YY_G(yy_state_buf) = 0; + YY_G(yy_state_ptr) = 0; + YY_G(yy_full_match) = 0; + YY_G(yy_lp) = 0; +#endif + +#ifdef YY_TEXT_IS_ARRAY + YY_G(yytext_ptr) = 0; + YY_G(yy_more_offset) = 0; + YY_G(yy_prev_more_offset) = 0; +#endif + /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; @@ -1991,11 +2004,14 @@ int yylex_init( ptr_yy_globals ) } *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); + if (*ptr_yy_globals == NULL){ errno = ENOMEM; return 1; } + memset(*ptr_yy_globals,0,sizeof(struct yyguts_t)); + return yy_init_globals ( *ptr_yy_globals ); }