summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlly Betts <olly@survex.com>2016-12-30 16:05:53 +1300
committerOlly Betts <olly@survex.com>2016-12-30 16:05:53 +1300
commit26a01e1b83d217799cf483ebbf27ec425f85f542 (patch)
tree0e4f3a2f459d4301fafc573f80167028ffa4079d
parent0aac18b2a1d61e53c3b8b95b5a4d03d93145ccfc (diff)
downloadswig-26a01e1b83d217799cf483ebbf27ec425f85f542.tar.gz
[PHP7] Fix segfault on module unload
Register internal 'swig_runtime_data_type_pointer' constant as "CONST_PERSISTENT" to avoid segmentation fault on module unload. Fixes https://github.com/swig/swig/issues/859 reported by Timotheus Pokorra - thanks also to Javier Torres for a minimal reproducer.
-rw-r--r--CHANGES.current6
-rw-r--r--Lib/php/phprun.swg2
-rw-r--r--Lib/php5/phprun.swg2
3 files changed, 8 insertions, 2 deletions
diff --git a/CHANGES.current b/CHANGES.current
index c66aa64cc..19989e1ef 100644
--- a/CHANGES.current
+++ b/CHANGES.current
@@ -7,6 +7,12 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/
Version 3.0.11 (29 Dec 2016)
============================
+2016-12-30: olly
+ [PHP7] Register internal 'swig_runtime_data_type_pointer' constant
+ as "CONST_PERSISTENT" to avoid segmentation fault on module unload.
+ Fixes https://github.com/swig/swig/issues/859 reported by Timotheus
+ Pokorra - thanks also to Javier Torres for a minimal reproducer.
+
2016-12-24: wsfulton
[C#] Add %feature("csdirectordelegatemodifiers") to enable customization
of the delegate access modifiers generated in director classes.
diff --git a/Lib/php/phprun.swg b/Lib/php/phprun.swg
index c341e6704..5c62d1927 100644
--- a/Lib/php/phprun.swg
+++ b/Lib/php/phprun.swg
@@ -235,5 +235,5 @@ static swig_module_info *SWIG_Php_GetModule() {
}
static void SWIG_Php_SetModule(swig_module_info *pointer) {
- REGISTER_MAIN_LONG_CONSTANT(const_name, (long) pointer, 0);
+ REGISTER_MAIN_LONG_CONSTANT(const_name, (long) pointer, CONST_PERSISTENT | CONST_CS);
}
diff --git a/Lib/php5/phprun.swg b/Lib/php5/phprun.swg
index 3900df9ef..a18e1fcbb 100644
--- a/Lib/php5/phprun.swg
+++ b/Lib/php5/phprun.swg
@@ -276,5 +276,5 @@ static swig_module_info *SWIG_Php_GetModule() {
static void SWIG_Php_SetModule(swig_module_info *pointer) {
TSRMLS_FETCH();
- REGISTER_MAIN_LONG_CONSTANT(const_name, (long) pointer, 0);
+ REGISTER_MAIN_LONG_CONSTANT(const_name, (long) pointer, CONST_PERSISTENT | CONST_CS);
}