diff options
author | Olly Betts <olly@survex.com> | 2015-01-12 13:53:01 +1300 |
---|---|---|
committer | Olly Betts <olly@survex.com> | 2015-01-12 13:53:01 +1300 |
commit | 682b4dd8434401ba57f26f3e3da6fe2571d372ca (patch) | |
tree | a221d67875af13946522af957c63ddea8f95dba5 | |
parent | f6b84f414bc4911b7c2e8902fb83c23a0e4b9e6b (diff) | |
download | swig-682b4dd8434401ba57f26f3e3da6fe2571d372ca.tar.gz |
[PHP] Fix segfault in director upcall check
Manifest only when using PHP built with ZTS enabled.
-rw-r--r-- | CHANGES.current | 4 | ||||
-rw-r--r-- | Source/Modules/php.cxx | 15 |
2 files changed, 12 insertions, 7 deletions
diff --git a/CHANGES.current b/CHANGES.current index 7c9712f0e..f04bbd9b0 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -5,6 +5,10 @@ See the RELEASENOTES file for a summary of changes in each release. Version 3.0.4 (in progress) =========================== +2015-01-12: olly + [PHP] Fix segfault in director upcall check when using PHP built with + ZTS enabled. Fixes #155, reported by Pierre Labastie. + 2015-01-08: wsfulton [Python] Fix #294 #296 - Regression introduced in SWIG-3.0.3 when wrapping functions with default arguments. Now any method with default diff --git a/Source/Modules/php.cxx b/Source/Modules/php.cxx index 620966a58..218d6250c 100644 --- a/Source/Modules/php.cxx +++ b/Source/Modules/php.cxx @@ -826,13 +826,6 @@ public: Delete(args); args = NULL; } - if (is_member_director(n)) { - Wrapper_add_local(f, "director", "Swig::Director *director = 0"); - Printf(f->code, "director = dynamic_cast<Swig::Director*>(arg1);\n"); - Wrapper_add_local(f, "upcall", "bool upcall = false"); - Printf(f->code, "upcall = !director->swig_is_overridden_method((char *)\"%s%s\", (char *)\"%s\");\n", - prefix, Swig_class_name(Swig_methodclass(n)), name); - } // This generated code may be called: // 1) as an object method, or @@ -921,6 +914,14 @@ public: Delete(source); } + if (is_member_director(n)) { + Wrapper_add_local(f, "director", "Swig::Director *director = 0"); + Printf(f->code, "director = dynamic_cast<Swig::Director*>(arg1);\n"); + Wrapper_add_local(f, "upcall", "bool upcall = false"); + Printf(f->code, "upcall = !director->swig_is_overridden_method((char *)\"%s%s\", (char *)\"%s\");\n", + prefix, Swig_class_name(Swig_methodclass(n)), name); + } + Swig_director_emit_dynamic_cast(n, f); /* Insert constraint checking code */ |