cgen: fix -autofree

pull/4776/head
Alexander Medvednikov 2020-05-07 17:51:30 +02:00
parent 3c6e090ae3
commit ef387779bf
1 changed files with 2 additions and 2 deletions

View File

@ -1054,7 +1054,7 @@ fn (mut g Gen) autofree_scope_vars(pos int) string {
fn (g &Gen) autofree_variable(v ast.Var) string {
sym := g.table.get_type_symbol(v.typ)
// if v.name.contains('output2') {
eprintln(' > var name: ${v.name:-20s} | is_arg: ${v.is_arg.str():6} | var type: ${int(v.typ):8} | type_name: ${sym.name:-33s}')
// eprintln(' > var name: ${v.name:-20s} | is_arg: ${v.is_arg.str():6} | var type: ${int(v.typ):8} | type_name: ${sym.name:-33s}')
// }
if sym.kind == .array {
return g.autofree_var_call('array_free', v)
@ -1069,7 +1069,7 @@ fn (g &Gen) autofree_variable(v ast.Var) string {
else {
// NOTE/TODO: assign_stmt multi returns variables have no expr
// since the type comes from the called fns return type
// return '// other ' + t + '\n'
return '// other ' + t + '\n'
}
}
return g.autofree_var_call('string_free', v)