Merge branch 'native-tls' of https://github.com/php/php-src into native-tls

This commit is contained in:
krakjoe 2014-09-26 09:24:16 +01:00
commit dccb50436d
19 changed files with 19 additions and 131 deletions

View File

@ -831,8 +831,6 @@ void zenderror(const char *error) /* {{{ */
BEGIN_EXTERN_C()
ZEND_API void _zend_bailout(char *filename, uint lineno) /* {{{ */
{
TSRMLS_FETCH();
if (!EG(bailout)) {
zend_output_debug_string(1, "%s(%d) : Bailed out without a bailout address!", filename, lineno);
exit(-1);
@ -998,7 +996,6 @@ static void zend_error_va_list(int type, const char *format, va_list args)
zend_stack delayed_oplines_stack;
zend_stack context_stack;
zend_array *symbol_table;
TSRMLS_FETCH();
/* Report about uncaught exception in case of fatal errors */
if (EG(exception)) {

View File

@ -48,7 +48,6 @@ ZEND_API int zend_get_parameters(int ht, int param_count, ...) /* {{{ */
int arg_count;
va_list ptr;
zval **param, *param_ptr;
TSRMLS_FETCH();
param_ptr = ZEND_CALL_ARG(EG(current_execute_data), 1);
arg_count = EG(current_execute_data)->num_args;
@ -84,7 +83,6 @@ ZEND_API int zend_get_parameters_ex(int param_count, ...) /* {{{ */
int arg_count;
va_list ptr;
zval **param, *param_ptr;
TSRMLS_FETCH();
param_ptr = ZEND_CALL_ARG(EG(current_execute_data), 1);
arg_count = EG(current_execute_data)->num_args;
@ -2501,8 +2499,6 @@ static void clean_module_classes(int module_number TSRMLS_DC) /* {{{ */
void module_destructor(zend_module_entry *module) /* {{{ */
{
TSRMLS_FETCH();
if (module->type == MODULE_TEMPORARY) {
zend_clean_module_rsrc_dtors(module->module_number TSRMLS_CC);
clean_module_constants(module->module_number TSRMLS_CC);

View File

@ -354,8 +354,6 @@ static ZEND_NORETURN void zend_mm_safe_error(zend_mm_heap *heap,
#endif
size_t size)
{
TSRMLS_FETCH();
heap->overflow = 1;
zend_try {
zend_error_noreturn(E_ERROR,
@ -2046,7 +2044,6 @@ ZEND_API int is_zend_mm(TSRMLS_D)
# define _ZEND_BIN_ALLOCATOR(_num, _size, _elements, _pages, x, y) \
ZEND_API void* ZEND_FASTCALL _emalloc_ ## _size(void) { \
TSRMLS_FETCH(); \
ZEND_MM_CUSTOM_ALLOCATOR(_size); \
return zend_mm_alloc_small(AG(mm_heap), _size, _num ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); \
}
@ -2055,23 +2052,18 @@ ZEND_MM_BINS_INFO(_ZEND_BIN_ALLOCATOR, x, y)
ZEND_API void* ZEND_FASTCALL _emalloc_large(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
TSRMLS_FETCH();
ZEND_MM_CUSTOM_ALLOCATOR(size);
return zend_mm_alloc_large(AG(mm_heap), size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
}
ZEND_API void* ZEND_FASTCALL _emalloc_huge(size_t size)
{
TSRMLS_FETCH();
ZEND_MM_CUSTOM_ALLOCATOR(size);
return zend_mm_alloc_huge(AG(mm_heap), size);
}
# define _ZEND_BIN_FREE(_num, _size, _elements, _pages, x, y) \
ZEND_API void ZEND_FASTCALL _efree_ ## _size(void *ptr) { \
TSRMLS_FETCH(); \
ZEND_MM_CUSTOM_DEALLOCATOR(ptr); \
{ \
size_t page_offset = ZEND_MM_ALIGNED_OFFSET(ptr, ZEND_MM_CHUNK_SIZE); \
@ -2088,8 +2080,6 @@ ZEND_MM_BINS_INFO(_ZEND_BIN_FREE, x, y)
ZEND_API void ZEND_FASTCALL _efree_large(void *ptr, size_t size)
{
TSRMLS_FETCH();
ZEND_MM_CUSTOM_DEALLOCATOR(ptr);
{
size_t page_offset = ZEND_MM_ALIGNED_OFFSET(ptr, ZEND_MM_CHUNK_SIZE);
@ -2106,8 +2096,6 @@ ZEND_API void ZEND_FASTCALL _efree_large(void *ptr, size_t size)
ZEND_API void ZEND_FASTCALL _efree_huge(void *ptr, size_t size)
{
TSRMLS_FETCH();
ZEND_MM_CUSTOM_DEALLOCATOR(ptr);
// TODO: use size???
zend_mm_free_huge(AG(mm_heap), ptr);
@ -2116,8 +2104,6 @@ ZEND_API void ZEND_FASTCALL _efree_huge(void *ptr, size_t size)
ZEND_API void* ZEND_FASTCALL _emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
TSRMLS_FETCH();
#if ZEND_MM_CUSTOM
if (UNEXPECTED(AG(mm_heap)->use_custom_heap)) {
return AG(mm_heap)->_malloc(size);
@ -2128,8 +2114,6 @@ ZEND_API void* ZEND_FASTCALL _emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LI
ZEND_API void ZEND_FASTCALL _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
TSRMLS_FETCH();
#if ZEND_MM_CUSTOM
if (UNEXPECTED(AG(mm_heap)->use_custom_heap)) {
AG(mm_heap)->_free(ptr);
@ -2141,8 +2125,6 @@ ZEND_API void ZEND_FASTCALL _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_OR
ZEND_API void* ZEND_FASTCALL _erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
TSRMLS_FETCH();
if (UNEXPECTED(AG(mm_heap)->use_custom_heap)) {
return AG(mm_heap)->_realloc(ptr, size);
}
@ -2194,9 +2176,7 @@ ZEND_API void* ZEND_FASTCALL _safe_realloc(void *ptr, size_t nmemb, size_t size,
ZEND_API void* ZEND_FASTCALL _ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
void *p;
#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
#endif
HANDLE_BLOCK_INTERRUPTIONS();
p = _safe_emalloc(nmemb, size, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
@ -2213,9 +2193,6 @@ ZEND_API char* ZEND_FASTCALL _estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_
{
size_t length;
char *p;
#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
#endif
HANDLE_BLOCK_INTERRUPTIONS();
@ -2233,9 +2210,6 @@ ZEND_API char* ZEND_FASTCALL _estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_
ZEND_API char* ZEND_FASTCALL _estrndup(const char *s, size_t length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
char *p;
#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
#endif
HANDLE_BLOCK_INTERRUPTIONS();
@ -2254,9 +2228,6 @@ ZEND_API char* ZEND_FASTCALL _estrndup(const char *s, size_t length ZEND_FILE_LI
ZEND_API char* ZEND_FASTCALL zend_strndup(const char *s, size_t length)
{
char *p;
#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
#endif
HANDLE_BLOCK_INTERRUPTIONS();

View File

@ -43,7 +43,6 @@ static inline size_t zend_ast_list_size(uint32_t children) {
ZEND_API zend_ast *zend_ast_create_znode(znode *node) {
zend_ast_znode *ast;
TSRMLS_FETCH();
ast = zend_ast_alloc(sizeof(zend_ast_znode) TSRMLS_CC);
ast->kind = ZEND_AST_ZNODE;
@ -55,7 +54,6 @@ ZEND_API zend_ast *zend_ast_create_znode(znode *node) {
ZEND_API zend_ast *zend_ast_create_zval_ex(zval *zv, zend_ast_attr attr) {
zend_ast_zval *ast;
TSRMLS_FETCH();
ast = zend_ast_alloc(sizeof(zend_ast_zval) TSRMLS_CC);
ast->kind = ZEND_AST_ZVAL;
@ -70,7 +68,6 @@ ZEND_API zend_ast *zend_ast_create_decl(
zend_string *name, zend_ast *child0, zend_ast *child1, zend_ast *child2
) {
zend_ast_decl *ast;
TSRMLS_FETCH();
ast = zend_ast_alloc(sizeof(zend_ast_decl) TSRMLS_CC);
ast->kind = kind;
@ -91,7 +88,6 @@ ZEND_API zend_ast *zend_ast_create_decl(
static zend_ast *zend_ast_create_from_va_list(zend_ast_kind kind, zend_ast_attr attr, va_list va) {
uint32_t i, children = kind >> ZEND_AST_NUM_CHILDREN_SHIFT;
zend_ast *ast;
TSRMLS_FETCH();
ast = zend_ast_alloc(zend_ast_size(children) TSRMLS_CC);
ast->kind = kind;
@ -140,7 +136,6 @@ ZEND_API zend_ast *zend_ast_create(zend_ast_kind kind, ...) {
ZEND_API zend_ast *zend_ast_create_list(uint32_t init_children, zend_ast_kind kind, ...) {
zend_ast *ast;
zend_ast_list *list;
TSRMLS_FETCH();
ast = zend_ast_alloc(zend_ast_list_size(4) TSRMLS_CC);
list = (zend_ast_list *) ast;
@ -169,7 +164,6 @@ static inline zend_bool is_power_of_two(uint32_t n) {
ZEND_API zend_ast *zend_ast_list_add(zend_ast *ast, zend_ast *op) {
zend_ast_list *list = zend_ast_get_list(ast);
if (list->children >= 4 && is_power_of_two(list->children)) {
TSRMLS_FETCH();
list = zend_ast_realloc(list,
zend_ast_list_size(list->children), zend_ast_list_size(list->children * 2) TSRMLS_CC);
}

View File

@ -173,8 +173,6 @@ void zend_init_compiler_data_structures(TSRMLS_D) /* {{{ */
ZEND_API void file_handle_dtor(zend_file_handle *fh) /* {{{ */
{
TSRMLS_FETCH();
zend_file_handle_dtor(fh TSRMLS_CC);
}
/* }}} */

View File

@ -208,8 +208,6 @@ static int zval_call_destructor(zval *zv TSRMLS_DC) /* {{{ */
static void zend_unclean_zval_ptr_dtor(zval *zv) /* {{{ */
{
TSRMLS_FETCH();
if (Z_TYPE_P(zv) == IS_INDIRECT) {
zv = Z_INDIRECT_P(zv);
}
@ -487,7 +485,6 @@ ZEND_API zend_bool zend_is_executing(TSRMLS_D) /* {{{ */
ZEND_API void _zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC) /* {{{ */
{
TSRMLS_FETCH();
i_zval_ptr_dtor(zval_ptr ZEND_FILE_LINE_RELAY_CC TSRMLS_CC);
}
/* }}} */
@ -1146,8 +1143,6 @@ ZEND_API int zend_eval_string_ex(char *str, zval *retval_ptr, char *string_name,
ZEND_API void zend_timeout(int dummy) /* {{{ */
{
TSRMLS_FETCH();
if (zend_on_timeout) {
#ifdef ZEND_SIGNALS
/*
@ -1285,8 +1280,6 @@ void zend_shutdown_timeout_thread(void) /* {{{ */
void zend_set_timeout(zend_long seconds, int reset_signals) /* {{{ */
{
TSRMLS_FETCH();
EG(timeout_seconds) = seconds;
#ifdef ZEND_WIN32

View File

@ -252,9 +252,6 @@ static zend_always_inline zval *_zend_hash_add_or_update_i(HashTable *ht, zend_s
uint32_t nIndex;
uint32_t idx;
Bucket *p;
#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
#endif
IS_CONSISTENT(ht);
@ -407,9 +404,6 @@ static zend_always_inline zval *_zend_hash_index_add_or_update_i(HashTable *ht,
uint32_t nIndex;
uint32_t idx;
Bucket *p;
#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
#endif
IS_CONSISTENT(ht);
CHECK_INIT(ht, h < ht->nTableSize);
@ -547,9 +541,6 @@ ZEND_API zval *_zend_hash_next_index_insert_new(HashTable *ht, zval *pData ZEND_
static void zend_hash_do_resize(HashTable *ht)
{
#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
#endif
IS_CONSISTENT(ht);
@ -668,9 +659,6 @@ ZEND_API int zend_hash_del(HashTable *ht, zend_string *key)
uint32_t idx;
Bucket *p;
Bucket *prev = NULL;
#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
#endif
IS_CONSISTENT(ht);
@ -707,9 +695,6 @@ ZEND_API int zend_hash_del_ind(HashTable *ht, zend_string *key)
uint32_t idx;
Bucket *p;
Bucket *prev = NULL;
#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
#endif
IS_CONSISTENT(ht);
@ -759,9 +744,6 @@ ZEND_API int zend_hash_str_del(HashTable *ht, const char *str, size_t len)
uint32_t idx;
Bucket *p;
Bucket *prev = NULL;
#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
#endif
IS_CONSISTENT(ht);
@ -810,9 +792,6 @@ ZEND_API int zend_hash_str_del_ind(HashTable *ht, const char *str, size_t len)
uint32_t idx;
Bucket *p;
Bucket *prev = NULL;
#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
#endif
IS_CONSISTENT(ht);
@ -843,9 +822,6 @@ ZEND_API int zend_hash_index_del(HashTable *ht, zend_ulong h)
uint32_t idx;
Bucket *p;
Bucket *prev = NULL;
#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
#endif
IS_CONSISTENT(ht);
@ -961,10 +937,6 @@ ZEND_API void zend_hash_clean(HashTable *ht)
*/
static void zend_hash_apply_deleter(HashTable *ht, uint32_t idx, Bucket *p)
{
#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
#endif
HANDLE_BLOCK_INTERRUPTIONS();
_zend_hash_del_el(ht, idx, p);
HANDLE_UNBLOCK_INTERRUPTIONS();

View File

@ -551,7 +551,6 @@ static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_f
{
uint32_t parent_flags = parent->common.fn_flags;
zend_function *child;
TSRMLS_FETCH();
if ((child = zend_hash_find_ptr(child_function_table, key)) == NULL) {
if (parent_flags & (ZEND_ACC_ABSTRACT)) {

View File

@ -292,8 +292,6 @@ ZEND_API void zend_ini_refresh_caches(int stage TSRMLS_DC) /* {{{ */
ZEND_API int zend_alter_ini_entry(zend_string *name, zend_string *new_value, int modify_type, int stage) /* {{{ */
{
TSRMLS_FETCH();
return zend_alter_ini_entry_ex(name, new_value, modify_type, stage, 0 TSRMLS_CC);
}
/* }}} */
@ -302,7 +300,6 @@ ZEND_API int zend_alter_ini_entry_chars(zend_string *name, const char *value, si
{
int ret;
zend_string *new_value;
TSRMLS_FETCH();
new_value = zend_string_init(value, value_length, stage != ZEND_INI_STAGE_RUNTIME);
ret = zend_alter_ini_entry_ex(name, new_value, modify_type, stage, 0 TSRMLS_CC);
@ -378,7 +375,6 @@ ZEND_API int zend_alter_ini_entry_ex(zend_string *name, zend_string *new_value,
ZEND_API int zend_restore_ini_entry(zend_string *name, int stage) /* {{{ */
{
zend_ini_entry *ini_entry;
TSRMLS_FETCH();
if ((ini_entry = zend_hash_find_ptr(EG(ini_directives), name)) == NULL ||
(stage == ZEND_INI_STAGE_RUNTIME && (ini_entry->modifiable & ZEND_INI_USER) == 0)) {
@ -418,7 +414,6 @@ ZEND_API int zend_ini_register_displayer(char *name, uint name_length, void (*di
ZEND_API zend_long zend_ini_long(char *name, uint name_length, int orig) /* {{{ */
{
zend_ini_entry *ini_entry;
TSRMLS_FETCH();
ini_entry = zend_hash_str_find_ptr(EG(ini_directives), name, name_length);
if (ini_entry) {
@ -436,7 +431,6 @@ ZEND_API zend_long zend_ini_long(char *name, uint name_length, int orig) /* {{{
ZEND_API double zend_ini_double(char *name, uint name_length, int orig) /* {{{ */
{
zend_ini_entry *ini_entry;
TSRMLS_FETCH();
ini_entry = zend_hash_str_find_ptr(EG(ini_directives), name, name_length);
if (ini_entry) {
@ -454,7 +448,6 @@ ZEND_API double zend_ini_double(char *name, uint name_length, int orig) /* {{{ *
ZEND_API char *zend_ini_string_ex(char *name, uint name_length, int orig, zend_bool *exists) /* {{{ */
{
zend_ini_entry *ini_entry;
TSRMLS_FETCH();
ini_entry = zend_hash_str_find_ptr(EG(ini_directives), name, name_length);
if (ini_entry) {

View File

@ -158,7 +158,6 @@ static void ini_error(const char *msg)
char *error_buf;
int error_buf_len;
char *currently_parsed_filename;
TSRMLS_FETCH();
currently_parsed_filename = zend_ini_scanner_get_filename(TSRMLS_C);
if (currently_parsed_filename) {

View File

@ -1162,7 +1162,6 @@ static YYSIZE_T zend_yytnamerr(char *yyres, const char *yystr)
return yystrlen(yystr);
}
{
TSRMLS_FETCH();
if (CG(parse_error) == 0) {
char buffer[120];
const unsigned char *end, *str, *tok1 = NULL, *tok2 = NULL;

View File

@ -165,8 +165,6 @@ void list_entry_destructor(zval *zv)
zend_resource *res = Z_RES_P(zv);
if (res->type >= 0) {
TSRMLS_FETCH();
zend_resource_dtor(res TSRMLS_CC);
}
efree_size(res, sizeof(zend_resource));
@ -178,7 +176,6 @@ void plist_entry_destructor(zval *zv)
if (res->type >= 0) {
zend_rsrc_list_dtors_entry *ld;
TSRMLS_FETCH();
ld = zend_hash_index_find_ptr(&list_destructors, res->type);
if (ld) {

View File

@ -112,7 +112,6 @@ ZEND_API void destroy_zend_function(zend_function *function TSRMLS_DC)
ZEND_API void zend_function_dtor(zval *zv)
{
zend_function *function = Z_PTR_P(zv);
TSRMLS_FETCH();
if (function->type == ZEND_USER_FUNCTION) {
ZEND_ASSERT(function->common.function_name);

View File

@ -371,7 +371,6 @@ ZEND_API void convert_to_long_base(zval *op, int base) /* {{{ */
case IS_OBJECT:
{
zval dst;
TSRMLS_FETCH();
convert_object_to_type(op, &dst, IS_LONG, convert_to_long);
zval_dtor(op);
@ -429,7 +428,6 @@ ZEND_API void convert_to_double(zval *op) /* {{{ */
case IS_OBJECT:
{
zval dst;
TSRMLS_FETCH();
convert_object_to_type(op, &dst, IS_DOUBLE, convert_to_double);
zval_dtor(op);
@ -453,7 +451,6 @@ ZEND_API void convert_to_null(zval *op) /* {{{ */
if (Z_TYPE_P(op) == IS_OBJECT) {
if (Z_OBJ_HT_P(op)->cast_object) {
zval org;
TSRMLS_FETCH();
ZVAL_COPY_VALUE(&org, op);
if (Z_OBJ_HT_P(op)->cast_object(&org, op, IS_NULL TSRMLS_CC) == SUCCESS) {
@ -514,7 +511,6 @@ ZEND_API void convert_to_boolean(zval *op) /* {{{ */
case IS_OBJECT:
{
zval dst;
TSRMLS_FETCH();
convert_object_to_type(op, &dst, _IS_BOOL, convert_to_boolean);
zval_dtor(op);
@ -543,7 +539,6 @@ ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC) /* {{{ */
case IS_UNDEF:
case IS_NULL:
case IS_FALSE: {
TSRMLS_FETCH();
ZVAL_EMPTY_STRING(op);
break;
}
@ -565,7 +560,6 @@ ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC) /* {{{ */
case IS_DOUBLE: {
zend_string *str;
double dval = Z_DVAL_P(op);
TSRMLS_FETCH();
str = zend_strpprintf(0, "%.*G", (int) EG(precision), dval);
/* %G already handles removing trailing zeros from the fractional part, yay */
@ -579,7 +573,6 @@ ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC) /* {{{ */
break;
case IS_OBJECT: {
zval dst;
TSRMLS_FETCH();
convert_object_to_type(op, &dst, IS_STRING, convert_to_string);
@ -612,8 +605,6 @@ static void convert_scalar_to_array(zval *op TSRMLS_DC) /* {{{ */
ZEND_API void convert_to_array(zval *op) /* {{{ */
{
TSRMLS_FETCH();
switch (Z_TYPE_P(op)) {
case IS_ARRAY:
break;
@ -660,8 +651,6 @@ ZEND_API void convert_to_array(zval *op) /* {{{ */
ZEND_API void convert_to_object(zval *op) /* {{{ */
{
TSRMLS_FETCH();
switch (Z_TYPE_P(op)) {
case IS_ARRAY:
{
@ -2164,7 +2153,6 @@ try_again:
/* proxy object */
zval rv;
zval *val;
TSRMLS_FETCH();
val = Z_OBJ_HANDLER_P(op1, get)(op1, &rv TSRMLS_CC);
Z_ADDREF_P(val);
@ -2174,7 +2162,6 @@ try_again:
} else if (Z_OBJ_HANDLER_P(op1, do_operation)) {
zval op2;
int res;
TSRMLS_FETCH();
ZVAL_LONG(&op2, 1);
res = Z_OBJ_HANDLER_P(op1, do_operation)(ZEND_ADD, op1, op1, &op2 TSRMLS_CC);
@ -2239,7 +2226,6 @@ try_again:
/* proxy object */
zval rv;
zval *val;
TSRMLS_FETCH();
val = Z_OBJ_HANDLER_P(op1, get)(op1, &rv TSRMLS_CC);
Z_ADDREF_P(val);
@ -2249,7 +2235,6 @@ try_again:
} else if (Z_OBJ_HANDLER_P(op1, do_operation)) {
zval op2;
int res;
TSRMLS_FETCH();
ZVAL_LONG(&op2, 1);
res = Z_OBJ_HANDLER_P(op1, do_operation)(ZEND_SUB, op1, op1, &op2 TSRMLS_CC);
@ -2558,7 +2543,6 @@ ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2 TSRMLS_DC) /
ZEND_API void zend_locale_sprintf_double(zval *op ZEND_FILE_LINE_DC) /* {{{ */
{
zend_string *str;
TSRMLS_FETCH();
str = zend_strpprintf(0, "%.*G", (int) EG(precision), (double)Z_DVAL_P(op));
ZVAL_NEW_STR(op, str);

View File

@ -74,7 +74,6 @@ void zend_signal_handler_defer(int signo, siginfo_t *siginfo, void *context)
{
int errno_save = errno;
zend_signal_queue_t *queue, *qtmp;
TSRMLS_FETCH();
if (SIGG(active)) {
if (SIGG(depth) == 0) { /* try to handle signal */

View File

@ -39,7 +39,6 @@ ZEND_API void _zval_dtor_func(zend_refcounted *p ZEND_FILE_LINE_DC)
}
case IS_ARRAY: {
zend_array *arr = (zend_array*)p;
TSRMLS_FETCH();
if (arr != &EG(symbol_table)) {
/* break possible cycles */
@ -59,14 +58,12 @@ ZEND_API void _zval_dtor_func(zend_refcounted *p ZEND_FILE_LINE_DC)
}
case IS_OBJECT: {
zend_object *obj = (zend_object*)p;
TSRMLS_FETCH();
OBJ_RELEASE(obj);
break;
}
case IS_RESOURCE: {
zend_resource *res = (zend_resource*)p;
TSRMLS_FETCH();
if (--GC_REFCOUNT(res) == 0) {
/* destroy resource */
@ -99,7 +96,6 @@ ZEND_API void _zval_dtor_func_for_ptr(zend_refcounted *p ZEND_FILE_LINE_DC)
}
case IS_ARRAY: {
zend_array *arr = (zend_array*)p;
TSRMLS_FETCH();
if (arr != &EG(symbol_table)) {
/* break possible cycles */
@ -119,14 +115,12 @@ ZEND_API void _zval_dtor_func_for_ptr(zend_refcounted *p ZEND_FILE_LINE_DC)
}
case IS_OBJECT: {
zend_object *obj = (zend_object*)p;
TSRMLS_FETCH();
zend_objects_store_del(obj TSRMLS_CC);
break;
}
case IS_RESOURCE: {
zend_resource *res = (zend_resource*)p;
TSRMLS_FETCH();
/* destroy resource */
zend_list_free(res);
@ -238,7 +232,6 @@ ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC)
break;
case IS_ARRAY: {
HashTable *ht;
TSRMLS_FETCH();
if (Z_ARR_P(zvalue) == &EG(symbol_table)) {
return; /* do nothing */

View File

@ -304,7 +304,7 @@ int zend_optimizer_replace_by_const(zend_op_array *op_array,
ZVAL_COPY_VALUE(&old_val, val);
zval_copy_ctor(val);
zend_optimizer_update_op1_const(op_array, opline, val TSRMLS_CC);
zval_dtor(&old_val);
ZVAL_COPY_VALUE(val, &old_val);
opline++;
continue;
}

View File

@ -995,9 +995,12 @@ static int _extension_class_string(zval *el TSRMLS_DC, int num_args, va_list arg
int *num_classes = va_arg(args, int*);
if ((ce->type == ZEND_INTERNAL_CLASS) && ce->info.internal.module && !strcasecmp(ce->info.internal.module->name, module->name)) {
string_printf(str, "\n");
_class_string(str, ce, NULL, indent TSRMLS_CC);
(*num_classes)++;
/* dump class if it is not an alias */
if (!zend_binary_strcasecmp(ce->name->val, ce->name->len, hash_key->key->val, hash_key->key->len)) {
string_printf(str, "\n");
_class_string(str, ce, NULL, indent TSRMLS_CC);
(*num_classes)++;
}
}
return ZEND_HASH_APPLY_KEEP;
}
@ -5320,11 +5323,20 @@ static int add_extension_class(zval *zv TSRMLS_DC, int num_args, va_list args, z
int add_reflection_class = va_arg(args, int);
if ((ce->type == ZEND_INTERNAL_CLASS) && ce->info.internal.module && !strcasecmp(ce->info.internal.module->name, module->name)) {
zend_string *name;
if (zend_binary_strcasecmp(ce->name->val, ce->name->len, hash_key->key->val, hash_key->key->len)) {
/* This is an class alias, use alias name */
name = hash_key->key;
} else {
/* Use class name */
name = ce->name;
}
if (add_reflection_class) {
zend_reflection_class_factory(ce, &zclass TSRMLS_CC);
zend_hash_update(Z_ARRVAL_P(class_array), ce->name, &zclass);
zend_hash_update(Z_ARRVAL_P(class_array), name, &zclass);
} else {
add_next_index_str(class_array, zend_string_copy(ce->name));
add_next_index_str(class_array, zend_string_copy(name));
}
}
return ZEND_HASH_APPLY_KEEP;

View File

@ -48,7 +48,6 @@ static void php_sqlite3_error(php_sqlite3_db_object *db_obj, char *format, ...)
{
va_list arg;
char *message;
TSRMLS_FETCH();
va_start(arg, format);
vspprintf(&message, 0, format, arg);
@ -812,7 +811,6 @@ static int sqlite3_do_callback(struct php_sqlite3_fci *fc, zval *cb, int argc, s
static void php_sqlite3_callback_func(sqlite3_context *context, int argc, sqlite3_value **argv) /* {{{ */
{
php_sqlite3_func *func = (php_sqlite3_func *)sqlite3_user_data(context);
TSRMLS_FETCH();
sqlite3_do_callback(&func->afunc, &func->func, argc, argv, context, 0 TSRMLS_CC);
}
@ -823,7 +821,6 @@ static void php_sqlite3_callback_step(sqlite3_context *context, int argc, sqlite
php_sqlite3_func *func = (php_sqlite3_func *)sqlite3_user_data(context);
php_sqlite3_agg_context *agg_context = (php_sqlite3_agg_context *)sqlite3_aggregate_context(context, sizeof(php_sqlite3_agg_context));
TSRMLS_FETCH();
agg_context->row_count++;
sqlite3_do_callback(&func->astep, &func->step, argc, argv, context, 1 TSRMLS_CC);
@ -835,7 +832,6 @@ static void php_sqlite3_callback_final(sqlite3_context *context) /* {{{ */
php_sqlite3_func *func = (php_sqlite3_func *)sqlite3_user_data(context);
php_sqlite3_agg_context *agg_context = (php_sqlite3_agg_context *)sqlite3_aggregate_context(context, sizeof(php_sqlite3_agg_context));
TSRMLS_FETCH();
agg_context->row_count = 0;
sqlite3_do_callback(&func->afini, &func->fini, 0, NULL, context, 1 TSRMLS_CC);
@ -849,8 +845,6 @@ static int php_sqlite3_callback_compare(void *coll, int a_len, const void *a, in
zval retval;
int ret;
TSRMLS_FETCH();
collation->fci.fci.size = (sizeof(collation->fci.fci));
collation->fci.fci.function_table = EG(function_table);
ZVAL_COPY_VALUE(&collation->fci.fci.function_name, &collation->cmp_func);
@ -1966,7 +1960,6 @@ static int php_sqlite3_authorizer(void *autharg, int access_type, const char *ar
case SQLITE_ATTACH:
{
if (memcmp(arg3, ":memory:", sizeof(":memory:")) && *arg3) {
TSRMLS_FETCH();
#if PHP_API_VERSION < 20100412
if (PG(safe_mode) && (!php_checkuid(arg3, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {