diff options
author | Michi Henning <michi@zeroc.com> | 2007-10-12 10:21:05 +1000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2007-10-12 10:21:05 +1000 |
commit | 0b23d6e63c5db6bba12c54835fca1d6c8dea5fc7 (patch) | |
tree | 3cee3d02343c305b3a2d6c226633c08a467d7f6c /cpp | |
parent | Merge branch 'master' of ssh://cvs.zeroc.com/home/git/ice (diff) | |
download | ice-0b23d6e63c5db6bba12c54835fca1d6c8dea5fc7.tar.bz2 ice-0b23d6e63c5db6bba12c54835fca1d6c8dea5fc7.tar.xz ice-0b23d6e63c5db6bba12c54835fca1d6c8dea5fc7.zip |
Further fix for bug 2502.
Diffstat (limited to 'cpp')
-rwxr-xr-x | cpp/src/slice2cs/Gen.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp index 205332e6e87..24df02af591 100755 --- a/cpp/src/slice2cs/Gen.cpp +++ b/cpp/src/slice2cs/Gen.cpp @@ -326,9 +326,17 @@ Slice::CsVisitor::writeDispatchAndMarshalling(const ClassDefPtr& p, bool stream) if(!isClass) { _out << nl << typeS << ' ' << param << ';'; - if(StructPtr::dynamicCast(q->first) && !isValueType(q->first)) + StructPtr st = StructPtr::dynamicCast(q->first); + if(st) { - _out << nl << param << " = null;"; + if(isValueType(q->first)) + { + _out << nl << param << " = new " << typeS << "();"; + } + else + { + _out << nl << param << " = null;"; + } } } writeMarshalUnmarshalCode(_out, q->first, param, false, false, true); @@ -453,9 +461,17 @@ Slice::CsVisitor::writeDispatchAndMarshalling(const ClassDefPtr& p, bool stream) if(!isClass) { _out << nl << typeS << ' ' << param << ';'; - if(StructPtr::dynamicCast(q->first) && !isValueType(q->first)) + StructPtr st = StructPtr::dynamicCast(q->first); + if(st) { - _out << nl << param << " = null;"; + if(isValueType(q->first)) + { + _out << nl << param << " = new " << typeS << "();"; + } + else + { + _out << nl << param << " = null;"; + } } } writeMarshalUnmarshalCode(_out, q->first, fixId(q->second), false, false, true); |