Fix constants bound to single bit arguments (fixes #2383)
This commit is contained in:
@@ -3337,6 +3337,14 @@ skip_dynamic_range_lvalue_expansion:;
|
||||
wire->type = AST_LOCALPARAM;
|
||||
wire->attributes.erase(ID::nosync);
|
||||
wire->children.insert(wire->children.begin(), arg->clone());
|
||||
// args without a range implicitly have width 1
|
||||
if (wire->children.back()->type != AST_RANGE) {
|
||||
AstNode* range = new AstNode();
|
||||
range->type = AST_RANGE;
|
||||
wire->children.push_back(range);
|
||||
range->children.push_back(mkconst_int(0, true));
|
||||
range->children.push_back(mkconst_int(0, true));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
AstNode *wire_id = new AstNode(AST_IDENTIFIER);
|
||||
|
||||
Reference in New Issue
Block a user