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

[email protected] ("Arnaud Le Blanc") Mon, 01 Jun 2009 15:08:04 -0000
Newsgroups php.zend-engine.cvs
Message-ID <cvslbarnaud1243868884@cvsserver>
lbarnaud		Mon Jun  1 15:08:04 2009 UTC

  Modified files:              (Branch: PHP_5_2)
    /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.13&r2=1.293.2.11.2.14&diff_format=u
Index: ZendEngine2/zend.h
diff -u ZendEngine2/zend.h:1.293.2.11.2.13 ZendEngine2/zend.h:1.293.2.11.2.14
--- ZendEngine2/zend.h:1.293.2.11.2.13	Thu May 14 01:28:15 2009
+++ ZendEngine2/zend.h	Mon Jun  1 15:07:59 2009
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend.h,v 1.293.2.11.2.13 2009/05/14 01:28:15 mattwil Exp $ */
+/* $Id: zend.h,v 1.293.2.11.2.14 2009/06/01 15:07:59 lbarnaud Exp $ */
 
 #ifndef ZEND_H
 #define ZEND_H
@@ -178,6 +178,12 @@
 #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 do_alloca(p) alloca(p)
 # define free_alloca(p)
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_ptr_stack.h?r1=1.22.2.2.2.3&r2=1.22.2.2.2.4&diff_format=u
Index: ZendEngine2/zend_ptr_stack.h
diff -u ZendEngine2/zend_ptr_stack.h:1.22.2.2.2.3 ZendEngine2/zend_ptr_stack.h:1.22.2.2.2.4
--- ZendEngine2/zend_ptr_stack.h:1.22.2.2.2.3	Wed Dec 31 11:17:33 2008
+++ ZendEngine2/zend_ptr_stack.h	Mon Jun  1 15:07:59 2009
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_ptr_stack.h,v 1.22.2.2.2.3 2008/12/31 11:17:33 sebastian Exp $ */
+/* $Id: zend_ptr_stack.h,v 1.22.2.2.2.4 2009/06/01 15:07:59 lbarnaud Exp $ */
 
 #ifndef ZEND_PTR_STACK_H
 #define ZEND_PTR_STACK_H
@@ -79,7 +79,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);
@@ -87,7 +87,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.5&r2=1.6.2.2.2.6&diff_format=u
Index: ZendEngine2/zend_types.h
diff -u ZendEngine2/zend_types.h:1.6.2.2.2.5 ZendEngine2/zend_types.h:1.6.2.2.2.6
--- ZendEngine2/zend_types.h:1.6.2.2.2.5	Wed Dec 31 11:17:33 2008
+++ ZendEngine2/zend_types.h	Mon Jun  1 15:07:59 2009
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_types.h,v 1.6.2.2.2.5 2008/12/31 11:17:33 sebastian Exp $ */
+/* $Id: zend_types.h,v 1.6.2.2.2.6 2009/06/01 15:07:59 lbarnaud Exp $ */
 
 #ifndef ZEND_TYPES_H
 #define ZEND_TYPES_H
@@ -36,6 +36,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.68&r2=1.59.2.29.2.69&diff_format=u
Index: ZendEngine2/zend_vm_def.h
diff -u ZendEngine2/zend_vm_def.h:1.59.2.29.2.68 ZendEngine2/zend_vm_def.h:1.59.2.29.2.69
--- ZendEngine2/zend_vm_def.h:1.59.2.29.2.68	Sat May 30 16:35:26 2009
+++ ZendEngine2/zend_vm_def.h	Mon Jun  1 15:07:59 2009
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_vm_def.h,v 1.59.2.29.2.68 2009/05/30 16:35:26 lbarnaud Exp $ */
+/* $Id: zend_vm_def.h,v 1.59.2.29.2.69 2009/06/01 15:07:59 lbarnaud Exp $ */
 
 /* If you change this file, please regenerate the zend_vm_execute.h and
  * zend_vm_opcodes.h files by running:
@@ -2084,8 +2084,7 @@
 		EG(This) = current_this;
 		EG(scope) = current_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));
 
 	zend_ptr_stack_clear_multiple(TSRMLS_C);
 
@@ -3857,8 +3856,7 @@
 			}
 			zval_ptr_dtor(&EX(object));
 		}
-		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.71&r2=1.62.2.30.2.72&diff_format=u
Index: ZendEngine2/zend_vm_execute.h
diff -u ZendEngine2/zend_vm_execute.h:1.62.2.30.2.71 ZendEngine2/zend_vm_execute.h:1.62.2.30.2.72
--- ZendEngine2/zend_vm_execute.h:1.62.2.30.2.71	Sat May 30 16:35:26 2009
+++ ZendEngine2/zend_vm_execute.h	Mon Jun  1 15:08:00 2009
@@ -302,8 +302,7 @@
 		EG(This) = current_this;
 		EG(scope) = current_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));
 
 	zend_ptr_stack_clear_multiple(TSRMLS_C);
 
@@ -563,8 +562,7 @@
 			}
 			zval_ptr_dtor(&EX(object));
 		}
-		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++) {