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

cgen: fix -autofree with arr[idx] or { default } (#17096)

This commit is contained in:
walking devel 2023-01-23 22:53:26 +00:00 committed by GitHub
parent 16e2ade9ff
commit 8b6fceb0a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -314,7 +314,7 @@ fn (mut g Gen) index_of_array(node ast.IndexExpr, sym ast.TypeSymbol) {
g.write('))') g.write('))')
} }
} }
if needs_clone { if !gen_or && needs_clone {
g.write(')') g.write(')')
} }
if gen_or { if gen_or {