mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-21 21:33:40 +00:00
Index struct/union members within corresponding wire chunks
This guards against access to bits outside of struct/union members via dynamic indexing.
This commit is contained in:
parent
79043cb849
commit
0d3423ddea
5 changed files with 68 additions and 32 deletions
|
@ -524,7 +524,13 @@ void AstNode::dumpVlog(FILE *f, std::string indent) const
|
|||
break;
|
||||
|
||||
case AST_IDENTIFIER:
|
||||
fprintf(f, "%s", id2vl(str).c_str());
|
||||
{
|
||||
AST::AstNode *member_node = AST::get_struct_member(this);
|
||||
if (member_node)
|
||||
fprintf(f, "%s[%d:%d]", id2vl(str).c_str(), member_node->range_left, member_node->range_right);
|
||||
else
|
||||
fprintf(f, "%s", id2vl(str).c_str());
|
||||
}
|
||||
for (auto child : children)
|
||||
child->dumpVlog(f, "");
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue