diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2011-10-26 17:04:26 -0400 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2011-10-26 17:04:26 -0400 |
commit | 12c1371bbbb2d8e6f693b3d2e1e5a91c32c63520 (patch) | |
tree | e79422ac8ed142b127c42da1597f955d3e69ab94 | |
parent | ad46d49574ea8ada67d8644c70817502c8591305 (diff) | |
download | txr-12c1371bbbb2d8e6f693b3d2e1e5a91c32c63520.tar.gz txr-12c1371bbbb2d8e6f693b3d2e1e5a91c32c63520.tar.bz2 txr-12c1371bbbb2d8e6f693b3d2e1e5a91c32c63520.zip |
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.
-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(); |