[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.
This commit is contained in:
Olly Betts 2016-12-30 16:05:53 +13:00
commit 26a01e1b83
3 changed files with 8 additions and 2 deletions

View file

@ -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);
}