byacc/skeleton.c.diff
2008-07-14 10:45:25 +00:00

26 lines
785 B
Diff

===================================================================
RCS file: /usr/OpenBSD/cvs/src/usr.bin/yacc/skeleton.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- src/usr.bin/yacc/skeleton.c 2007/09/03 21:14:58 1.28
+++ src/usr.bin/yacc/skeleton.c 2008/07/08 15:06:50 1.29
@@ -63,4 +63,5 @@
"#endif",
"#include <stdlib.h>",
+ "#include <string.h>",
"#define YYBYACC 1",
"#define YYMAJOR 1",
@@ -346,7 +347,10 @@
" YYPREFIX, yystate, yyn, yyrule[yyn]);",
"#endif",
" yym = yylen[yyn];",
- " yyval = yyvsp[1-yym];",
+ " if (yym)",
+ " yyval = yyvsp[1-yym];",
+ " else",
+ " memset(&yyval, 0, sizeof yyval);",
" switch (yyn)",
" {",
0