1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

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

This commit is contained in:
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

View File

@ -465,7 +465,7 @@ fn (mut g Gen) method_call(node ast.CallExpr) {
node.from_embed_type == 0 {
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.
fn_name := node.name.replace('.', '_')
arg_name := '_arg_expr_${fn_name}_0_$node.pos.pos'