summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp/Gen.cpp
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2003-05-19 04:04:38 +0000
committerMichi Henning <michi@zeroc.com>2003-05-19 04:04:38 +0000
commitad225aad6762ab693d8b14bd86046cdf0ac53383 (patch)
treed17986b5e6ee8b45280dc2ac71adfb09b428b94e /cpp/src/slice2cpp/Gen.cpp
parentFixed bug in unmarshalling code for sequences: the code has to make sure (diff)
downloadice-ad225aad6762ab693d8b14bd86046cdf0ac53383.tar.bz2
ice-ad225aad6762ab693d8b14bd86046cdf0ac53383.tar.xz
ice-ad225aad6762ab693d8b14bd86046cdf0ac53383.zip
Got carried away with the previous change.
Diffstat (limited to 'cpp/src/slice2cpp/Gen.cpp')
-rw-r--r--cpp/src/slice2cpp/Gen.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index 74f0fcd42b7..d3b940ea33b 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -751,14 +751,12 @@ Slice::Gen::TypesVisitor::visitSequence(const SequencePtr& p)
// Don't use v.resize(sz) or v.reserve(sz) here, as it cannot
// be checked whether sz is a reasonable value.
//
- // Michi: I don't think it matters -- if the size is unreasonable, we just fall over after having
- // unmarshaled a whole lot of stuff instead of falling over straight away.
- //
- C << nl << "v.resize(sz);";
- C << nl << "for(int i = 0; i < sz; ++i)";
+ C << nl << "while(sz--)";
C << sb;
- writeGenericMarshalUnmarshalCode(C, type, "v[i]", false);
+ C << nl << "v.resize(v.size() + 1);";
+ writeGenericMarshalUnmarshalCode(C, type, "v.back()", false, "\"e\"");
C << eb;
+ C << nl << "__is->endReadSequence();";
C << eb;
C << sp << nl << "void" << nl << scope.substr(2) << name << "Helper::"