Skip to content

Commit 173c5cc

Browse files
author
Daniel Kroening
authored
Merge pull request #516 from diffblue/revert-438-support_ID_c_bool_in_exprt
Revert "direct support for ID_c_bool in exprt"
2 parents 382b80b + 3bde08e commit 173c5cc

File tree

1 file changed

+6
-20
lines changed

1 file changed

+6
-20
lines changed

src/util/expr.cpp

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -245,18 +245,9 @@ Function: exprt::is_true
245245

246246
bool exprt::is_true() const
247247
{
248-
if(is_constant())
249-
{
250-
if(type().id()==ID_bool)
251-
return get(ID_value)!=ID_false;
252-
else if(type().id()==ID_c_bool)
253-
{
254-
mp_integer i;
255-
to_integer(*this, i);
256-
return i!=mp_integer(0);
257-
}
258-
}
259-
return false;
248+
return is_constant() &&
249+
type().id()==ID_bool &&
250+
get(ID_value)!=ID_false;
260251
}
261252

262253
/*******************************************************************\
@@ -273,14 +264,9 @@ Function: exprt::is_false
273264

274265
bool exprt::is_false() const
275266
{
276-
if(is_constant())
277-
{
278-
if(type().id()==ID_bool)
279-
return get(ID_value)==ID_false;
280-
else if(type().id()==ID_c_bool)
281-
return !is_true();
282-
}
283-
return false;
267+
return is_constant() &&
268+
type().id()==ID_bool &&
269+
get(ID_value)==ID_false;
284270
}
285271

286272
/*******************************************************************\

0 commit comments

Comments
 (0)