allow empty bit-vector if

This commit is contained in:
Daniel Kroening 2016-10-31 16:34:00 +00:00
parent 3069c771cb
commit 13bfdb30d9
3 changed files with 25 additions and 1 deletions

View File

@ -0,0 +1,16 @@
#include <assert.h>
struct empty
{
};
int main()
{
struct empty e1, e2, e3;
_Bool b, c=b;
e1=e2;
if(b)
e3=e2;
assert(b==c);
}

View File

@ -0,0 +1,8 @@
CORE
main.c
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
^warning: ignoring

View File

@ -25,7 +25,7 @@ bvt boolbvt::convert_if(const if_exprt &expr)
std::size_t width=boolbv_width(expr.type());
if(width==0)
return conversion_failed(expr);
return bvt(); // An empty bit-vector if.
literalt cond=convert(expr.cond());