]> granicus.if.org Git - php/commitdiff
better fix for #48409 , #48428 , #48228
authorArnaud Le Blanc <lbarnaud@php.net>
Fri, 5 Jun 2009 11:21:16 +0000 (11:21 +0000)
committerArnaud Le Blanc <lbarnaud@php.net>
Fri, 5 Jun 2009 11:21:16 +0000 (11:21 +0000)
# (again, sorry)

Zend/zend_execute.h
Zend/zend_ptr_stack.h
Zend/zend_types.h
Zend/zend_vm_def.h
Zend/zend_vm_execute.h

index e451a09d50e61de3ff8be1295768399d185e7f54..0ff32fcccb72049b40e997078bdbd8fd8d51753a 100644 (file)
@@ -306,6 +306,27 @@ static inline zval** zend_vm_stack_get_arg(int requested_arg TSRMLS_DC)
        return (zval**)p - arg_count + requested_arg - 1;
 }
 
+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 7230375c5d0895e73eb434a320fdedd16780dfb3..ffa074608e3f9edead3ad144ef0b3f99ddf05930 100644 (file)
@@ -81,7 +81,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);
@@ -89,7 +89,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 e3d765529c88f91b09314bd04c7d16888e88f9ce..124adf4adfa0c19f9bbbea26af7919087799311d 100644 (file)
@@ -50,12 +50,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 4a3e667bf50e09f19a3a95914abf3542245c62d7..bd762a2240790d849d0009f7605072312d5f3fbb 100644 (file)
@@ -2362,7 +2362,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
                EG(called_scope) = EX(called_scope);
        }
 
-       zend_ptr_stack_3_pop(&EG(arg_types_stack), (zend_alias*)&EX(called_scope), (zend_alias*)&EX(current_object), (zend_alias*)&EX(fbc));
+       zend_arg_types_stack_3_pop(&EG(arg_types_stack), &EX(called_scope), &EX(current_object), &EX(fbc));
        EX(function_state).arguments = zend_vm_stack_push_args(opline->extended_value TSRMLS_CC);
 
        if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION) {
@@ -4480,7 +4480,7 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
                        zval_ptr_dtor(&EX(object));
                }
                EX(called_scope) = DECODE_CTOR(EX(called_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));
        }
 
        for (i=0; i<EX(op_array)->last_brk_cont; i++) {
index 2277abb3e6d083b68ce9736a76d0ff509619c8d2..b2b89bf26d0c74ca597a7ecca11c8a6335474fcc 100644 (file)
@@ -298,7 +298,7 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
                EG(called_scope) = EX(called_scope);
        }
 
-       zend_ptr_stack_3_pop(&EG(arg_types_stack), (zend_alias*)&EX(called_scope), (zend_alias*)&EX(current_object), (zend_alias*)&EX(fbc));
+       zend_arg_types_stack_3_pop(&EG(arg_types_stack), &EX(called_scope), &EX(current_object), &EX(fbc));
        EX(function_state).arguments = zend_vm_stack_push_args(opline->extended_value TSRMLS_CC);
 
        if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION) {
@@ -644,7 +644,7 @@ static int ZEND_FASTCALL  ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER
                        zval_ptr_dtor(&EX(object));
                }
                EX(called_scope) = DECODE_CTOR(EX(called_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));
        }
 
        for (i=0; i<EX(op_array)->last_brk_cont; i++) {