Skip to content

Commit 4e4d470

Browse files
authored
cgen: fix autofree with option array (fix #25124) (#25149)
1 parent 83385a8 commit 4e4d470

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

vlib/v/gen/c/autofree.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ fn (mut g Gen) autofree_variable(v ast.Var) {
133133
// eprintln(' > var name: ${v.name:-20s} | is_arg: ${v.is_arg.str():6} | var type: ${int(v.typ):8} | type_name: ${sym.name:-33s}')
134134
}
135135
// }
136-
free_fn := g.styp(v.typ.set_nr_muls(0)) + '_free'
136+
free_fn := g.styp(v.typ.set_nr_muls(0).clear_option_and_result()) + '_free'
137137
if sym.kind == .array {
138138
if sym.has_method('free') {
139139
g.autofree_var_call(free_fn, v)

0 commit comments

Comments
 (0)