Fixed constant "cond ? string1 : string2" with strings of different size

This commit is contained in:
Clifford Wolf 2014-10-25 18:23:53 +02:00
parent c5eb5e56b8
commit 26cbe4a4e5
1 changed files with 2 additions and 0 deletions

View File

@ -706,6 +706,8 @@ AstNode *AstNode::mkconst_bits(const std::vector<RTLIL::State> &v, bool is_signe
AstNode *AstNode::mkconst_str(const std::vector<RTLIL::State> &v) AstNode *AstNode::mkconst_str(const std::vector<RTLIL::State> &v)
{ {
AstNode *node = mkconst_str(RTLIL::Const(v).decode_string()); AstNode *node = mkconst_str(RTLIL::Const(v).decode_string());
while (GetSize(node->bits) < GetSize(v))
node->bits.push_back(RTLIL::State::S0);
log_assert(node->bits == v); log_assert(node->bits == v);
return node; return node;
} }