void initialize_file(char*filename)
{
new_state();
- state->package = filename;
+ state->package = strdup(filename);
state->method = rfx_calloc(sizeof(methodstate_t));
state->method->variable_count = 1;
if(!state || state->level!=1) {
syntaxerror("unexpected end of file in pass %d", as3_pass);
}
+ free(state->package);state->package=0;
state_destroy(state);state=0;
}
}
startfunction(0,$1,$3,$4,&$6,$8);
endfunction(0,$1,$3,$4,&$6,$8, 0);
+ list_deep_free($6.list);
}
/* ------------ classes and interfaces (body, slots ) ------- */
FUNCTION_DECLARATION: MAYBE_MODIFIERS "function" GETSET T_IDENTIFIER '(' MAYBE_PARAM_LIST ')'
MAYBETYPE '{' {PASS12 startfunction(0,$1,$3,$4,&$6,$8);} MAYBECODE '}'
{
- PASS1 old_state();
+ PASS1 old_state();list_deep_free($6.list);
PASS2
if(!state->method->info) syntaxerror("internal error");
c = wrap_function(c, 0, $11);
endfunction(0,$1,$3,$4,&$6,$8,c);
+ list_deep_free($6.list);
$$=0;
}
INNERFUNCTION: "function" MAYBE_IDENTIFIER '(' MAYBE_PARAM_LIST ')' MAYBETYPE
'{' {PASS12 innerfunction($2,&$4,$6);} MAYBECODE '}'
{
- PASS1 old_state();
+ PASS1 old_state();list_deep_free($4.list);
PASS2
memberinfo_t*f = state->method->info;
if(!f) syntaxerror("internal error");
int index = state->method->var_index;
endfunction(0,0,0,$2,&$4,$6,c);
+ list_deep_free($4.list);
$$.c = abc_getlocal(0, index);
$$.t = TYPE_FUNCTION(f);