summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/RubyUtil.cpp
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2009-05-08 13:48:51 -0230
committerDwayne Boone <dwayne@zeroc.com>2009-05-08 13:48:51 -0230
commitcdc0f62f4fe737454bbb96031695415c4f9be406 (patch)
treeec007ba67d4f0e579becf7c7709137a619b5de8d /cpp/src/Slice/RubyUtil.cpp
parentBug 3966 - deadlock in LocatorInfo (diff)
downloadice-cdc0f62f4fe737454bbb96031695415c4f9be406.tar.bz2
ice-cdc0f62f4fe737454bbb96031695415c4f9be406.tar.xz
ice-cdc0f62f4fe737454bbb96031695415c4f9be406.zip
Bug 3409 - add sequence checking to ruby/python
Diffstat (limited to 'cpp/src/Slice/RubyUtil.cpp')
-rw-r--r--cpp/src/Slice/RubyUtil.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/cpp/src/Slice/RubyUtil.cpp b/cpp/src/Slice/RubyUtil.cpp
index abbb02ddd0f..3efd92320ff 100644
--- a/cpp/src/Slice/RubyUtil.cpp
+++ b/cpp/src/Slice/RubyUtil.cpp
@@ -1106,11 +1106,21 @@ Slice::Ruby::CodeVisitor::visitSequence(const SequencePtr& p)
//
string name = fixIdent(p->name(), IdentToUpper);
string scoped = p->scoped();
+ TypePtr type = p->type();
_out << sp << nl << "if not defined?(" << getAbsolute(p, IdentToUpper, "T_") << ')';
_out.inc();
_out << nl << "T_" << name << " = ::Ice::__defineSequence('" << scoped << "', ";
writeType(p->type());
- _out << ")";
+ _out << ", ";
+ if(type->isVariableLength())
+ {
+ _out << "true";
+ }
+ else
+ {
+ _out << "false";
+ }
+ _out << ", " << type->minWireSize() << ")";
_out.dec();
_out << nl << "end"; // if not defined?()
}