help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Different behaviour with string and number tokens ?


From: Hans Aberg
Subject: Re: Different behaviour with string and number tokens ?
Date: Tue, 18 Apr 2006 15:47:42 +0200

Tis does not work in the case of syntax input errors, though, because then the action is not executed. So then a way forward is to use % destructor, somehow. You might want creating a new Help-Bison thread about cleanups, to get the attention of some of the experts on this.


On 18 Apr 2006, at 15:02, Arno Wilhelm wrote:

Hello,

But I get a memory leak even when I free the the in the bison file like this: WORD EQUAL WORD { $$ = !strncmp( $1, $3, 128 ); free ( yylval.str ); }

have found out how to avoid the memory leak myself and thought I would post it here
in case somebody runs into the same issue.

One has to free the variables like this:

WORD EQUAL WORD { $$ = !strcmp( $1, $3 ); free($1); free($3); }



regards,
arno





reply via email to

[Prev in Thread] Current Thread [Next in Thread]