cvs: ZendEngine2(PHP_5_3) / zend.h zend_ptr_stack.h zend_types.h zend_vm_def.h zend_vm_execute.h

"Arnaud Le Blanc" <[email protected]> Mon, 01 Jun 2009 15:07:48 -0000
Newsgroups gmane.comp.php.cvs.zend
Message-ID <cvslbarnaud1243868868@cvsserver>
lbarnaud		Mon Jun  1 15:07:48 2009 UTC

  Modified files:              (Branch: PHP_5_3)
    /ZendEngine2	zend.h zend_ptr_stack.h zend_types.h zend_vm_def.h 
                	zend_vm_execute.h 
  Log:
  MFH: better fix for #48409 , #48428 , #48228
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend.h?r1=1.293.2.11.2.9.2.33&r2=1.293.2.11.2.9.2.34&diff_format=u
Index: ZendEngine2/zend.h
diff -u ZendEngine2/zend.h:1.293.2.11.2.9.2.33 ZendEngine2/zend.h:1.293.2.11.2.9.2.34
--- ZendEngine2/zend.h:1.293.2.11.2.9.2.33	Wed Mar 18 01:08:12 2009
+++ ZendEngine2/zend.h	Mon Jun  1 15:07:42 2009
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend.h,v 1.293.2.11.2.9.2.33 2009/03/18 01:08:12 mattwil Exp $ */
+/* $Id: zend.h,v 1.293.2.11.2.9.2.34 2009/06/01 15:07:42 lbarnaud Exp $ */
 
 #ifndef ZEND_H
 #define ZEND_H
@@ -192,6 +192,12 @@
 # define ZEND_FASTCALL
 #endif
 
+#if defined(__GNUC__) && ZEND_GCC_VERSION >= 3400
+#else
+# define __restrict__
+#endif
+#define restrict __restrict__
+
 #if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(ZEND_WIN32)) && !(defined(ZTS) && defined(NETWARE)) && !(defined(ZTS) && defined(HPUX)) && !defined(DARWIN)
 # define ZEND_ALLOCA_MAX_SIZE (32 * 1024)
 # define ALLOCA_FLAG(name) \
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_ptr_stack.h?r1=1.22.2.2.2.1.2.3&r2=1.22.2.2.2.1.2.4&diff_format=u
Index: ZendEngine2/zend_ptr_stack.h
diff -u ZendEngine2/zend_ptr_stack.h:1.22.2.2.2.1.2.3 ZendEngine2/zend_ptr_stack.h:1.22.2.2.2.1.2.4
--- ZendEngine2/zend_ptr_stack.h:1.22.2.2.2.1.2.3	Wed Dec 31 11:15:32 2008
+++ ZendEngine2/zend_ptr_stack.h	Mon Jun  1 15:07:42 2009
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_ptr_stack.h,v 1.22.2.2.2.1.2.3 2008/12/31 11:15:32 sebastian Exp $ */
+/* $Id: zend_ptr_stack.h,v 1.22.2.2.2.1.2.4 2009/06/01 15:07:42 lbarnaud Exp $ */
 
 #ifndef ZEND_PTR_STACK_H
 #define ZEND_PTR_STACK_H
@@ -81,7 +81,7 @@
 #undef ZEND_PTR_STACK_NUM_ARGS
 }
 
-static inline void zend_ptr_stack_3_pop(zend_ptr_stack *stack, void **a, void **b, void **c)
+static inline void zend_ptr_stack_3_pop(zend_ptr_stack *stack, zend_alias *restrict a, zend_alias *restrict b, zend_alias *restrict c)
 {
 	*a = *(--stack->top_element);
 	*b = *(--stack->top_element);
@@ -89,7 +89,7 @@
 	stack->top -= 3;
 }
 
-static inline void zend_ptr_stack_2_pop(zend_ptr_stack *stack, void **a, void **b)
+static inline void zend_ptr_stack_2_pop(zend_ptr_stack *stack, zend_alias *restrict a, zend_alias *restrict b)
 {
 	*a = *(--stack->top_element);
 	*b = *(--stack->top_element);
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_types.h?r1=1.6.2.2.2.3.2.3&r2=1.6.2.2.2.3.2.4&diff_format=u
Index: ZendEngine2/zend_types.h
diff -u ZendEngine2/zend_types.h:1.6.2.2.2.3.2.3 ZendEngine2/zend_types.h:1.6.2.2.2.3.2.4
--- ZendEngine2/zend_types.h:1.6.2.2.2.3.2.3	Wed Dec 31 11:15:32 2008
+++ ZendEngine2/zend_types.h	Mon Jun  1 15:07:42 2009
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_types.h,v 1.6.2.2.2.3.2.3 2008/12/31 11:15:32 sebastian Exp $ */
+/* $Id: zend_types.h,v 1.6.2.2.2.3.2.4 2009/06/01 15:07:42 lbarnaud Exp $ */
 
 #ifndef ZEND_TYPES_H
 #define ZEND_TYPES_H
@@ -50,6 +50,12 @@
 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;
 
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_vm_def.h?r1=1.59.2.29.2.48.2.91&r2=1.59.2.29.2.48.2.92&diff_format=u
Index: ZendEngine2/zend_vm_def.h
diff -u ZendEngine2/zend_vm_def.h:1.59.2.29.2.48.2.91 ZendEngine2/zend_vm_def.h:1.59.2.29.2.48.2.92
--- ZendEngine2/zend_vm_def.h:1.59.2.29.2.48.2.91	Sat May 30 16:31:12 2009
+++ ZendEngine2/zend_vm_def.h	Mon Jun  1 15:07:42 2009
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_vm_def.h,v 1.59.2.29.2.48.2.91 2009/05/30 16:31:12 lbarnaud Exp $ */
+/* $Id: zend_vm_def.h,v 1.59.2.29.2.48.2.92 2009/06/01 15:07:42 lbarnaud Exp $ */
 
 /* If you change this file, please regenerate the zend_vm_execute.h and
  * zend_vm_opcodes.h files by running:
@@ -2288,9 +2288,7 @@
 		EG(called_scope) = EX(called_scope);
 	}
 
-	EX(called_scope) = zend_ptr_stack_pop(&EG(arg_types_stack));
-	EX(current_object) = zend_ptr_stack_pop(&EG(arg_types_stack));
-	EX(fbc) = zend_ptr_stack_pop(&EG(arg_types_stack));
+	zend_ptr_stack_3_pop(&EG(arg_types_stack), (zend_alias*)&EX(called_scope), (zend_alias*)&EX(current_object), (zend_alias*)&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) {
@@ -4298,8 +4296,7 @@
 			zval_ptr_dtor(&EX(object));
 		}
 		EX(called_scope) = DECODE_CTOR(EX(called_scope));
-		EX(object) = zend_ptr_stack_pop(&EG(arg_types_stack));
-		EX(fbc) = zend_ptr_stack_pop(&EG(arg_types_stack));
+		zend_ptr_stack_2_pop(&EG(arg_types_stack), (zend_alias*)&EX(object), (zend_alias*)&EX(fbc));
 	}
 
 	for (i=0; i<EX(op_array)->last_brk_cont; i++) {
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_vm_execute.h?r1=1.62.2.30.2.49.2.91&r2=1.62.2.30.2.49.2.92&diff_format=u
Index: ZendEngine2/zend_vm_execute.h
diff -u ZendEngine2/zend_vm_execute.h:1.62.2.30.2.49.2.91 ZendEngine2/zend_vm_execute.h:1.62.2.30.2.49.2.92
--- ZendEngine2/zend_vm_execute.h:1.62.2.30.2.49.2.91	Sat May 30 16:31:12 2009
+++ ZendEngine2/zend_vm_execute.h	Mon Jun  1 15:07:42 2009
@@ -290,9 +290,7 @@
 		EG(called_scope) = EX(called_scope);
 	}
 
-	EX(called_scope) = zend_ptr_stack_pop(&EG(arg_types_stack));
-	EX(current_object) = zend_ptr_stack_pop(&EG(arg_types_stack));
-	EX(fbc) = zend_ptr_stack_pop(&EG(arg_types_stack));
+	zend_ptr_stack_3_pop(&EG(arg_types_stack), (zend_alias*)&EX(called_scope), (zend_alias*)&EX(current_object), (zend_alias*)&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) {
@@ -638,8 +636,7 @@
 			zval_ptr_dtor(&EX(object));
 		}
 		EX(called_scope) = DECODE_CTOR(EX(called_scope));
-		EX(object) = zend_ptr_stack_pop(&EG(arg_types_stack));
-		EX(fbc) = zend_ptr_stack_pop(&EG(arg_types_stack));
+		zend_ptr_stack_2_pop(&EG(arg_types_stack), (zend_alias*)&EX(object), (zend_alias*)&EX(fbc));
 	}
 
 	for (i=0; i<EX(op_array)->last_brk_cont; i++) {



-- 
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php