Skip to content

Commit c9d31c3

Browse files
charlottiaAsherah Connor
authored andcommitted
smt2: abits needs to be at least 1 for BitVec
BitVecs need a minimum length of 1; we zero-fill any extra bits in the extend_u0() calls which works perfectly.
1 parent 8b2a001 commit c9d31c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backends/smt2/smt2.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ struct Smt2Worker
773773
int arrayid = idcounter++;
774774
memarrays[mem] = arrayid;
775775

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

778778
bool has_sync_wr = false;
779779
bool has_async_wr = false;
@@ -1220,7 +1220,7 @@ struct Smt2Worker
12201220
{
12211221
int arrayid = memarrays.at(mem);
12221222

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

12251225
bool has_sync_wr = false;
12261226
bool has_async_wr = false;

0 commit comments

Comments
 (0)