mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Use efree_size() instead of efree() where posible
This commit is contained in:
@@ -1320,7 +1320,7 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval *retval, int file_cou
|
||||
}
|
||||
}
|
||||
destroy_op_array(op_array TSRMLS_CC);
|
||||
efree(op_array);
|
||||
efree_size(op_array, sizeof(zend_op_array));
|
||||
} else if (type==ZEND_REQUIRE) {
|
||||
va_end(files);
|
||||
return FAILURE;
|
||||
|
||||
@@ -746,7 +746,7 @@ END_EXTERN_C()
|
||||
ZEND_ASSERT(Z_ISREF_P(_z)); \
|
||||
ref = Z_REF_P(_z); \
|
||||
ZVAL_COPY_VALUE(_z, &ref->val); \
|
||||
efree(ref); \
|
||||
efree_size(ref, sizeof(zend_reference)); \
|
||||
} while (0)
|
||||
|
||||
#define SEPARATE_STRING(zv) do { \
|
||||
|
||||
@@ -2495,7 +2495,7 @@ ZEND_API int do_bind_function(const zend_op_array *op_array, zend_op *opline, Ha
|
||||
int error_level = compile_time ? E_COMPILE_ERROR : E_ERROR;
|
||||
zend_function *old_function;
|
||||
|
||||
efree(new_function);
|
||||
efree_size(new_function, sizeof(zend_op_array));
|
||||
if ((old_function = zend_hash_find_ptr(function_table, Z_STR_P(op2))) != NULL
|
||||
&& old_function->type == ZEND_USER_FUNCTION
|
||||
&& old_function->op_array.last > 0) {
|
||||
|
||||
@@ -607,7 +607,7 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_clas
|
||||
zend_ast_evaluate(&tmp, Z_ASTVAL_P(p), scope TSRMLS_CC);
|
||||
if (inline_change) {
|
||||
zend_ast_destroy_and_free(Z_ASTVAL_P(p));
|
||||
efree(Z_AST_P(p));
|
||||
efree_size(Z_AST_P(p), sizeof(zend_ast_ref));
|
||||
}
|
||||
ZVAL_COPY_VALUE(p, &tmp);
|
||||
}
|
||||
@@ -1092,7 +1092,7 @@ ZEND_API int zend_eval_stringl(char *str, int str_len, zval *retval_ptr, char *s
|
||||
zend_execute(new_op_array, &local_retval TSRMLS_CC);
|
||||
} zend_catch {
|
||||
destroy_op_array(new_op_array TSRMLS_CC);
|
||||
efree(new_op_array);
|
||||
efree_size(new_op_array, sizeof(zend_op_array));
|
||||
zend_bailout();
|
||||
} zend_end_try();
|
||||
|
||||
@@ -1110,7 +1110,7 @@ ZEND_API int zend_eval_stringl(char *str, int str_len, zval *retval_ptr, char *s
|
||||
|
||||
EG(no_extensions)=0;
|
||||
destroy_op_array(new_op_array TSRMLS_CC);
|
||||
efree(new_op_array);
|
||||
efree_size(new_op_array, sizeof(zend_op_array));
|
||||
retval = SUCCESS;
|
||||
} else {
|
||||
retval = FAILURE;
|
||||
|
||||
@@ -130,7 +130,7 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished
|
||||
/* Free a clone of closure */
|
||||
if (op_array->fn_flags & ZEND_ACC_CLOSURE) {
|
||||
destroy_op_array(op_array TSRMLS_CC);
|
||||
efree(op_array);
|
||||
efree_size(op_array, sizeof(zend_op_array));
|
||||
}
|
||||
|
||||
efree(generator->stack);
|
||||
|
||||
@@ -604,7 +604,7 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR
|
||||
pass_two(op_array TSRMLS_CC);
|
||||
zend_release_labels(0 TSRMLS_CC);
|
||||
} else {
|
||||
efree(op_array);
|
||||
efree_size(op_array, sizeof(zend_op_array));
|
||||
retval = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -602,7 +602,7 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR
|
||||
pass_two(op_array TSRMLS_CC);
|
||||
zend_release_labels(0 TSRMLS_CC);
|
||||
} else {
|
||||
efree(op_array);
|
||||
efree_size(op_array, sizeof(zend_op_array));
|
||||
retval = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ void list_entry_destructor(zval *zv)
|
||||
|
||||
zend_resource_dtor(res TSRMLS_CC);
|
||||
}
|
||||
efree(res);
|
||||
efree_size(res, sizeof(zend_resource));
|
||||
}
|
||||
|
||||
void plist_entry_destructor(zval *zv)
|
||||
|
||||
@@ -159,7 +159,7 @@ ZEND_API HashTable *zend_std_get_debug_info(zval *object, int *is_temp TSRMLS_DC
|
||||
*is_temp = 1;
|
||||
ALLOC_HASHTABLE(ht);
|
||||
*ht = *Z_ARRVAL(retval);
|
||||
efree(Z_ARR(retval));
|
||||
efree_size(Z_ARR(retval), sizeof(zend_array));
|
||||
return ht;
|
||||
} else {
|
||||
*is_temp = 0;
|
||||
@@ -951,7 +951,7 @@ ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS) /* {{{ */
|
||||
zval_ptr_dtor(&method_name);
|
||||
|
||||
/* destruct the function also, then - we have allocated it in get_method */
|
||||
efree(func);
|
||||
efree_size(func, sizeof(zend_internal_function));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -1168,7 +1168,7 @@ ZEND_API void zend_std_callstatic_user_call(INTERNAL_FUNCTION_PARAMETERS) /* {{{
|
||||
zval_ptr_dtor(&method_name);
|
||||
|
||||
/* destruct the function also, then - we have allocated it in get_method */
|
||||
efree(func);
|
||||
efree_size(func, sizeof(zend_internal_function));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ ZEND_API void zend_function_dtor(zval *zv)
|
||||
if (function->type == ZEND_INTERNAL_FUNCTION) {
|
||||
pefree(function, 1);
|
||||
} else if (!function->common.function_name) {
|
||||
efree(function);
|
||||
efree_size(function, sizeof(zend_op_array));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -330,7 +330,7 @@ ZEND_API void destroy_op_array(zend_op_array *op_array TSRMLS_DC)
|
||||
return;
|
||||
}
|
||||
|
||||
efree(op_array->refcount);
|
||||
efree_size(op_array->refcount, sizeof(*(op_array->refcount)));
|
||||
|
||||
if (op_array->vars) {
|
||||
i = op_array->last_var;
|
||||
|
||||
@@ -716,7 +716,7 @@ ZEND_API void convert_to_object(zval *op) /* {{{ */
|
||||
memcpy(properties, Z_ARRVAL_P(op), sizeof(HashTable));
|
||||
object_and_properties_init(op, zend_standard_class_def, properties);
|
||||
if (--GC_REFCOUNT(arr) == 0) {
|
||||
efree(arr);
|
||||
efree_size(arr, sizeof(zend_array));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1829,7 +1829,7 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
|
||||
} else if (frame_kind == VM_FRAME_NESTED_CODE) {
|
||||
zend_detach_symbol_table(execute_data);
|
||||
destroy_op_array(&EX(func)->op_array TSRMLS_CC);
|
||||
efree(EX(func));
|
||||
efree_size(EX(func), sizeof(zend_op_array));
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
zend_vm_stack_free_call_frame(execute_data TSRMLS_CC);
|
||||
|
||||
@@ -4245,7 +4245,7 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
|
||||
}
|
||||
|
||||
destroy_op_array(new_op_array TSRMLS_CC);
|
||||
efree(new_op_array);
|
||||
efree_size(new_op_array, sizeof(zend_op_array));
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
zend_throw_exception_internal(NULL TSRMLS_CC);
|
||||
HANDLE_EXCEPTION();
|
||||
|
||||
@@ -434,7 +434,7 @@ static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
|
||||
} else if (frame_kind == VM_FRAME_NESTED_CODE) {
|
||||
zend_detach_symbol_table(execute_data);
|
||||
destroy_op_array(&EX(func)->op_array TSRMLS_CC);
|
||||
efree(EX(func));
|
||||
efree_size(EX(func), sizeof(zend_op_array));
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
zend_vm_stack_free_call_frame(execute_data TSRMLS_CC);
|
||||
|
||||
@@ -3054,7 +3054,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA
|
||||
}
|
||||
|
||||
destroy_op_array(new_op_array TSRMLS_CC);
|
||||
efree(new_op_array);
|
||||
efree_size(new_op_array, sizeof(zend_op_array));
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
zend_throw_exception_internal(NULL TSRMLS_CC);
|
||||
HANDLE_EXCEPTION();
|
||||
@@ -9806,7 +9806,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND
|
||||
}
|
||||
|
||||
destroy_op_array(new_op_array TSRMLS_CC);
|
||||
efree(new_op_array);
|
||||
efree_size(new_op_array, sizeof(zend_op_array));
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
zend_throw_exception_internal(NULL TSRMLS_CC);
|
||||
HANDLE_EXCEPTION();
|
||||
@@ -16480,7 +16480,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
|
||||
}
|
||||
|
||||
destroy_op_array(new_op_array TSRMLS_CC);
|
||||
efree(new_op_array);
|
||||
efree_size(new_op_array, sizeof(zend_op_array));
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
zend_throw_exception_internal(NULL TSRMLS_CC);
|
||||
HANDLE_EXCEPTION();
|
||||
@@ -33884,7 +33884,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
|
||||
}
|
||||
|
||||
destroy_op_array(new_op_array TSRMLS_CC);
|
||||
efree(new_op_array);
|
||||
efree_size(new_op_array, sizeof(zend_op_array));
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
zend_throw_exception_internal(NULL TSRMLS_CC);
|
||||
HANDLE_EXCEPTION();
|
||||
|
||||
Reference in New Issue
Block a user