]> granicus.if.org Git - php/commitdiff
better fix for #48409 , #48428 , #48228
authorArnaud Le Blanc <lbarnaud@php.net>
Fri, 5 Jun 2009 11:21:47 +0000 (11:21 +0000)
committerArnaud Le Blanc <lbarnaud@php.net>
Fri, 5 Jun 2009 11:21:47 +0000 (11:21 +0000)
Zend/zend_execute.h
Zend/zend_ptr_stack.h
Zend/zend_types.h
Zend/zend_vm_def.h
Zend/zend_vm_execute.h

index 147d1992ba8f6771053845ad7ced8285792c7384..d3686fc13563b87392211280fc291c264bda952b 100644 (file)
@@ -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);
 
 
index a689c39c5a02d8110a07a61591f42e49df6005e3..10a9fd2b808fcb400025ff2c2c85b422f8194121 100644 (file)
@@ -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);
index 09c840a54c55b119f8c9894c3383d82adf0c050f..69fa16dc984c833e9b8adbe34afaaa8f6ae12507 100644 (file)
@@ -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;
 
index 51878d275abdaac7802674c2fd789dfef5749ba5..205724dbc554a11a46b5bc5cc156e35dab3d4cbf 100644 (file)
@@ -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; i<EX(op_array)->last_brk_cont; i++) {
index 801e5854867ed23e81ea441df0e09c94b4c01097..37b493bb83ee5ff5ae347aa9e69ea1aed452c14c 100644 (file)
@@ -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; i<EX(op_array)->last_brk_cont; i++) {