Fix access to whole sub-structs (#3086)
[yosys.git] / frontends / ast / genrtlil.cc
index 4c25287add25425182ccbafb7dbdb68878d72a78..020b4e5e893dadd39e24d07b498b7c4b66e0de35 100644 (file)
@@ -877,7 +877,7 @@ void AstNode::detectSignWidthWorker(int &width_hint, bool &sign_hint, bool *foun
                        this_width = id_ast->children[0]->range_left - id_ast->children[0]->range_right + 1;
                        if (children.size() > 1)
                                range = children[1];
-               } else if (id_ast->type == AST_STRUCT_ITEM) {
+               } else if (id_ast->type == AST_STRUCT_ITEM || id_ast->type == AST_STRUCT) {
                        AstNode *tmp_range = make_struct_member_range(this, id_ast);
                        this_width = tmp_range->range_left - tmp_range->range_right + 1;
                        delete tmp_range;