Index: CHANGES =================================================================== RCS file: /home/cvsroot/ice/CHANGES,v retrieving revision 1.172 diff -r1.172 CHANGES 8a9,15 > - Fixed the slice2cpp compiler for operations with > multiple exceptions in an exception specification: > if an exception was a base of one or more other exceptions > in the same exception specification, the code generator > sometimes emitted the catch blocks in the marshaling and dispatch > code in the wrong order. > Index: include/Slice/Parser.h =================================================================== RCS file: /home/cvsroot/ice/include/Slice/Parser.h,v retrieving revision 1.81 diff -r1.81 Parser.h 87a88 > class DerivedToBaseCompare; 144a146,157 > // DerivedToBaseCompare -- function object to do sort exceptions into > // most-derived to least-derived order. > // ---------------------------------------------------------------------- > > class DerivedToBaseCompare : public std::binary_function > { > public: > > bool operator()(const ExceptionPtr&, const ExceptionPtr&) const; > }; > > // ---------------------------------------------------------------------- 614a628 > virtual bool isBaseOf(const ExceptionPtr&) const; Index: src/Slice/Parser.cpp =================================================================== RCS file: /home/cvsroot/ice/src/Slice/Parser.cpp,v retrieving revision 1.137 diff -r1.137 Parser.cpp 2815a2816,2833 > Slice::Exception::isBaseOf(const ExceptionPtr& other) const > { > if(this->scoped() == other->scoped()) > { > return false; > } > ExceptionList bases = other->allBases(); > for(ExceptionList::const_iterator i = bases.begin(); i != bases.end(); ++i) > { > if((*i)->scoped() == scoped()) > { > return true; > } > } > return false; > } > > bool 4655a4674,4683 > }; > > // ---------------------------------------------------------------------- > // DerivedToBaseCompare > // ---------------------------------------------------------------------- > > bool > Slice::DerivedToBaseCompare::operator()(const ExceptionPtr& e1, const ExceptionPtr& e2) const > { > return e2->isBaseOf(e1); Index: src/slice2cpp/Gen.cpp =================================================================== RCS file: /home/cvsroot/ice/src/slice2cpp/Gen.cpp,v retrieving revision 1.210 diff -r1.210 Gen.cpp 3,4c3,4 < // Copyright (c) 2003 < // ZeroC, Inc. --- > // copyright (c) 2003 > // zeroc, inc. 2359a2360,2368 > > // > // Arrange exceptions into most-derived to least-derived order. If we don't > // do this, a base exception handler can appear before a derived exception > // handler, causing compiler warnings and resulting in the base exception > // being marshaled instead of the derived exception. > // > throws.sort(Slice::DerivedToBaseCompare()); > 3546a3556,3563 > // > // Arrange exceptions into most-derived to least-derived order. If we don't > // do this, a base exception handler can appear before a derived exception > // handler, causing compiler warnings and resulting in the base exception > // being marshaled instead of the derived exception. > // > throws.sort(Slice::DerivedToBaseCompare()); > Index: src/slice2java/Gen.cpp =================================================================== RCS file: /home/cvsroot/ice/src/slice2java/Gen.cpp,v retrieving revision 1.135 diff -r1.135 Gen.cpp 481a482,489 > // > // Arrange exceptions into most-derived to least-derived order. If we don't > // do this, a base exception handler can appear before a derived exception > // handler, causing compiler warnings and resulting in the base exception > // being marshaled instead of the derived exception. > // > throws.sort(Slice::DerivedToBaseCompare()); > 3026a3035,3042 > > // > // Arrange exceptions into most-derived to least-derived order. If we don't > // do this, a base exception handler can appear before a derived exception > // handler, causing compiler warnings and resulting in the base exception > // being marshaled instead of the derived exception. > // > throws.sort(Slice::DerivedToBaseCompare());