[PPL-devel] [GIT] ppl/ppl(master): Do not use the same object to play different roles in the same method call .

Enea Zaffanella zaffanella at cs.unipr.it
Fri Apr 3 16:34:01 CEST 2009


Module: ppl/ppl
Branch: master
Commit: e00dfb7f0c56a757e19168e83f5535050e42271e
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=e00dfb7f0c56a757e19168e83f5535050e42271e

Author: Enea Zaffanella <zaffanella at cs.unipr.it>
Date:   Fri Apr  3 16:28:37 2009 +0200

Do not use the same object to play different roles in the same method call.
In calls to methods Box::difference_assign and Box::concatenate_assign
we were binding the very same Box object both to the (modifiable) implicit
argument *this and to the (const) explicit argument y.

---

 tests/Box/ascii_dump_load1.cc |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/tests/Box/ascii_dump_load1.cc b/tests/Box/ascii_dump_load1.cc
index a210688..301010a 100644
--- a/tests/Box/ascii_dump_load1.cc
+++ b/tests/Box/ascii_dump_load1.cc
@@ -204,13 +204,15 @@ test06() {
 
   print_constraints(box1, "*** box1(cs) ***");
 
-  box1.difference_assign(box1);
+  TBox box1_copy(box1);
 
-  print_constraints(box1, "*** box1.difference_assign(box1) ***");
+  box1.difference_assign(box1_copy);
 
-  box1.concatenate_assign(box1);
+  print_constraints(box1, "*** box1.difference_assign(box1_copy) ***");
 
-  print_constraints(box1, "*** box1.concatenate_assign(box1) ***");
+  box1.concatenate_assign(box1_copy);
+
+  print_constraints(box1, "*** box1.concatenate_assign(box1_copy) ***");
 
   nout << "box1.space_dimension() = " << box1.space_dimension() << endl;
 




More information about the PPL-devel mailing list