http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1011
------- Comment #5 from wmeier@xxxxxxxxxxx 2007-02-02 03:24 GMT -------
From http://www.sqlite.org/cvstrac/tktview?tn=2172
2007-Jan-16 21:51:21 by anonymous:
This is just a guess, but the reported bug might be the result of an error
in the grammar in epan/dfilter/grammar.lemon . In that file, the non-terminal
sentence (which is the start non-terminal) is declared as having a type and a
destructor, but the productions for sentence do not create any value.
Consequently, without the memset, the associated value of the non-terminal will
be garbage, which might well cause havoc when the destructor is called in
yy_accept.
lemon checks to make sure that a labeled lhs is assigned to, but does not
check that an unlabeled lhs does not have a destructor; consequently, errors of
that form are not flagged. It would be easy enough to generate an error
message. For example, at around line 3277, along with the check to make sure
lhsalias's are used, a check could be added for !rp->lhsalias &&
has_destructor( rp->lhs, lemp). It would also be good to check that either all
or no productions for a non-terminal are labeled; I'll attach a patch a bit
later on if I can come up with a good one and nobody gets there before me.
-- Rici
2007-Jan-17 16:19:58 by anonymous:
The patch (not tested very vigorously) is at
¤http://primero.ricilake.net/lemon/lemon.checklhs.patch
It correctly picks up the error in wireshark/epan/dfilter/grammar.lemon:
wsgrammar.lemon:124: Rule does not generate a value, but non-terminal
sentence
wsgrammar.lemon:124: has a destructor
wsgrammar.lemon:125: Rule does not generate a value, but non-terminal
sentence
wsgrammar.lemon:125: has a destructor
--
Configure bugmail: http://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.