Skip to content

Simplifier 20160305 #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jun 21, 2016
Prev Previous commit
simplify/byte_extract bugfixes
  • Loading branch information
tautschnig committed Jun 21, 2016
commit e9ffa30eabb27de8b3ff9721a468562c3d8716ea
10 changes: 6 additions & 4 deletions src/util/simplify_expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1676,7 +1676,11 @@ exprt simplify_exprt::bits2expr(
return constant_exprt(tmp, type);
}
else if(type.id()==ID_c_enum)
return constant_exprt(bits, type);
{
exprt val=bits2expr(bits, type.subtype(), little_endian);
val.type()=type;
return val;
}
else if(type.id()==ID_c_enum_tag)
return
bits2expr(
Expand Down Expand Up @@ -1925,10 +1929,8 @@ bool simplify_exprt::simplify_byte_extract(byte_extract_exprt &expr)

// no proper simplification for expr.type()==void
// or types of unknown size
if(expr.type().id()==ID_empty ||
el_size<0)
if(el_size<=0)
return true;
assert(el_size>0);

if(expr.op().id()==ID_array_of &&
expr.op().op0().id()==ID_constant)
Expand Down