summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/CPlusPlusUtil.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2001-12-04 20:30:06 +0000
committerMarc Laukien <marc@zeroc.com>2001-12-04 20:30:06 +0000
commit334da51dea36fa4c6b66cb7a1150d98cdfed3139 (patch)
tree42e3bc76f013ca4f1c414b86fd24500f342cc385 /cpp/src/Slice/CPlusPlusUtil.cpp
parentUpdated slice2freeze & freeze demo. (diff)
downloadice-334da51dea36fa4c6b66cb7a1150d98cdfed3139.tar.bz2
ice-334da51dea36fa4c6b66cb7a1150d98cdfed3139.tar.xz
ice-334da51dea36fa4c6b66cb7a1150d98cdfed3139.zip
fixed marshaling bug for Ice::Object
Diffstat (limited to 'cpp/src/Slice/CPlusPlusUtil.cpp')
-rw-r--r--cpp/src/Slice/CPlusPlusUtil.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/cpp/src/Slice/CPlusPlusUtil.cpp b/cpp/src/Slice/CPlusPlusUtil.cpp
index 3ca1969af42..fd7652d5727 100644
--- a/cpp/src/Slice/CPlusPlusUtil.cpp
+++ b/cpp/src/Slice/CPlusPlusUtil.cpp
@@ -291,10 +291,25 @@ Slice::writeMarshalUnmarshalCode(Output& out, const TypePtr& type, const string&
string func = marshal ? "write(" : "read(";
- if (BuiltinPtr::dynamicCast(type))
+ BuiltinPtr builtin = BuiltinPtr::dynamicCast(type);
+ if (builtin)
{
- out << nl << stream << deref << func << param << ");";
- return;
+ if (builtin->kind() == Builtin::KindObject)
+ {
+ if (marshal)
+ {
+ out << nl << stream << deref << func << param << ");";
+ }
+ else
+ {
+ out << nl << stream << deref << func << "::Ice::Object::__classIds[0], " << param << ")";
+ }
+ }
+ else
+ {
+ out << nl << stream << deref << func << param << ");";
+ return;
+ }
}
ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type);
@@ -319,7 +334,8 @@ Slice::writeMarshalUnmarshalCode(Output& out, const TypePtr& type, const string&
out << nl << "else";
out << sb;
out << nl << param << " = new " << cl->scoped() << ';';
- out << nl << param << "->__" << func << stream << ");";
+ out << nl << obj << " = " << param << ';';
+ out << nl << stream << deref << func << obj << ");";
out << eb;
}
else