Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Sep 30, 2023
1 parent 413da8b commit b3dc7b2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions vlib/v/gen/c/cgen.v
Original file line number Diff line number Diff line change
Expand Up @@ -1803,10 +1803,9 @@ fn (mut g Gen) stmts_with_tmp_var(stmts []ast.Stmt, tmp_var string) bool {
g.expr(stmt.expr)
g.writeln(';')
} else {
ret_typ := g.fn_decl.return_type.clear_flag(.option)
styp = g.base_type(ret_typ)
styp = g.typ(stmt.typ)
g.write('_option_ok(&(${styp}[]) { ')
g.expr_with_cast(stmt.expr, stmt.typ, ret_typ)
g.expr_with_cast(stmt.expr, stmt.typ, stmt.typ.set_flag(.option))
g.writeln(' }, (${c.option_name}*)(&${tmp_var}), sizeof(${styp}));')
}
}
Expand Down

0 comments on commit b3dc7b2

Please sign in to comment.