Hi,
yacc will produce a y.tab.c file when it is fed input with bad
syntax. Maybe this is expected behaviour but is it better for
yacc to clean up after itself? When I feed the same badsyntax.y
to bison 3.0.4 it doesn't create y.tab.c.
yacc creates y.tab.c very early. Unlink the file in
done() if it's heading for exit with non-zero status?
As a result y.tab.c is removed for other errors, such as
no_space() which means out of memory.
- Michael
Index: main.c
===================================================================
RCS file: /cvs/src/usr.bin/yacc/main.c,v
retrieving revision 1.28
diff -u -p -u -r1.28 main.c
--- main.c 27 Jul 2016 20:53:47 -0000 1.28
+++ main.c 16 Apr 2017 09:29:03 -0000
@@ -109,6 +109,8 @@ volatile sig_atomic_t sigdie;
void
done(int k)
{
+ if (k != 0)
+ unlink(output_file_name);
if (action_file)
unlink(action_file_name);
if (text_file)