diff options
Diffstat (limited to 'cpp/src/Ice/BasicStream.cpp')
-rw-r--r-- | cpp/src/Ice/BasicStream.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/cpp/src/Ice/BasicStream.cpp b/cpp/src/Ice/BasicStream.cpp index 9d9424f254c..112b492dc62 100644 --- a/cpp/src/Ice/BasicStream.cpp +++ b/cpp/src/Ice/BasicStream.cpp @@ -1519,6 +1519,15 @@ IceInternal::BasicStream::read(PatchFunc patchFunc, void* patchAddr) 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); + } + // // Try to find a factory registered for the specific type. // @@ -1542,17 +1551,6 @@ IceInternal::BasicStream::read(PatchFunc patchFunc, void* patchAddr) } // - // There isn't a static factory for Ice::Object, so check for - // that case now. We do this *after* the factory inquiries - // above so that a factory could be registered for - // "::Ice::Object". - // - if(!v && id == Ice::Object::ice_staticId()) - { - v = new ::Ice::Object; - } - - // // Last chance: check the table of static factories (i.e., // automatically generated factories for concrete classes). // |