summaryrefslogtreecommitdiff
path: root/zend/extensionimpl.cpp
diff options
context:
space:
mode:
authorMartijn Otto <martijn.otto@copernica.com>2016-05-17 15:19:37 +0200
committerMartijn Otto <martijn.otto@copernica.com>2016-05-17 15:19:37 +0200
commit37123a5474f73f3db51cb726cfb512acca4682c8 (patch)
treed629eacc679b30da20f20be33d3d916f5906da29 /zend/extensionimpl.cpp
parentdd5f3a635053aa03417cdab1228e03c94b9c3136 (diff)
Fix crash during module finding and fix incomplete types for Value::call() members
Diffstat (limited to 'zend/extensionimpl.cpp')
-rw-r--r--zend/extensionimpl.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/zend/extensionimpl.cpp b/zend/extensionimpl.cpp
index 5261b0d..bc29cf1 100644
--- a/zend/extensionimpl.cpp
+++ b/zend/extensionimpl.cpp
@@ -63,8 +63,11 @@ static std::map<int,ExtensionImpl*> number2extension;
*
* @param zend_module_entry
*/
-static int match_module(zend_module_entry *entry)
+static int match_module(zval *value TSRMLS_DC)
{
+ // retrieve the module entry from the zval
+ auto *entry = (zend_module_entry*)Z_PTR_P(value);
+
// check if there is an extension with this name
auto iter = name2extension.find(entry->name);
if (iter == name2extension.end()) return ZEND_HASH_APPLY_KEEP;
@@ -89,7 +92,7 @@ static ExtensionImpl *find(int number TSRMLS_DC)
if (iter != number2extension.end()) return iter->second;
// no, not yet, loop through all modules
- zend_hash_apply(&module_registry, (apply_func_t)match_module TSRMLS_CC);
+ zend_hash_apply(&module_registry, match_module TSRMLS_CC);
// find again
iter = number2extension.find(number);