[PHP] An overloaded method which can return an object or a

primitive type no longer causes SWIG to segfault.  Reported by Paul
Colby in SF#3168531.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12471 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Olly Betts 2011-02-18 06:39:51 +00:00
commit bf7c9e9a42
4 changed files with 28 additions and 1 deletions

View file

@ -1718,7 +1718,6 @@ public:
while (i.item) {
SwigType *ret_type = i.item;
i = Next(i);
Printf(output, "\t\t");
String *mangled = NewString("_p");
Printf(mangled, "%s", SwigType_manglestr(ret_type));
Node *class_node = Getattr(zend_types, mangled);
@ -1729,7 +1728,13 @@ public:
Delete(mangled);
mangled = NewString(SwigType_manglestr(ret_type));
class_node = Getattr(zend_types, mangled);
if (!class_node) {
// Return type isn't an object, so will be handled by the
// !is_resource() check before the switch.
continue;
}
}
Printf(output, "\t\t");
if (i.item) {
Printf(output, "case '%s': ", mangled);
} else {