[GIT] ppl/ppl(master): Avoid excessive and dangerous reliance on the C++ operator precedence rules .

Module: ppl/ppl Branch: master Commit: 571c07fd424a775127467eecfc527c420c98ea2d URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=571c07fd424a7...
Author: Roberto Bagnara bagnara@cs.unipr.it Date: Tue Oct 18 14:26:06 2011 +0200
Avoid excessive and dangerous reliance on the C++ operator precedence rules. Detected by ECLAIR service exprprns.
---
src/Grid.inlines.hh | 16 ++++++++-------- src/Linear_Expression.cc | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/Grid.inlines.hh b/src/Grid.inlines.hh index b04657c..006ba2f 100644 --- a/src/Grid.inlines.hh +++ b/src/Grid.inlines.hh @@ -187,10 +187,10 @@ inline Grid::Grid(const BD_Shape<U>& bd, Complexity_Class) : con_sys((bd.space_dimension() > max_space_dimension()) - ? throw_space_dimension_overflow("Grid(bd)", - "the space dimension of bd " - "exceeds the maximum allowed " - "space dimension"), 0 + ? (throw_space_dimension_overflow("Grid(bd)", + "the space dimension of bd " + "exceeds the maximum allowed " + "space dimension"), 0) : bd.space_dimension()), gen_sys(bd.space_dimension()) { Congruence_System cgs = bd.congruences(); @@ -202,10 +202,10 @@ inline Grid::Grid(const Octagonal_Shape<U>& os, Complexity_Class) : con_sys((os.space_dimension() > max_space_dimension()) - ? throw_space_dimension_overflow("Grid(os)", - "the space dimension of os " - "exceeds the maximum allowed " - "space dimension"), 0 + ? (throw_space_dimension_overflow("Grid(os)", + "the space dimension of os " + "exceeds the maximum allowed " + "space dimension"), 0) : os.space_dimension()), gen_sys(os.space_dimension()) { Congruence_System cgs = os.congruences(); diff --git a/src/Linear_Expression.cc b/src/Linear_Expression.cc index d7c997c..f586ac4 100644 --- a/src/Linear_Expression.cc +++ b/src/Linear_Expression.cc @@ -86,7 +86,7 @@ PPL::Linear_Expression::Linear_Expression(const Variable v) "Linear_Expression(v):\n" "v exceeds the maximum allowed " "space dimension."), - v.space_dimension() + 1), + (v.space_dimension() + 1)), Linear_Row::Flags()) { ++((*this)[v.space_dimension()]); }
participants (1)
-
Roberto Bagnara