From 26cbe4a4e56c0b95483b7568914d0402ef955b72 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sat, 25 Oct 2014 18:23:53 +0200 Subject: Fixed constant "cond ? string1 : string2" with strings of different size --- frontends/ast/ast.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'frontends/ast') diff --git a/frontends/ast/ast.cc b/frontends/ast/ast.cc index 7a7bd303..56ea64ef 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; } -- cgit v1.2.3