bin/140309: bad syntax cause yacc segfault

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <freebsd-gnats-submit@...>
Date: Thursday, November 5, 2009 - 8:46 am

>Number: 140309

FreeBSD shen.philpep.org 9.0-CURRENT FreeBSD 9.0-CURRENT #0: Wed Nov 4 19:56:02 CET 2009 root@shen.philpep.org:/usr/src/sys/i386/compile/SHEN i386
Sometimes yacc segfault when declare typed rule and you don't set a value to $$ in the grammar rule.

The expected behavior of yacc in this case is to print an error message like
"the value of typed rule hasn't been set".

Here's backtrace :

#0 0x08053811 in end_rule () at /usr/src/usr.bin/yacc/reader.c:1260
1260 if (pitem[i+1] == 0 || pitem[i+1]->tag != plhs[nrules]->tag)

#0 0x08053811 in end_rule () at /usr/src/usr.bin/yacc/reader.c:1260
#1 0x0805486d in read_grammar () at /usr/src/usr.bin/yacc/reader.c:1632
#2 0x08055591 in reader () at /usr/src/usr.bin/yacc/reader.c:1926
#3 0x0804c4b4 in main (argc=2, argv=0xbfbfeb48) at /usr/src/usr.bin/yacc/main.c:434

Just yacc this file :

%type rule
%%
rule:
;
%%

$ yacc file.y
segmentation fault (core dumped) /usr/bin/yacc

>Release-Note:

_______________________________________________
freebsd-bugs@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscribe@freebsd.org"

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
bin/140309: bad syntax cause yacc segfault, Philippe Pepiot, (Thu Nov 5, 8:46 am)