Re: bison and valgrind
- From: "Chris Uppal" <chris.uppal@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: 29 Mar 2007 09:31:55 GMT
Rob Thorpe wrote:
The normal way of using bison is to use it to produce a parse tree.
You write code in the actions that builds up a tree out of nodes, you
only need one or two different types of node. In the actions all that
happens is memory allocation. Then the parser completes and passes
the parse-tree to the next compiler pass. Cleanup is only done after
the parser has completed.
Worth checking what happens if the parser detects a syntax error. I
suspect that the parser (i.e. the Bison input) should probably have
semantic cleanup actions for such errors, or temporary data allocated
before the error was detected may be leaked. (NB: I haven't tested
that, it's just a guess based on my memory of Yacc from years gone by).
Apart from such cases, I'd imagine that Bison-generated parsers are
naturally leak-free, assuming the the programmer (the Bison user) has
taken normal care.
-- chris
.
- Follow-Ups:
- Re: bison and valgrind
- From: Alex Fraser
- Re: bison and valgrind
- From: Rob Thorpe
- Re: bison and valgrind
- From: Chris Dollin
- Re: bison and valgrind
- References:
- bison and valgrind
- From: Allan Adler
- Re: bison and valgrind
- From: Rob Thorpe
- bison and valgrind
- Prev by Date: Re: bison and valgrind
- Next by Date: Re: bison and valgrind
- Previous by thread: Re: bison and valgrind
- Next by thread: Re: bison and valgrind
- Index(es):