summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/CsUtil.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2007-11-30 11:01:27 -0500
committerBernard Normier <bernard@zeroc.com>2007-11-30 11:01:27 -0500
commit0b6a5d811e79550709b1e0589580976dba8c5aaa (patch)
treeabf3606e45b80715a24b037c28866ba831f34560 /cpp/src/Slice/CsUtil.cpp
parentImplemented service observers (diff)
parentFixed bug 2584 in Java/C# for consistency (diff)
downloadice-0b6a5d811e79550709b1e0589580976dba8c5aaa.tar.bz2
ice-0b6a5d811e79550709b1e0589580976dba8c5aaa.tar.xz
ice-0b6a5d811e79550709b1e0589580976dba8c5aaa.zip
Merge branch 'master' of ssh://cvs.zeroc.com/home/git/ice
Diffstat (limited to 'cpp/src/Slice/CsUtil.cpp')
-rwxr-xr-xcpp/src/Slice/CsUtil.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/cpp/src/Slice/CsUtil.cpp b/cpp/src/Slice/CsUtil.cpp
index c6dfb006e95..9b9c7c801c2 100755
--- a/cpp/src/Slice/CsUtil.cpp
+++ b/cpp/src/Slice/CsUtil.cpp
@@ -602,6 +602,13 @@ Slice::CsGenerator::writeMarshalUnmarshalCode(Output &out,
}
if(marshal)
{
+ if(streamingAPI)
+ {
+ out << nl << "if((int)" << param << " < 0 || (int)" << param << " >= " << sz << ")";
+ out << sb;
+ out << nl << "throw new Ice.MarshalException(\"enumerator out of range\");";
+ out << eb;
+ }
out << nl << stream << '.' << func << '(' << cast << param;
if(!streamingAPI)
{
@@ -617,6 +624,13 @@ Slice::CsGenerator::writeMarshalUnmarshalCode(Output &out,
out << sz;
}
out << ")" << ';';
+ if(streamingAPI)
+ {
+ out << nl << "if((int)" << param << " < 0 || (int)" << param << " >= " << sz << ")";
+ out << sb;
+ out << nl << "throw new Ice.MarshalException(\"enumerator out of range\");";
+ out << eb;
+ }
}
return;
}