summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/CsUtil.cpp
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2014-07-17 12:36:00 -0230
committerDwayne Boone <dwayne@zeroc.com>2014-07-17 12:36:00 -0230
commit93fdab6fa782511ef569acb17352853646aa66b5 (patch)
tree1e73a243303f1d9564499f0b7a036b4484cc1671 /cpp/src/Slice/CsUtil.cpp
parentC# transceiver fixes (diff)
downloadice-93fdab6fa782511ef569acb17352853646aa66b5.tar.bz2
ice-93fdab6fa782511ef569acb17352853646aa66b5.tar.xz
ice-93fdab6fa782511ef569acb17352853646aa66b5.zip
ICE-5481 startSize/endSize methods aren't designed to be "reentrant"
Diffstat (limited to 'cpp/src/Slice/CsUtil.cpp')
-rw-r--r--cpp/src/Slice/CsUtil.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/cpp/src/Slice/CsUtil.cpp b/cpp/src/Slice/CsUtil.cpp
index 51bd6acec63..6c064e5a6c0 100644
--- a/cpp/src/Slice/CsUtil.cpp
+++ b/cpp/src/Slice/CsUtil.cpp
@@ -870,9 +870,9 @@ Slice::CsGenerator::writeOptionalMarshalUnmarshalCode(Output &out,
out << nl << "if(" << param << ".HasValue && " << stream << ".writeOpt(" << tag
<< ", Ice.OptionalFormat.FSize))";
out << sb;
- out << nl << stream << ".startSize();";
+ out << nl << "int pos__ = " << stream << ".startSize();";
writeMarshalUnmarshalCode(out, type, param + ".Value", marshal, streamingAPI);
- out << nl << stream << ".endSize();";
+ out << nl << stream << ".endSize(pos__);";
out << eb;
}
else
@@ -918,7 +918,7 @@ Slice::CsGenerator::writeOptionalMarshalUnmarshalCode(Output &out,
out << sb;
if(st->isVariableLength())
{
- out << nl << stream << ".startSize();";
+ out << nl << "int pos__ = " << stream << ".startSize();";
}
else
{
@@ -927,7 +927,7 @@ Slice::CsGenerator::writeOptionalMarshalUnmarshalCode(Output &out,
writeMarshalUnmarshalCode(out, type, param + ".Value", marshal, streamingAPI);
if(st->isVariableLength())
{
- out << nl << stream << ".endSize();";
+ out << nl << stream << ".endSize(pos__);";
}
out << eb;
}
@@ -1011,7 +1011,7 @@ Slice::CsGenerator::writeOptionalMarshalUnmarshalCode(Output &out,
out << sb;
if(keyType->isVariableLength() || valueType->isVariableLength())
{
- out << nl << stream << ".startSize();";
+ out << nl << "int pos__ = " << stream << ".startSize();";
}
else
{
@@ -1022,7 +1022,7 @@ Slice::CsGenerator::writeOptionalMarshalUnmarshalCode(Output &out,
writeMarshalUnmarshalCode(out, type, param + ".Value", marshal, streamingAPI);
if(keyType->isVariableLength() || valueType->isVariableLength())
{
- out << nl << stream << ".endSize();";
+ out << nl << stream << ".endSize(pos__);";
}
out << eb;
}
@@ -1432,7 +1432,7 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out,
else
{
out << sb;
- out << nl << "int szx__ = " << stream << ".readAndCheckSeqSize("
+ out << nl << "int szx__ = " << stream << ".readAndCheckSeqSize("
<< static_cast<unsigned>(type->minWireSize()) << ");";
out << nl << param << " = new ";
if(isArray)
@@ -1575,7 +1575,7 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out,
else
{
out << sb;
- out << nl << "int szx__ = " << stream << ".readAndCheckSeqSize("
+ out << nl << "int szx__ = " << stream << ".readAndCheckSeqSize("
<< static_cast<unsigned>(type->minWireSize()) << ");";
if(isArray)
{
@@ -1692,7 +1692,7 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out,
else
{
out << sb;
- out << nl << "int szx__ = " << stream << ".readAndCheckSeqSize(" <<
+ out << nl << "int szx__ = " << stream << ".readAndCheckSeqSize(" <<
static_cast<unsigned>(type->minWireSize()) << ");";
if(isArray)
{
@@ -1954,9 +1954,9 @@ Slice::CsGenerator::writeOptionalSequenceMarshalUnmarshalCode(Output& out,
out << nl << "if(" << param << ".HasValue && " << stream << ".writeOpt(" << tag << ", "
<< getOptionalFormat(seq) << "))";
out << sb;
- out << nl << stream << ".startSize();";
+ out << nl << "int pos__ = " << stream << ".startSize();";
writeSequenceMarshalUnmarshalCode(out, seq, param + ".Value", marshal, streamingAPI, true);
- out << nl << stream << ".endSize();";
+ out << nl << stream << ".endSize(pos__);";
out << eb;
}
else
@@ -1994,7 +1994,7 @@ Slice::CsGenerator::writeOptionalSequenceMarshalUnmarshalCode(Output& out,
out << sb;
if(st->isVariableLength())
{
- out << nl << stream << ".startSize();";
+ out << nl << "int pos__ = " << stream << ".startSize();";
}
else if(st->minWireSize() > 1)
{
@@ -2004,7 +2004,7 @@ Slice::CsGenerator::writeOptionalSequenceMarshalUnmarshalCode(Output& out,
writeSequenceMarshalUnmarshalCode(out, seq, param + ".Value", marshal, streamingAPI, true);
if(st->isVariableLength())
{
- out << nl << stream << ".endSize();";
+ out << nl << stream << ".endSize(pos__);";
}
out << eb;
}
@@ -2041,9 +2041,9 @@ Slice::CsGenerator::writeOptionalSequenceMarshalUnmarshalCode(Output& out,
out << nl << "if(" << param << ".HasValue && " << stream << ".writeOpt(" << tag << ", "
<< getOptionalFormat(seq) << "))";
out << sb;
- out << nl << stream << ".startSize();";
+ out << nl << "int pos__ = " << stream << ".startSize();";
writeSequenceMarshalUnmarshalCode(out, seq, param + ".Value", marshal, streamingAPI, true);
- out << nl << stream << ".endSize();";
+ out << nl << stream << ".endSize(pos__);";
out << eb;
}
else