eval_tree: Properly support struct fields in get_array_info

Fixes #1032

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
Sylvain Munaut 2023-11-15 21:14:24 +01:00
parent 37eba70ca4
commit 8ca387d6de
1 changed files with 7 additions and 0 deletions

View File

@ -2176,6 +2176,13 @@ static bool get_array_info(const NetExpr*arg, long dim,
left = param->expr_width() - 1;
right = 0;
return false;
}
if (const NetESelect*select = dynamic_cast<const NetESelect*>(arg)) {
const netranges_t&dim_vals = select->net_type()->slice_dimensions();
const netrange_t&range = dim_vals[dim-1];
left = range.get_msb();
right = range.get_lsb();
return false;
}
/* The argument must be a signal that has enough dimensions. */
const NetESignal*esig = dynamic_cast<const NetESignal*>(arg);