From: Clifford Wolf Date: Sat, 25 Oct 2014 16:23:53 +0000 (+0200) Subject: Fixed constant "cond ? string1 : string2" with strings of different size X-Git-Tag: yosys-0.4~22 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=26cbe4a4e56c0b95483b7568914d0402ef955b72;p=yosys.git Fixed constant "cond ? string1 : string2" with strings of different size --- diff --git a/frontends/ast/ast.cc b/frontends/ast/ast.cc index 7a7bd3038..56ea64eff 100644 --- a/frontends/ast/ast.cc +++ b/frontends/ast/ast.cc @@ -706,6 +706,8 @@ AstNode *AstNode::mkconst_bits(const std::vector &v, bool is_signe AstNode *AstNode::mkconst_str(const std::vector &v) { 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); return node; }