cgen: fix small g.is_autofree && [manualfree] problem

pull/7975/head
Delyan Angelov 2021-01-08 23:24:26 +02:00
parent 29c2240aef
commit dff36a9947
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 1 additions and 1 deletions

View File

@ -465,7 +465,7 @@ fn (mut g Gen) method_call(node ast.CallExpr) {
node.from_embed_type == 0 { node.from_embed_type == 0 {
g.write('/*rec*/*') g.write('/*rec*/*')
} }
if node.free_receiver && !g.inside_lambda && !g.is_builtin_mod { if g.is_autofree && node.free_receiver && !g.inside_lambda && !g.is_builtin_mod {
// The receiver expression needs to be freed, use the temp var. // The receiver expression needs to be freed, use the temp var.
fn_name := node.name.replace('.', '_') fn_name := node.name.replace('.', '_')
arg_name := '_arg_expr_${fn_name}_0_$node.pos.pos' arg_name := '_arg_expr_${fn_name}_0_$node.pos.pos'