Commit graph

13 commits

Author SHA1 Message Date
Olly Betts
9908f9f310 [php] Fix testcase segfaults with PHP 8.0
These testcases were segfaulting:

prefix
director_using_member_scopes
virtual_poly

The fix here is admittedly a hack - we perform the initialisation
of EG(class_table) from CG(class_table) which PHP will do, but
hasn't yet.

PHP doesn't seem to clearly document which API calls are actually
valid in minit or other initialisation contexts, but the code we're
generating works with all PHP 7.x and PHP 8.x versions aside from PHP
8.0 so it seems this is a bug in PHP 8.0 rather than that we're doing
something invalid, and we need to work with existing PHP 8.0 releases
so this hack seems a necessary evil.  It will at least have a limited
life as PHP 8.0 is only in active support until 2022-11-26, with
security support ending a year later.

Fixes #2383.
2022-09-29 13:13:52 +13:00
Olly Betts
6e6d720d88 Fix segfault in exception class creation
We can't safely lookup the Exception class entry at MINIT time, but we
can just use zend_ce_exception instead, which will be a bit faster too.
2021-05-04 13:12:15 +12:00
Olly Betts
ad61e33e22 Wrap pointer to member as object not resource 2021-04-22 07:56:25 +12:00
Olly Betts
c705ef8f32 Use PHP objects instead of resources to wrap pointers
Pointer to member is currently still wrapped as a resource.
2021-04-21 15:40:35 +12:00
Olly Betts
950473d77e [php] Whitespace improvements in generated C/C++ code 2019-02-12 10:14:25 +13:00
Olly Betts
ab754b0c65 [PHP] Fix access to already released memory
Fix access to already released memory during PHP module  shutdown, which
often didn't cause visible problems, but could result in segmentation
faults, bus errors, etc.  Fixes #1170, reported by Jitka Plesníková.
2019-02-09 17:08:21 +13:00
Olly Betts
0ada392cee [PHP] Fix minor misindentation in generated wrapper 2016-12-01 12:02:52 +13:00
Olly Betts
1169874f59 [PHP] Add support for PHP7.
PHP5's C extension API has changed substantially so you need to use
-php7 to specify you want PHP7 compatible wrappers.
Fixes https://github.com/swig/swig/issues/571
2016-11-30 13:05:59 +13:00
Olly Betts
b36ae8aaf4 Attach the swig_php_init_member_ptr fragment to all the typemaps which need it.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12148 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-06-25 01:48:33 +00:00
William S Fulton
b946430c8a Remove potential symbol clash with wrapped code (php)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12147 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-06-24 19:33:21 +00:00
Olly Betts
0d7863c810 Wrapping pointer to member function types is likely to be rare, so use
%fragment to only pull in the required machinery if it is going to be
used.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12145 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-06-24 14:16:16 +00:00
Olly Betts
67bbac4872 Add PHP typemaps for pointer to method.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11768 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-12-03 12:59:59 +00:00
Olly Betts
3d3bc01a2f Rename php4*.swg to php*.swg.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10635 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-07-03 00:37:38 +00:00
Renamed from Lib/php/php4init.swg (Browse further)