Fix assertion failure on assignment to part of variable member (GitHub issue #226)

For now, output a "sorry" message, as the compiler doesn't support this.

(cherry picked from commit dc5429e5e7)
This commit is contained in:
Martin Whitaker 2019-01-26 17:36:19 +00:00
parent 37b98bbe67
commit 41c6a0e0fe
1 changed files with 6 additions and 1 deletions

View File

@ -1201,7 +1201,12 @@ bool PEIdent::elaborate_lval_net_packed_member_(Design*des, NetScope*scope,
if (!name_tail.index.empty())
use_sel = name_tail.index.back().sel;
ivl_assert(*this, use_sel == index_component_t::SEL_NONE || use_sel == index_component_t::SEL_BIT);
if (use_sel != index_component_t::SEL_NONE && use_sel != index_component_t::SEL_BIT) {
cerr << get_fileline() << ": sorry: Assignments to part selects of "
"a struct member are not yet supported." << endl;
des->errors += 1;
return false;
}
if (! name_tail.index.empty()) {