Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Nov 18, 2024
1 parent 312c3b2 commit df252db
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions vlib/v/gen/c/assign.v
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,11 @@ fn (mut g Gen) assign_stmt(node_ ast.AssignStmt) {
unwrapped_val_type := g.unwrap_generic(val_type)
right_sym := g.table.sym(unwrapped_val_type)
unaliased_right_sym := g.table.final_sym(unwrapped_val_type)
is_fixed_array_var := !g.pref.translated && unaliased_right_sym.kind == .array_fixed && (
(val is ast.ArrayInit && val.has_tmp_var)
|| (val in [ast.Ident, ast.IndexExpr, ast.CallExpr, ast.SelectorExpr, ast.DumpExpr, ast.InfixExpr])
|| (val is ast.CastExpr && (val.expr !is ast.ArrayInit|| (val.expr is ast.ArrayInit && val.expr.has_tmp_var)))
is_fixed_array_var := !g.pref.translated && unaliased_right_sym.kind == .array_fixed
&& val !is ast.ArrayInit
&& (val in [ast.Ident, ast.IndexExpr, ast.CallExpr, ast.SelectorExpr, ast.DumpExpr, ast.InfixExpr]
|| (val is ast.CastExpr && (val.expr !is ast.ArrayInit
|| (val.expr is ast.ArrayInit && val.expr.has_tmp_var)))
|| (val is ast.PrefixExpr && val.op == .arrow)
|| (val is ast.UnsafeExpr && val.expr in [ast.SelectorExpr, ast.Ident]))
g.is_assign_lhs = true
Expand Down

0 comments on commit df252db

Please sign in to comment.