diff options
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | parser.h | 1 | ||||
-rw-r--r-- | parser.l | 5 | ||||
-rw-r--r-- | txr.c | 2 |
4 files changed, 18 insertions, 1 deletions
@@ -1,5 +1,16 @@ 2011-10-26 Kaz Kylheku <kaz@kylheku.com> + Bugfix: prepared_error_message variable needs to be gc-protected. + + * parser.h (parse_init): Declared. + + * parser.l (parse_init): New function. + + * txr.c (main): Call parse_init. + (txr_main): No need to gc-protect yyin_stream since parse_init does it. + +2011-10-26 Kaz Kylheku <kaz@kylheku.com> + Parse error handling improvements. * parser.l (prepared_error_message): New static variable. @@ -37,3 +37,4 @@ void yyerrorf(val s, ...); void yybadtoken(int tok, val context); void end_of_regex(void); int yylex(void); +void parse_init(void); @@ -589,3 +589,8 @@ void end_of_regex(void) || yy_top_state() == QSILIT) yy_pop_state(); } + +void parse_init(void) +{ + protect(&yyin_stream, &prepared_error_message, (val *) 0); +} @@ -146,6 +146,7 @@ int main(int argc, char **argv) progname = argv[0] ? utf8_dup_from(argv[0]) : progname; init(progname, oom_realloc_handler, &stack_bottom); match_init(); + parse_init(); return txr_main(argc, argv); } @@ -159,7 +160,6 @@ int txr_main(int argc, char **argv) prot1(&spec_file_str); yyin_stream = std_input; - prot1(&yyin_stream); if (argc <= 1) { hint(); |