Fix uninitialised variable usage on error in director methods. Minor formatting change for director methods variable declaration.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10019 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2007-10-22 21:30:19 +00:00
commit 30964be253
3 changed files with 13 additions and 6 deletions

View file

@ -1,6 +1,9 @@
Version 1.3.32 (in progress) Version 1.3.32 (in progress)
============================ ============================
10/22/2007: wsfulton
[Java, C#] Fix uninitialised variable usage on error in director methods.
10/19/2007: wsfulton 10/19/2007: wsfulton
[Java, C#] Bug #1794247 - fix generated code for derived classes when csbase or javabase [Java, C#] Bug #1794247 - fix generated code for derived classes when csbase or javabase
typemaps are used with the replace="1" attribute. typemaps are used with the replace="1" attribute.

View file

@ -3184,7 +3184,9 @@ public:
if (!is_void && !ignored_method) { if (!is_void && !ignored_method) {
if (!SwigType_isclass(returntype)) { if (!SwigType_isclass(returntype)) {
if (!(SwigType_ispointer(returntype) || SwigType_isreference(returntype))) { if (!(SwigType_ispointer(returntype) || SwigType_isreference(returntype))) {
Wrapper_add_localv(w, "c_result", SwigType_lstr(returntype, "c_result"), NIL); String *construct_result = NewStringf("= %s()", SwigType_lstr(returntype, 0));
Wrapper_add_localv(w, "c_result", SwigType_lstr(returntype, "c_result"), construct_result, NIL);
Delete(construct_result);
} else { } else {
String *base_typename = SwigType_base(returntype); String *base_typename = SwigType_base(returntype);
String *resolved_typename = SwigType_typedef_resolve_all(base_typename); String *resolved_typename = SwigType_typedef_resolve_all(base_typename);

View file

@ -3293,7 +3293,9 @@ public:
if (!is_void && (!ignored_method || pure_virtual)) { if (!is_void && (!ignored_method || pure_virtual)) {
if (!SwigType_isclass(returntype)) { if (!SwigType_isclass(returntype)) {
if (!(SwigType_ispointer(returntype) || SwigType_isreference(returntype))) { if (!(SwigType_ispointer(returntype) || SwigType_isreference(returntype))) {
Wrapper_add_localv(w, "c_result", SwigType_lstr(returntype, "c_result"), NIL); String *construct_result = NewStringf("= %s()", SwigType_lstr(returntype, 0));
Wrapper_add_localv(w, "c_result", SwigType_lstr(returntype, "c_result"), construct_result, NIL);
Delete(construct_result);
} else { } else {
String *base_typename = SwigType_base(returntype); String *base_typename = SwigType_base(returntype);
String *resolved_typename = SwigType_typedef_resolve_all(base_typename); String *resolved_typename = SwigType_typedef_resolve_all(base_typename);