Skip to content

Commit

Permalink
fix ast ternary string extension
Browse files Browse the repository at this point in the history
  • Loading branch information
Khrig committed Apr 4, 2024
1 parent 22c5ab9 commit 15b3dfd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frontends/ast/simplify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4268,7 +4268,7 @@ replace_fcall_later:;
newNode->realvalue = choice->asReal(sign_hint);
} else {
RTLIL::Const y = choice->bitsAsConst(width_hint, sign_hint);
if (choice->is_string && y.bits.size() % 8 == 0 && sign_hint == false)
if (choice->is_string && y.bits.size() % 8 == 0 && sign_hint == false && choice->bits.size() == y.bits.size())
newNode = mkconst_str(y.bits);
else
newNode = mkconst_bits(y.bits, sign_hint);
Expand Down

0 comments on commit 15b3dfd

Please sign in to comment.