Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Jan 6, 2025
1 parent 3fc4ab9 commit 3d97088
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vlib/v/gen/c/cgen.v
Original file line number Diff line number Diff line change
Expand Up @@ -2713,9 +2713,9 @@ fn (mut g Gen) call_cfn_for_casting_expr(fname string, expr ast.Expr, exp_is_ptr
// Note: the `_to_sumtype_` family of functions do call memdup internally, making
// another duplicate with the HEAP macro is redundant, so use ADDR instead:
if expr.is_as_cast() {
if got_is_ptr && expr is ast.SelectorExpr {
if !got_is_ptr && expr is ast.SelectorExpr {
// (var as Type).field_non_ptr
// g.write('&')
g.write('&')
}
old_inside_smartcast := g.inside_smartcast
g.inside_smartcast = true
Expand Down

0 comments on commit 3d97088

Please sign in to comment.