summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/CsUtil.cpp
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2007-11-29 11:06:37 +1000
committerMichi Henning <michi@zeroc.com>2007-11-29 11:06:37 +1000
commitb80237b8961cd2129190cf3c2815b0d76dcd8789 (patch)
tree91a5b85ca1705d4a73492e6cbaf3703846997cf3 /cpp/src/Slice/CsUtil.cpp
parentMerge branch 'master' of ssh://cvs.zeroc.com/home/git/ice (diff)
downloadice-b80237b8961cd2129190cf3c2815b0d76dcd8789.tar.bz2
ice-b80237b8961cd2129190cf3c2815b0d76dcd8789.tar.xz
ice-b80237b8961cd2129190cf3c2815b0d76dcd8789.zip
Minor fix for bug 2474 for --stream with C#.
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;
}