Skip to content

Commit

Permalink
smt2: abits needs to be at least 1 for BitVec
Browse files Browse the repository at this point in the history
BitVecs need a minimum length of 1; we zero-fill any extra bits in the
extend_u0() calls which works perfectly.
  • Loading branch information
kivikakk authored and Asherah Connor committed Jun 13, 2023
1 parent 8b2a001 commit c9d31c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backends/smt2/smt2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ struct Smt2Worker
int arrayid = idcounter++;
memarrays[mem] = arrayid;

int abits = ceil_log2(mem->size);
int abits = max(1, ceil_log2(mem->size));

bool has_sync_wr = false;
bool has_async_wr = false;
Expand Down Expand Up @@ -1220,7 +1220,7 @@ struct Smt2Worker
{
int arrayid = memarrays.at(mem);

int abits = ceil_log2(mem->size);;
int abits = max(1, ceil_log2(mem->size));

bool has_sync_wr = false;
bool has_async_wr = false;
Expand Down

0 comments on commit c9d31c3

Please sign in to comment.