]> granicus.if.org Git - flex/commitdiff
Initialization of reject vars and %array vars in reentrant scanner.
authorJohn Millaway <john43@users.sourceforge.net>
Sun, 15 Sep 2002 16:47:31 +0000 (16:47 +0000)
committerJohn Millaway <john43@users.sourceforge.net>
Sun, 15 Sep 2002 16:47:31 +0000 (16:47 +0000)
flex.skl

index 4c31008657f7f429ebe6953eb9c32f0aa54ce5f4..8b51bb032e372018e2b3a1c4720dbcda62999814 100644 (file)
--- 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 );
     }