mirror of https://github.com/YosysHQ/yosys.git
Fixed AstNode::mkconst_bits() segfault on zero-sized constant
This commit is contained in:
parent
e2e092b144
commit
1b8cb9940e
|
@ -699,7 +699,7 @@ AstNode *AstNode::mkconst_bits(const std::vector<RTLIL::State> &v, bool is_signe
|
|||
for (size_t i = 0; i < 32; i++) {
|
||||
if (i < node->bits.size())
|
||||
node->integer |= (node->bits[i] == RTLIL::S1) << i;
|
||||
else if (is_signed)
|
||||
else if (is_signed && !node->bits.empty())
|
||||
node->integer |= (node->bits.back() == RTLIL::S1) << i;
|
||||
}
|
||||
node->range_valid = true;
|
||||
|
|
Loading…
Reference in New Issue