Only synth when the R-value is valid

This commit is contained in:
Cary R 2025-06-30 16:24:23 -07:00
parent 46a5078a68
commit a05da1ca08
1 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998-2024 Stephen Williams (steve@icarus.com)
* Copyright (c) 1998-2025 Stephen Williams (steve@icarus.com)
* Copyright CERN 2013 / Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
@ -265,6 +265,7 @@ NetNet *elaborate_unpacked_array(Design *des, NetScope *scope, const LineInfo &l
return nullptr;
} else if (dynamic_cast<PEAssignPattern*> (expr)) {
auto net_expr = elaborate_rval_expr(des, scope, lval->array_type(), expr);
if (! net_expr) return nullptr;
expr_net = net_expr->synthesize(des, scope, net_expr);
} else {
cout << loc.get_fileline() << ": error: Can not assign"