Skip to content

Commit 3d4fc4e

Browse files
committed
Catch by const-reference
Reported by Semmle's LGTM (https://lgtm.com/projects/g/diffblue/cbmc/alerts/?mode=list).
1 parent aeae851 commit 3d4fc4e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/goto-programs/printf_formatter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void printf_formattert::print(std::ostream &out)
4747
while(!eol()) process_char(out);
4848
}
4949

50-
catch(eol_exceptiont)
50+
catch(const eol_exceptiont &)
5151
{
5252
}
5353
}

src/solvers/sat/satcheck_minisat2.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ void satcheck_minisat2_baset<T>::lcnf(const bvt &bv)
142142

143143
clause_counter++;
144144
}
145-
catch(Minisat::OutOfMemoryException)
145+
catch(const Minisat::OutOfMemoryException &)
146146
{
147147
messaget::error() << "SAT checker ran out of memory" << eom;
148148
status = statust::ERROR;
@@ -264,7 +264,7 @@ propt::resultt satcheck_minisat2_baset<T>::prop_solve()
264264
status=statust::UNSAT;
265265
return resultt::P_UNSATISFIABLE;
266266
}
267-
catch(Minisat::OutOfMemoryException)
267+
catch(const Minisat::OutOfMemoryException &)
268268
{
269269
messaget::error() <<
270270
"SAT checker ran out of memory" << eom;
@@ -288,7 +288,7 @@ void satcheck_minisat2_baset<T>::set_assignment(literalt a, bool value)
288288
value ^= sign;
289289
solver->model[v] = Minisat::lbool(value);
290290
}
291-
catch(Minisat::OutOfMemoryException)
291+
catch(const Minisat::OutOfMemoryException &)
292292
{
293293
messaget::error() << "SAT checker ran out of memory" << eom;
294294
status = statust::ERROR;
@@ -359,7 +359,7 @@ void satcheck_minisat_simplifiert::set_frozen(literalt a)
359359
solver->setFrozen(a.var_no(), true);
360360
}
361361
}
362-
catch(Minisat::OutOfMemoryException)
362+
catch(const Minisat::OutOfMemoryException &)
363363
{
364364
messaget::error() << "SAT checker ran out of memory" << eom;
365365
status = statust::ERROR;

0 commit comments

Comments
 (0)