diff options
author | Anatol Belski <ab@php.net> | 2014-09-24 21:39:49 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2014-09-24 21:39:49 +0200 |
commit | a2dd6069420c77b4f070ef10916be0d5c9afe84f (patch) | |
tree | caa9ffe31be09ba030ae4cf7920aaae486af1725 /Zend/zend_opcode.c | |
parent | 70077d84e9817293f59454dc97d6aa3be89f9c7a (diff) | |
parent | 6a09bdff6a9ec30f744fa12aeb2875a764fc34c5 (diff) | |
download | php-git-a2dd6069420c77b4f070ef10916be0d5c9afe84f.tar.gz |
Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: (31 commits)
Fixed C++ incompatibility
update the certificate used for the test, as it expired recently
Fixed immutable arrays support
Fix counting of "R:" references in serialize()
Remove dead code
Test use($this) being an error
Move list() condition into assign_znode
typo
NEWS
Fix bug #68074 Allow to use system cipher list instead of hardcoded value
Avoid double checks
the order of the blocks should be Core, then exts in alphabetical order
add missing NEWS entry for the phpdbg compilation fix
add NEWS entry for #68088
Make QM_ASSIGN, JMP_SET and CAST return IS_TMP_VAR.
Removed useless helper
Drop unused result argument
Fix ct binding for cuf/cufa functions
Fix detection of write to built-in function for references
Test use of string names with \ prefix
...
Diffstat (limited to 'Zend/zend_opcode.c')
-rw-r--r-- | Zend/zend_opcode.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index d57721e58b..3397ed28e2 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -100,16 +100,12 @@ void init_op_array(zend_op_array *op_array, zend_uchar type, int initial_ops_siz ZEND_API void destroy_zend_function(zend_function *function TSRMLS_DC) { - switch (function->type) { - case ZEND_USER_FUNCTION: - destroy_op_array((zend_op_array *) function TSRMLS_CC); - break; - case ZEND_INTERNAL_FUNCTION: - if (function->common.function_name) { - zend_string_release(function->common.function_name); - } - /* do nothing */ - break; + if (function->type == ZEND_USER_FUNCTION) { + destroy_op_array(&function->op_array TSRMLS_CC); + } else { + ZEND_ASSERT(function->type == ZEND_INTERNAL_FUNCTION); + ZEND_ASSERT(function->common.function_name); + zend_string_release(function->common.function_name); } } @@ -118,11 +114,18 @@ ZEND_API void zend_function_dtor(zval *zv) zend_function *function = Z_PTR_P(zv); TSRMLS_FETCH(); - destroy_zend_function(function TSRMLS_CC); - if (function->type == ZEND_INTERNAL_FUNCTION) { - pefree(function, 1); - } else if (!function->common.function_name) { - efree_size(function, sizeof(zend_op_array)); + if (function->type == ZEND_USER_FUNCTION) { + ZEND_ASSERT(function->common.function_name); + destroy_op_array(&function->op_array TSRMLS_CC); + /* op_arrays are allocated on arena, so we don't have to free them */ +//??? efree_size(function, sizeof(zend_op_array)); + } else { + ZEND_ASSERT(function->type == ZEND_INTERNAL_FUNCTION); + ZEND_ASSERT(function->common.function_name); + zend_string_release(function->common.function_name); + if (!(function->common.fn_flags & ZEND_ACC_ARENA_ALLOCATED)) { + pefree(function, 1); + } } } |