summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp/Gen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/slice2cpp/Gen.cpp')
-rw-r--r--cpp/src/slice2cpp/Gen.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index c6a14f2f392..39039124f68 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -1514,7 +1514,15 @@ Slice::Gen::ObjectVisitor::visitOperation(const Operation_ptr& p)
C << nl << "catch(" << exceptionTypeToString(*r) << " __ex)";
C << sb;
C << nl << "__os -> write(" << cnt++ << ");";
- writeMarshalUnmarshalCode(C, *r, "__ex", true);
+ if(Proxy_ptr::dynamicCast(*r))
+ {
+ string s = "static_cast< ";
+ s += typeToString(*r);
+ s += ">(__ex)";
+ writeMarshalUnmarshalCode(C, *r, s, true);
+ }
+ else
+ writeMarshalUnmarshalCode(C, *r, "__ex", true);
C << nl << "return ::__Ice::DispatchException;";
C << eb;
}