From: Arnaud Le Blanc Date: Fri, 5 Jun 2009 11:21:47 +0000 (+0000) Subject: better fix for #48409 , #48428 , #48228 X-Git-Tag: php-5.2.10RC2~30 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c3e1afc2a34acaa31f9da8039db6950df79ee1da;p=php better fix for #48409 , #48428 , #48228 --- diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index 147d1992ba..d3686fc135 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -169,6 +169,27 @@ static inline int zend_ptr_stack_get_arg(int requested_arg, void **data TSRMLS_D return SUCCESS; } +static inline void zend_arg_types_stack_2_pop(zend_ptr_stack *stack, zval **object, zend_function **fbc) +{ + void *a, *b; + + zend_ptr_stack_2_pop(stack, &a, &b); + + *object = a; + *fbc = b; +} + +static inline void zend_arg_types_stack_3_pop(zend_ptr_stack *stack, zend_class_entry **called_scope, zval **object, zend_function **fbc) +{ + void *a, *b, *c; + + zend_ptr_stack_3_pop(stack, &a, &b, &c); + + *called_scope = a; + *object = b; + *fbc = c; +} + void execute_new_code(TSRMLS_D); diff --git a/Zend/zend_ptr_stack.h b/Zend/zend_ptr_stack.h index a689c39c5a..10a9fd2b80 100644 --- a/Zend/zend_ptr_stack.h +++ b/Zend/zend_ptr_stack.h @@ -79,7 +79,7 @@ static inline void zend_ptr_stack_2_push(zend_ptr_stack *stack, void *a, void *b #undef ZEND_PTR_STACK_NUM_ARGS } -static inline void zend_ptr_stack_3_pop(zend_ptr_stack *stack, zend_alias *restrict a, zend_alias *restrict b, zend_alias *restrict c) +static inline void zend_ptr_stack_3_pop(zend_ptr_stack *stack, void **a, void **b, void **c) { *a = *(--stack->top_element); *b = *(--stack->top_element); @@ -87,7 +87,7 @@ static inline void zend_ptr_stack_3_pop(zend_ptr_stack *stack, zend_alias *restr stack->top -= 3; } -static inline void zend_ptr_stack_2_pop(zend_ptr_stack *stack, zend_alias *restrict a, zend_alias *restrict b) +static inline void zend_ptr_stack_2_pop(zend_ptr_stack *stack, void **a, void **b) { *a = *(--stack->top_element); *b = *(--stack->top_element); diff --git a/Zend/zend_types.h b/Zend/zend_types.h index 09c840a54c..69fa16dc98 100644 --- a/Zend/zend_types.h +++ b/Zend/zend_types.h @@ -36,12 +36,6 @@ typedef long zend_intptr_t; typedef unsigned long zend_uintptr_t; #endif -#if defined(__GNUC__) && ZEND_GCC_VERSION >= 3400 -typedef void* __attribute__((__may_alias__)) zend_alias; -#else -typedef void* zend_alias; -#endif - typedef unsigned int zend_object_handle; typedef struct _zend_object_handlers zend_object_handlers; diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 51878d275a..205724dbc5 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -2084,7 +2084,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY) EG(This) = current_this; EG(scope) = current_scope; } - zend_ptr_stack_2_pop(&EG(arg_types_stack), (zend_alias*)&EX(object), (zend_alias*)&EX(fbc)); + zend_arg_types_stack_2_pop(&EG(arg_types_stack), &EX(object), &EX(fbc)); zend_ptr_stack_clear_multiple(TSRMLS_C); @@ -3856,7 +3856,7 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY) } zval_ptr_dtor(&EX(object)); } - zend_ptr_stack_2_pop(&EG(arg_types_stack), (zend_alias*)&EX(object), (zend_alias*)&EX(fbc)); + zend_arg_types_stack_2_pop(&EG(arg_types_stack), &EX(object), &EX(fbc)); } for (i=0; ilast_brk_cont; i++) { diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 801e585486..37b493bb83 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -302,7 +302,7 @@ static int zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS) EG(This) = current_this; EG(scope) = current_scope; } - zend_ptr_stack_2_pop(&EG(arg_types_stack), (zend_alias*)&EX(object), (zend_alias*)&EX(fbc)); + zend_arg_types_stack_2_pop(&EG(arg_types_stack), &EX(object), &EX(fbc)); zend_ptr_stack_clear_multiple(TSRMLS_C); @@ -562,7 +562,7 @@ static int ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) } zval_ptr_dtor(&EX(object)); } - zend_ptr_stack_2_pop(&EG(arg_types_stack), (zend_alias*)&EX(object), (zend_alias*)&EX(fbc)); + zend_arg_types_stack_2_pop(&EG(arg_types_stack), &EX(object), &EX(fbc)); } for (i=0; ilast_brk_cont; i++) {