When is

后端 未结 2 1217
遥遥无期
遥遥无期 2021-01-05 20:45

When is %destructor invoked in BISON? I have the following bison code:

%union{
    char * sval; 
    Variable * vval; 
} 

%token VARIABLE 
%token L         


        
2条回答
  •  情话喂你
    2021-01-05 21:02

    I figured out, that I should free() it after I perform the action, so for example

    ...
    | String CONCAT String { $$ = concat($1,$3); free($1); free($3); }
    ...
    

    That did the trick for me.

提交回复
热议问题