Skip to content

Commit c3e1afc

Browse files
committed
better fix for #48409 , #48428 , #48228
1 parent 6a05922 commit c3e1afc

File tree

5 files changed

+27
-12
lines changed

5 files changed

+27
-12
lines changed

Zend/zend_execute.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,27 @@ static inline int zend_ptr_stack_get_arg(int requested_arg, void **data TSRMLS_D
169169
return SUCCESS;
170170
}
171171

172+
static inline void zend_arg_types_stack_2_pop(zend_ptr_stack *stack, zval **object, zend_function **fbc)
173+
{
174+
void *a, *b;
175+
176+
zend_ptr_stack_2_pop(stack, &a, &b);
177+
178+
*object = a;
179+
*fbc = b;
180+
}
181+
182+
static inline void zend_arg_types_stack_3_pop(zend_ptr_stack *stack, zend_class_entry **called_scope, zval **object, zend_function **fbc)
183+
{
184+
void *a, *b, *c;
185+
186+
zend_ptr_stack_3_pop(stack, &a, &b, &c);
187+
188+
*called_scope = a;
189+
*object = b;
190+
*fbc = c;
191+
}
192+
172193
void execute_new_code(TSRMLS_D);
173194

174195

Zend/zend_ptr_stack.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ static inline void zend_ptr_stack_2_push(zend_ptr_stack *stack, void *a, void *b
7979
#undef ZEND_PTR_STACK_NUM_ARGS
8080
}
8181

82-
static inline void zend_ptr_stack_3_pop(zend_ptr_stack *stack, zend_alias *restrict a, zend_alias *restrict b, zend_alias *restrict c)
82+
static inline void zend_ptr_stack_3_pop(zend_ptr_stack *stack, void **a, void **b, void **c)
8383
{
8484
*a = *(--stack->top_element);
8585
*b = *(--stack->top_element);
8686
*c = *(--stack->top_element);
8787
stack->top -= 3;
8888
}
8989

90-
static inline void zend_ptr_stack_2_pop(zend_ptr_stack *stack, zend_alias *restrict a, zend_alias *restrict b)
90+
static inline void zend_ptr_stack_2_pop(zend_ptr_stack *stack, void **a, void **b)
9191
{
9292
*a = *(--stack->top_element);
9393
*b = *(--stack->top_element);

Zend/zend_types.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,6 @@ typedef long zend_intptr_t;
3636
typedef unsigned long zend_uintptr_t;
3737
#endif
3838

39-
#if defined(__GNUC__) && ZEND_GCC_VERSION >= 3400
40-
typedef void* __attribute__((__may_alias__)) zend_alias;
41-
#else
42-
typedef void* zend_alias;
43-
#endif
44-
4539
typedef unsigned int zend_object_handle;
4640
typedef struct _zend_object_handlers zend_object_handlers;
4741

Zend/zend_vm_def.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2084,7 +2084,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
20842084
EG(This) = current_this;
20852085
EG(scope) = current_scope;
20862086
}
2087-
zend_ptr_stack_2_pop(&EG(arg_types_stack), (zend_alias*)&EX(object), (zend_alias*)&EX(fbc));
2087+
zend_arg_types_stack_2_pop(&EG(arg_types_stack), &EX(object), &EX(fbc));
20882088

20892089
zend_ptr_stack_clear_multiple(TSRMLS_C);
20902090

@@ -3856,7 +3856,7 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
38563856
}
38573857
zval_ptr_dtor(&EX(object));
38583858
}
3859-
zend_ptr_stack_2_pop(&EG(arg_types_stack), (zend_alias*)&EX(object), (zend_alias*)&EX(fbc));
3859+
zend_arg_types_stack_2_pop(&EG(arg_types_stack), &EX(object), &EX(fbc));
38603860
}
38613861

38623862
for (i=0; i<EX(op_array)->last_brk_cont; i++) {

Zend/zend_vm_execute.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ static int zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
302302
EG(This) = current_this;
303303
EG(scope) = current_scope;
304304
}
305-
zend_ptr_stack_2_pop(&EG(arg_types_stack), (zend_alias*)&EX(object), (zend_alias*)&EX(fbc));
305+
zend_arg_types_stack_2_pop(&EG(arg_types_stack), &EX(object), &EX(fbc));
306306

307307
zend_ptr_stack_clear_multiple(TSRMLS_C);
308308

@@ -562,7 +562,7 @@ static int ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
562562
}
563563
zval_ptr_dtor(&EX(object));
564564
}
565-
zend_ptr_stack_2_pop(&EG(arg_types_stack), (zend_alias*)&EX(object), (zend_alias*)&EX(fbc));
565+
zend_arg_types_stack_2_pop(&EG(arg_types_stack), &EX(object), &EX(fbc));
566566
}
567567

568568
for (i=0; i<EX(op_array)->last_brk_cont; i++) {

0 commit comments

Comments
 (0)