diff options
author | Benoit Foucher <benoit@zeroc.com> | 2015-02-20 15:48:50 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2015-02-20 15:48:50 +0100 |
commit | 6912a3e2c742e0243130d989f558131f0c73b54e (patch) | |
tree | 708610eaf0d52e0d35fde0661a4ded595efe424a /cpp/src/Slice | |
parent | build fix (diff) | |
download | ice-6912a3e2c742e0243130d989f558131f0c73b54e.tar.bz2 ice-6912a3e2c742e0243130d989f558131f0c73b54e.tar.xz ice-6912a3e2c742e0243130d989f558131f0c73b54e.zip |
Additional fix for ICE-6268, fixed struct un-marshalling to not re-create the struct
Diffstat (limited to 'cpp/src/Slice')
-rw-r--r-- | cpp/src/Slice/CsUtil.cpp | 4 | ||||
-rw-r--r-- | cpp/src/Slice/ObjCUtil.cpp | 21 |
2 files changed, 19 insertions, 6 deletions
diff --git a/cpp/src/Slice/CsUtil.cpp b/cpp/src/Slice/CsUtil.cpp index be424b7b67b..c72137ae53c 100644 --- a/cpp/src/Slice/CsUtil.cpp +++ b/cpp/src/Slice/CsUtil.cpp @@ -643,8 +643,8 @@ Slice::CsGenerator::writeMarshalUnmarshalCode(Output &out, { if(!isValueType(st)) { - const string read = streamingAPI ? "ice_readNew" : "readNew__"; - out << nl << param << " = " << typeToString(type) << "." << read << "(" << stream << ");"; + const string r = streamingAPI ? "ice_read" : "read__"; + out << nl << param << " = " << typeToString(type) << "." << r << "(" << stream << ", " << param << ");"; } else { diff --git a/cpp/src/Slice/ObjCUtil.cpp b/cpp/src/Slice/ObjCUtil.cpp index e449ea87539..77a2d627ece 100644 --- a/cpp/src/Slice/ObjCUtil.cpp +++ b/cpp/src/Slice/ObjCUtil.cpp @@ -848,13 +848,27 @@ Slice::ObjCGenerator::writeMarshalUnmarshalCode(Output &out, const TypePtr& type } else { - if(autoreleased) + if(StructPtr::dynamicCast(type)) { - out << nl << param << " = [" << name << " read:" << stream << "];"; + if(autoreleased) + { + out << nl << param << " = [" << name << " read:" << stream << " value:" << param << "];"; + } + else + { + out << nl << param << " = [" << name << " readRetained:" << stream << " value:" << param << "];"; + } } else { - out << nl << param << " = [" << name << " readRetained:" << stream << "];"; + if(autoreleased) + { + out << nl << param << " = [" << name << " read:" << stream << "];"; + } + else + { + out << nl << param << " = [" << name << " readRetained:" << stream << "];"; + } } } } @@ -1294,4 +1308,3 @@ Slice::ObjCGenerator::MetaDataVisitor::modulePrefixError(const ModulePtr& m, con os << " as `" << mp.name << "'" << endl; emitWarning(file, line, os.str()); } - |