diff --git a/elab_expr.cc b/elab_expr.cc index 73fa40048..bbd8d0c08 100644 --- a/elab_expr.cc +++ b/elab_expr.cc @@ -4979,7 +4979,15 @@ NetExpr* PEIdent::elaborate_expr_(Design*des, NetScope*scope, expr, {}); } - ivl_assert(*this, sr.path_tail.empty()); + if (! sr.path_tail.empty()) { + cerr << get_fileline() << ": error: Variable " + << sr.path_head + << " does not have a field named: " + << sr.path_tail << "." << endl; + des->errors += 1; + return 0; + } + NetExpr*tmp = elaborate_expr_net(des, scope, sr.net, sr.scope, expr_wid, flags); diff --git a/ivtest/gold/br_gh1173.gold b/ivtest/gold/br_gh1173.gold new file mode 100644 index 000000000..dee9651d3 --- /dev/null +++ b/ivtest/gold/br_gh1173.gold @@ -0,0 +1,3 @@ +./ivltests/br_gh1173.v:9: error: Variable id_3 does not have a field named: id_2. +./ivltests/br_gh1173.v:9: error: Unable to elaborate r-value: id_3.id_2 +2 error(s) during elaboration. diff --git a/ivtest/ivltests/br_gh1173.v b/ivtest/ivltests/br_gh1173.v new file mode 100644 index 000000000..de7dcc3ef --- /dev/null +++ b/ivtest/ivltests/br_gh1173.v @@ -0,0 +1,10 @@ +module module_0 ( + id_2, + id_3, + id_18, +); + inout id_18; + input id_3; + inout id_2; + assign id_18 = id_3.id_2; +endmodule diff --git a/ivtest/regress-vlg.list b/ivtest/regress-vlg.list index c8861ab1a..e0886094c 100644 --- a/ivtest/regress-vlg.list +++ b/ivtest/regress-vlg.list @@ -356,6 +356,7 @@ br_gh889 normal,-gspecify ivltests gold=br_gh889.gold br_gh956a CE ivltests gold=br_gh956a.gold br_gh956b CE ivltests gold=br_gh956b.gold br_gh1117 CE ivltests gold=br_gh1117.gold +br_gh1173 CE ivltests gold=br_gh1173.gold br_gh1175a CE ivltests gold=br_gh1175a.gold br_gh1175b CE ivltests gold=br_gh1175b.gold br_gh1175c CE ivltests gold=br_gh1175c.gold