diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2006-01-24 13:48:54 +0000 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2006-01-24 13:48:54 +0000 |
commit | a694ab56f31b91775fa39443105d342da6d805d4 (patch) | |
tree | d9a1d9a7f396ef25ac413446183a4874f9ee8fb8 /cpp/src/Slice/CPlusPlusUtil.cpp | |
parent | merging changes from R3_0_branch (diff) | |
download | ice-a694ab56f31b91775fa39443105d342da6d805d4.tar.bz2 ice-a694ab56f31b91775fa39443105d342da6d805d4.tar.xz ice-a694ab56f31b91775fa39443105d342da6d805d4.zip |
Fixed bug 821. zero length seq size write failure
Diffstat (limited to 'cpp/src/Slice/CPlusPlusUtil.cpp')
-rw-r--r-- | cpp/src/Slice/CPlusPlusUtil.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cpp/src/Slice/CPlusPlusUtil.cpp b/cpp/src/Slice/CPlusPlusUtil.cpp index 9892dcdad80..0b437c0e5b1 100644 --- a/cpp/src/Slice/CPlusPlusUtil.cpp +++ b/cpp/src/Slice/CPlusPlusUtil.cpp @@ -509,9 +509,16 @@ Slice::writeMarshalUnmarshalCode(Output& out, const TypePtr& type, const string& } else { + out << nl << "if(" << fixedParam << ".size() == 0)"; + out << sb; + out << nl << stream << deref << "writeSize(0);"; + out << eb; + out << nl << "else"; + out << sb; out << nl << scope << "__" << func << (pointer ? "" : "&") << stream << ", &" << fixedParam << "[0], &" << fixedParam << "[0] + " << fixedParam << ".size(), " << scope << "__U__" << fixKwd(seq->name()) << "());"; + out << eb; } } else if(builtin->kind() == Builtin::KindBool) @@ -533,8 +540,15 @@ Slice::writeMarshalUnmarshalCode(Output& out, const TypePtr& type, const string& } else { + out << nl << "if(" << fixedParam << ".size() == 0)"; + out << sb; + out << nl << stream << deref << "writeSize(0);"; + out << eb; + out << nl << "else"; + out << sb; out << nl << stream << deref << func << "&" << fixedParam << "[0], &" << fixedParam << "[0] + " << fixedParam << ".size());"; + out << eb; } } } |