Skip to content

Commit 13bfdb3

Browse files
author
Daniel Kroening
committed
allow empty bit-vector if
1 parent 3069c77 commit 13bfdb3

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

regression/cbmc/Empty_struct1/main.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#include <assert.h>
2+
3+
struct empty
4+
{
5+
};
6+
7+
int main()
8+
{
9+
struct empty e1, e2, e3;
10+
_Bool b, c=b;
11+
e1=e2;
12+
if(b)
13+
e3=e2;
14+
15+
assert(b==c);
16+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
main.c
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
7+
--
8+
^warning: ignoring

src/solvers/flattening/boolbv_if.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ bvt boolbvt::convert_if(const if_exprt &expr)
2525
std::size_t width=boolbv_width(expr.type());
2626

2727
if(width==0)
28-
return conversion_failed(expr);
28+
return bvt(); // An empty bit-vector if.
2929

3030
literalt cond=convert(expr.cond());
3131

0 commit comments

Comments
 (0)