cgen: fix autofree_variable() (fix #14576) (#14602)

yuyi 2022-06-03 22:41:30 +08:00 committed by Chewing_Bever
parent 9699afc1fd
commit 3d6d120d4c
Signed by: Jef Roosens
GPG Key ID: B75D4F293C7052DB
1 changed files with 4 additions and 0 deletions

View File

@ -2679,6 +2679,10 @@ fn (mut g Gen) autofree_scope_vars2(scope &ast.Scope, start_pos int, end_pos int
}
fn (mut g Gen) autofree_variable(v ast.Var) {
// filter out invalid variables
if v.typ == 0 {
return
}
sym := g.table.sym(v.typ)
// if v.name.contains('output2') {
if g.is_autofree {