summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/slice/Ice/Communicator.ice3
-rw-r--r--cpp/src/Ice/BasicStream.cpp11
2 files changed, 8 insertions, 6 deletions
diff --git a/cpp/slice/Ice/Communicator.ice b/cpp/slice/Ice/Communicator.ice
index f4c07ade4ad..1a6bf69b81d 100644
--- a/cpp/slice/Ice/Communicator.ice
+++ b/cpp/slice/Ice/Communicator.ice
@@ -180,8 +180,7 @@ local interface Communicator
* either because no factory was found, or because all factories
* returned nil, the object is sliced to the next most-derived type
* and the process repeats. If no factory is found that can create an
- * instance, the Ice run-time will slice the object to the type
- * Ice::Object.</para>
+ * instance, the Ice run-time throws [NoObjectFactoryException].</para>
*
* <para>The following order is used to locate a factory for a type:
*
diff --git a/cpp/src/Ice/BasicStream.cpp b/cpp/src/Ice/BasicStream.cpp
index 112b492dc62..ac5d470f146 100644
--- a/cpp/src/Ice/BasicStream.cpp
+++ b/cpp/src/Ice/BasicStream.cpp
@@ -1514,18 +1514,20 @@ IceInternal::BasicStream::read(PatchFunc patchFunc, void* patchAddr)
}
assert(index > 0);
+ string mostDerivedId;
+ readTypeId(mostDerivedId);
+ string id = mostDerivedId;
while(true)
{
- string id;
- readTypeId(id);
-
//
// If we slice all the way down to Ice::Object, we throw
// because Ice::Object is abstract.
//
if(id == Ice::Object::ice_staticId())
{
- throw NoObjectFactoryException(__FILE__, __LINE__, "class sliced to ::Ice::Object, which is abstract", id);
+ throw NoObjectFactoryException(__FILE__, __LINE__,
+ "class sliced to ::Ice::Object, which is abstract",
+ mostDerivedId);
}
//
@@ -1581,6 +1583,7 @@ IceInternal::BasicStream::read(PatchFunc patchFunc, void* patchAddr)
traceSlicing("class", id, _slicingCat, _instance->logger());
}
skipSlice(); // Slice off this derived part -- we don't understand it.
+ readTypeId(id); // Read next id for next iteration.
continue;
}
else