[PHP] Fix segfault when wrapping a non-class function marked with

%newobject (testcase char_strings).


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10564 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Olly Betts 2008-06-23 22:58:03 +00:00
commit 376adf0e64
2 changed files with 6 additions and 1 deletions

View file

@ -1749,7 +1749,8 @@ public:
}
Printf(output, "\n");
if (wrapperType == memberfn || newobject) {
// If it's a member function or a class constructor...
if (wrapperType == memberfn || (newobject && current_class)) {
Printf(output, "\tfunction %s(%s) {\n", methodname, args);
// We don't need this code if the wrapped class has a copy ctor
// since the flat function new_CLASSNAME will handle it for us.