smt2: Fix operation width computation for boolean producing cells

The output width for the boolean value should not influence the
operation width. The previous incorrect width extension would still
produce correct results, but could produce invalid smt2 output for
reduction operators when the output width was larger than the width of
the vector to which the reduction was applied.

This fixes #3654
This commit is contained in:
Jannis Harder 2023-02-01 12:34:35 +01:00
parent 541fdffff2
commit 5e82638408
1 changed files with 4 additions and 1 deletions

View File

@ -462,7 +462,10 @@ struct Smt2Worker
int width = GetSize(sig_y);
if (type == 's' || type == 'S' || type == 'd' || type == 'b') {
width = max(width, GetSize(cell->getPort(ID::A)));
if (type == 'b')
width = GetSize(cell->getPort(ID::A));
else
width = max(width, GetSize(cell->getPort(ID::A)));
if (cell->hasPort(ID::B))
width = max(width, GetSize(cell->getPort(ID::B)));
}