]> granicus.if.org Git - php/commitdiff
MFH: better fix for #48409 , #48428 , #48228
authorArnaud Le Blanc <lbarnaud@php.net>
Fri, 5 Jun 2009 11:21:31 +0000 (11:21 +0000)
committerArnaud Le Blanc <lbarnaud@php.net>
Fri, 5 Jun 2009 11:21:31 +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 326c9ccab3dc109b0e9347d651c00adadb83b7b2..49837a94a42929708cbd94709be5aebc3fe059ba 100644 (file)
@@ -290,6 +290,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 fb613b88c732cec7e6fecd120991954bd927d2ca..f20e3d91e85ab6c2be98ada974db472a1f1c0118 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 bdd15c8da50552b75b7c7a89a7045619222d1419..af3205f03e430242d0bb3352370da9f001922f48 100644 (file)
@@ -2288,7 +2288,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) {
@@ -4288,7 +4288,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 54954dbcaa479f4d8e3a72bec3ebe7c3c64f5eeb..24794f7db0fb5d732862e20e45f1aeaaee6d7bf3 100644 (file)
@@ -290,7 +290,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) {
@@ -636,7 +636,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++) {