[PHP] Fix code generated for feature("director:except")

Previously the return value of call_user_function() was ignored and we
checked an uninitialised value instead.  Fixes #627.  Based on patch
from Sergey Seroshtan.
This commit is contained in:
Olly Betts 2016-09-25 14:42:04 +13:00
commit 1adfe2f537
3 changed files with 26 additions and 0 deletions

View file

@ -28,6 +28,21 @@ class DirectorMethodException: public Swig::DirectorException {};
%include "std_string.i"
#ifdef SWIGPHP
%feature("director:except") {
if ($error == FAILURE) {
throw Swig::DirectorMethodException();
}
}
%exception {
try { $action }
catch (Swig::DirectorException &) { SWIG_fail; }
}
#endif
#ifdef SWIGPYTHON
%feature("director:except") {