Skip to content

Commit 1d6640f

Browse files
committed
Small fixes in abstract_environmentt
Avoid shadowing member variable, make single-arg constructor explicit
1 parent ad5764c commit 1d6640f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/analyses/variable-sensitivity/abstract_environment.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ abstract_environmentt::eval(const exprt &expr, const namespacet &ns) const
6666

6767
// No special handling required by the abstract environment
6868
// delegate to the abstract object
69-
if(simplified_expr.operands().size() > 0)
69+
if(!simplified_expr.operands().empty())
7070
{
7171
return eval_expression(simplified_expr, ns);
7272
}
@@ -146,7 +146,7 @@ bool abstract_environmentt::assign(
146146
// to be none of that.
147147
if(s.id() != ID_symbol)
148148
{
149-
throw "invalid l-value";
149+
throw std::runtime_error("invalid l-value");
150150
}
151151
// We can assign the AO directly to the symbol
152152
final_value = value;
@@ -252,11 +252,11 @@ abstract_object_pointert abstract_environmentt::abstract_object_factory(
252252
const typet &type,
253253
const namespacet &ns,
254254
bool top,
255-
bool bottom) const
255+
bool bttm) const
256256
{
257257
exprt empty_constant_expr = nil_exprt();
258258
return abstract_object_factory(
259-
type, top, bottom, empty_constant_expr, *this, ns);
259+
type, top, bttm, empty_constant_expr, *this, ns);
260260
}
261261

262262
abstract_object_pointert abstract_environmentt::abstract_object_factory(
@@ -270,13 +270,13 @@ abstract_object_pointert abstract_environmentt::abstract_object_factory(
270270
abstract_object_pointert abstract_environmentt::abstract_object_factory(
271271
const typet &type,
272272
bool top,
273-
bool bottom,
273+
bool bttm,
274274
const exprt &e,
275275
const abstract_environmentt &environment,
276276
const namespacet &ns) const
277277
{
278278
return object_factory->get_abstract_object(
279-
type, top, bottom, e, environment, ns);
279+
type, top, bttm, e, environment, ns);
280280
}
281281

282282
abstract_object_pointert abstract_environmentt::add_object_context(

src/analyses/variable-sensitivity/abstract_environment.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ class abstract_environmentt
3939

4040
abstract_environmentt() = delete;
4141

42-
abstract_environmentt(
42+
explicit abstract_environmentt(
4343
variable_sensitivity_object_factory_ptrt _object_factory)
44-
: bottom(true), object_factory(_object_factory)
44+
: bottom(true), object_factory(std::move(_object_factory))
4545
{
4646
}
4747

0 commit comments

Comments
 (0)