Skip to content

Commit

Permalink
fix option_ok args
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi98 committed Jan 13, 2025
1 parent 389616c commit 5a4dee7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vlib/v/gen/c/cgen.v
Original file line number Diff line number Diff line change
Expand Up @@ -6721,7 +6721,7 @@ fn (mut g Gen) gen_or_block_stmts(cvar_name string, cast_typ string, stmts []ast
} else if g.inside_opt_or_res && return_is_option && g.inside_assign {
g.write('_option_ok(&(${cast_typ}[]) { ')
g.expr_with_cast(expr_stmt.expr, expr_stmt.typ, return_type.clear_option_and_result())
g.writeln(' }, (${g.styp(return_type)}*)${cvar_name}.data, sizeof(${cast_typ}));')
g.writeln(' }, (${g.styp(return_type)}*)(&${cvar_name}.data), sizeof(${cast_typ}));')
g.indent--
return
} else {
Expand Down

0 comments on commit 5a4dee7

Please sign in to comment.