]> git.saurik.com Git - bison.git/commit - ChangeLog
named references: fix double free.
authorAkim Demaille <demaille@gostai.com>
Wed, 2 Mar 2011 16:06:58 +0000 (17:06 +0100)
committerAkim Demaille <demaille@gostai.com>
Wed, 9 Mar 2011 20:04:17 +0000 (21:04 +0100)
commit8f462efe923947cc4e72deea5b0fa93a5f88000d
tree099cfd251d6d026415b42caeba4a61f0b545b291
parent686e83e396696572171fad32f440cc279ab82a75
named references: fix double free.

In `rhs[name]: "a" | "b"', do not free "name" twice.
Reported by Tys Lefering.
<http://lists.gnu.org/archive/html/bug-bison/2010-06/msg00002.html>

* src/named-ref.h, src/named-ref.c (named_ref_copy): New.
* src/parse-gram.y (current_lhs): Rename as...
(current_lhs_symbol): this.
(current_lhs): New function.  Use it to free the current lhs
named reference.
* src/reader.c: Bind lhs to a copy of the current named reference.
* src/symlist.c: Rely on free (0) being valid.
* tests/named-refs.at: Test this.
ChangeLog
THANKS
src/named-ref.c
src/named-ref.h
src/parse-gram.y
src/reader.c
src/symlist.c
tests/named-refs.at