[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/NEWS branches/PHP_5_4/Zend/zend_object_handlers.c trunk/Zend/zend_object_handlers.c

2011-12-19 Thread Xinchen Hui
laruence Mon, 19 Dec 2011 09:58:29 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=321158

Log:
Fixed bug #60558 (Invalid read and writes)

Bug: https://bugs.php.net/60558 (Open) Invalid read and writes
  
Changed paths:
U   php/php-src/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/Zend/zend_object_handlers.c
U   php/php-src/trunk/Zend/zend_object_handlers.c

Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS   2011-12-19 09:57:38 UTC (rev 321157)
+++ php/php-src/branches/PHP_5_4/NEWS   2011-12-19 09:58:29 UTC (rev 321158)
@@ -7,6 +7,7 @@
   . Fixed bug #60536 (Traits Segfault). (Laruence)
   . Fixed bug #60362 (non-existent sub-sub keys should not have values).
 (Laruence, alan_k, Stas)
+  . Fixed bug #60558 (Invalid read and writes). (Laruence)

 - CLI SAPI:
   . Fixed bug #60477 (Segfault after two multipart/form-data POST requests,

Modified: php/php-src/branches/PHP_5_4/Zend/zend_object_handlers.c
===
--- php/php-src/branches/PHP_5_4/Zend/zend_object_handlers.c2011-12-19 
09:57:38 UTC (rev 321157)
+++ php/php-src/branches/PHP_5_4/Zend/zend_object_handlers.c2011-12-19 
09:58:29 UTC (rev 321158)
@@ -85,6 +85,7 @@
prop_info-offset = 0 

zobj-properties_table[prop_info-offset]) {
if 
(UNEXPECTED(flags[prop_info-offset])) {
+   Z_ADDREF_P(*(zval 
**)zobj-properties_table[prop_info-offset]);

zend_hash_quick_add(zobj-properties, prop_info-name, 
prop_info-name_length+1, prop_info-h, 
(void**)zobj-properties_table[prop_info-offset], sizeof(zval*), 
(void**)zobj-properties_table[prop_info-offset]);
} else {

zend_hash_quick_add(zobj-properties, prop_info-name, 
prop_info-name_length+1, prop_info-h, 
(void**)zobj-properties_table[prop_info-offset], sizeof(zval*), 
(void**)zobj-properties_table[prop_info-offset]);

Modified: php/php-src/trunk/Zend/zend_object_handlers.c
===
--- php/php-src/trunk/Zend/zend_object_handlers.c   2011-12-19 09:57:38 UTC 
(rev 321157)
+++ php/php-src/trunk/Zend/zend_object_handlers.c   2011-12-19 09:58:29 UTC 
(rev 321158)
@@ -85,6 +85,7 @@
prop_info-offset = 0 

zobj-properties_table[prop_info-offset]) {
if 
(UNEXPECTED(flags[prop_info-offset])) {
+   Z_ADDREF_P(*(zval 
**)zobj-properties_table[prop_info-offset]);

zend_hash_quick_add(zobj-properties, prop_info-name, 
prop_info-name_length+1, prop_info-h, 
(void**)zobj-properties_table[prop_info-offset], sizeof(zval*), 
(void**)zobj-properties_table[prop_info-offset]);
} else {

zend_hash_quick_add(zobj-properties, prop_info-name, 
prop_info-name_length+1, prop_info-h, 
(void**)zobj-properties_table[prop_info-offset], sizeof(zval*), 
(void**)zobj-properties_table[prop_info-offset]);

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/Zend/zend_compile.c trunk/Zend/zend_compile.c

2011-12-19 Thread Xinchen Hui
laruence Mon, 19 Dec 2011 10:05:48 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=321159

Log:
Codes standard  Remove useless empty lines

Changed paths:
U   php/php-src/branches/PHP_5_4/Zend/zend_compile.c
U   php/php-src/trunk/Zend/zend_compile.c

Modified: php/php-src/branches/PHP_5_4/Zend/zend_compile.c
===
--- php/php-src/branches/PHP_5_4/Zend/zend_compile.c	2011-12-19 09:58:29 UTC (rev 321158)
+++ php/php-src/branches/PHP_5_4/Zend/zend_compile.c	2011-12-19 10:05:48 UTC (rev 321159)
@@ -115,7 +115,6 @@
 }
 /* }}} */

-
 static void zend_duplicate_property_info_internal(zend_property_info *property_info) /* {{{ */
 {
 	if (!IS_INTERNED(property_info-name)) {
@@ -124,7 +123,6 @@
 }
 /* }}} */

-
 static void zend_destroy_property_info(zend_property_info *property_info) /* {{{ */
 {
 	str_efree(property_info-name);
@@ -134,7 +132,6 @@
 }
 /* }}} */

-
 static void zend_destroy_property_info_internal(zend_property_info *property_info) /* {{{ */
 {
 	str_free((char*)property_info-name);
@@ -167,7 +164,6 @@
 }
 /* }}} */

-
 static void init_compiler_declarables(TSRMLS_D) /* {{{ */
 {
 	Z_TYPE(CG(declarables).ticks) = IS_LONG;
@@ -211,7 +207,6 @@
 }
 /* }}} */

-
 ZEND_API void file_handle_dtor(zend_file_handle *fh) /* {{{ */
 {
 	TSRMLS_FETCH();
@@ -220,7 +215,6 @@
 }
 /* }}} */

-
 void init_compiler(TSRMLS_D) /* {{{ */
 {
 	CG(active_op_array) = NULL;
@@ -232,7 +226,6 @@
 }
 /* }}} */

-
 void shutdown_compiler(TSRMLS_D) /* {{{ */
 {
 	zend_stack_destroy(CG(bp_stack));
@@ -248,7 +241,6 @@
 }
 /* }}} */

-
 ZEND_API char *zend_set_compiled_filename(const char *new_compiled_filename TSRMLS_DC) /* {{{ */
 {
 	char **pp, *p;
@@ -265,35 +257,30 @@
 }
 /* }}} */

-
 ZEND_API void zend_restore_compiled_filename(char *original_compiled_filename TSRMLS_DC) /* {{{ */
 {
 	CG(compiled_filename) = original_compiled_filename;
 }
 /* }}} */

-
 ZEND_API char *zend_get_compiled_filename(TSRMLS_D) /* {{{ */
 {
 	return CG(compiled_filename);
 }
 /* }}} */

-
 ZEND_API int zend_get_compiled_lineno(TSRMLS_D) /* {{{ */
 {
 	return CG(zend_lineno);
 }
 /* }}} */

-
 ZEND_API zend_bool zend_is_compiling(TSRMLS_D) /* {{{ */
 {
 	return CG(in_compilation);
 }
 /* }}} */

-
 static zend_uint get_temporary_variable(zend_op_array *op_array) /* {{{ */
 {
 	return (op_array-T)++ * ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable));
@@ -609,7 +596,6 @@

 #define MAKE_NOP(opline)	{ opline-opcode = ZEND_NOP;  memset(opline-result,0,sizeof(opline-result)); memset(opline-op1,0,sizeof(opline-op1)); memset(opline-op2,0,sizeof(opline-op2)); opline-result_type=opline-op1_type=opline-op2_type=IS_UNUSED;  }

-
 static void zend_do_op_data(zend_op *data_op, const znode *value TSRMLS_DC) /* {{{ */
 {
 	data_op-opcode = ZEND_OP_DATA;
@@ -3677,7 +3663,6 @@
 }
 /* }}} */

-
 /* {{{ Originates from php_runkit_function_copy_ctor
 	Duplicate structures in an op_array where necessary to make an outright duplicate */
 static void zend_traits_duplicate_function(zend_function *fe, zend_class_entry *target_ce, char *newname TSRMLS_DC)
@@ -3810,7 +3795,7 @@
 	fe-op_array.try_catch_array = (zend_try_catch_element*)estrndup((char*)fe-op_array.try_catch_array, sizeof(zend_try_catch_element) * fe-op_array.last_try_catch);

 	fe-op_array.brk_cont_array = (zend_brk_cont_element*)estrndup((char*)fe-op_array.brk_cont_array, sizeof(zend_brk_cont_element) * fe-op_array.last_brk_cont);
-
+
 }
 /* }}} */

@@ -3868,32 +3853,32 @@
 	} else if (existing_fn-common.scope != ce) {
 		add = 1; /* or inherited from other class or interface */
 	}
-
+
 	if (add) {
 		zend_function* parent_function;
 		if (ce-parent  zend_hash_quick_find(ce-parent-function_table, hash_key-arKey, hash_key-nKeyLength, hash_key-h, (void**) parent_function) != FAILURE) {
 			prototype = parent_function; /* -common.fn_flags |= ZEND_ACC_ABSTRACT; */

 			/* we got that method in the parent class, and are going to override it,
-			   except, if the trait is just asking to have an abstract method implemented. */
+			  except, if the trait is just asking to have an abstract method implemented. */
 			if (fn-common.fn_flags  ZEND_ACC_ABSTRACT) {
 /* then we clean up an skip this method */
 zend_function_dtor(fn);
 return ZEND_HASH_APPLY_REMOVE;
 			}
 		}
-
+
 		fn-common.scope = ce;
 		fn-common.prototype = prototype;
-
+
 		if (prototype
 			 (prototype-common.fn_flags  ZEND_ACC_IMPLEMENTED_ABSTRACT
-|| prototype-common.fn_flags  ZEND_ACC_ABSTRACT)) {
-fn-common.fn_flags |= ZEND_ACC_IMPLEMENTED_ABSTRACT;
-			} else if (fn-common.fn_flags  ZEND_ACC_IMPLEMENTED_ABSTRACT) {
-/* remove ZEND_ACC_IMPLEMENTED_ABSTRACT flag, think it shouldn't be copied to class */
-fn-common.fn_flags = fn-common.fn_flags - ZEND_ACC_IMPLEMENTED_ABSTRACT;
-			}
+			|| prototype-common.fn_flags  ZEND_ACC_ABSTRACT)) {
+			fn-common.fn_flags |= ZEND_ACC_IMPLEMENTED_ABSTRACT;
+		} else if 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/NEWS branches/PHP_5_4/Zend/zend_object_handlers.c trunk/Zend/zend_object_handlers.c

2011-12-19 Thread Xinchen Hui
laruence Mon, 19 Dec 2011 12:00:09 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=321161

Log:
Revert previous bad fix, introduce memory leak

Changed paths:
U   php/php-src/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/Zend/zend_object_handlers.c
U   php/php-src/trunk/Zend/zend_object_handlers.c

Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS   2011-12-19 10:50:15 UTC (rev 321160)
+++ php/php-src/branches/PHP_5_4/NEWS   2011-12-19 12:00:09 UTC (rev 321161)
@@ -7,7 +7,6 @@
   . Fixed bug #60536 (Traits Segfault). (Laruence)
   . Fixed bug #60362 (non-existent sub-sub keys should not have values).
 (Laruence, alan_k, Stas)
-  . Fixed bug #60558 (Invalid read and writes). (Laruence)

 - CLI SAPI:
   . Fixed bug #60477 (Segfault after two multipart/form-data POST requests,

Modified: php/php-src/branches/PHP_5_4/Zend/zend_object_handlers.c
===
--- php/php-src/branches/PHP_5_4/Zend/zend_object_handlers.c2011-12-19 
10:50:15 UTC (rev 321160)
+++ php/php-src/branches/PHP_5_4/Zend/zend_object_handlers.c2011-12-19 
12:00:09 UTC (rev 321161)
@@ -85,7 +85,6 @@
prop_info-offset = 0 

zobj-properties_table[prop_info-offset]) {
if 
(UNEXPECTED(flags[prop_info-offset])) {
-   Z_ADDREF_P(*(zval 
**)zobj-properties_table[prop_info-offset]);

zend_hash_quick_add(zobj-properties, prop_info-name, 
prop_info-name_length+1, prop_info-h, 
(void**)zobj-properties_table[prop_info-offset], sizeof(zval*), 
(void**)zobj-properties_table[prop_info-offset]);
} else {

zend_hash_quick_add(zobj-properties, prop_info-name, 
prop_info-name_length+1, prop_info-h, 
(void**)zobj-properties_table[prop_info-offset], sizeof(zval*), 
(void**)zobj-properties_table[prop_info-offset]);

Modified: php/php-src/trunk/Zend/zend_object_handlers.c
===
--- php/php-src/trunk/Zend/zend_object_handlers.c   2011-12-19 10:50:15 UTC 
(rev 321160)
+++ php/php-src/trunk/Zend/zend_object_handlers.c   2011-12-19 12:00:09 UTC 
(rev 321161)
@@ -85,7 +85,6 @@
prop_info-offset = 0 

zobj-properties_table[prop_info-offset]) {
if 
(UNEXPECTED(flags[prop_info-offset])) {
-   Z_ADDREF_P(*(zval 
**)zobj-properties_table[prop_info-offset]);

zend_hash_quick_add(zobj-properties, prop_info-name, 
prop_info-name_length+1, prop_info-h, 
(void**)zobj-properties_table[prop_info-offset], sizeof(zval*), 
(void**)zobj-properties_table[prop_info-offset]);
} else {

zend_hash_quick_add(zobj-properties, prop_info-name, 
prop_info-name_length+1, prop_info-h, 
(void**)zobj-properties_table[prop_info-offset], sizeof(zval*), 
(void**)zobj-properties_table[prop_info-offset]);

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/NEWS branches/PHP_5_4/Zend/zend_compile.c branches/PHP_5_4/Zend/zend_object_handlers.c trunk/Zend/zend_compile.c trunk/Zend/zend_object_handlers.c

2011-12-19 Thread Xinchen Hui
laruence Mon, 19 Dec 2011 16:48:18 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=321166

Log:
Fixed bug #60558 (Invalid read and writes)
Re-Fixed bug #60536 (Traits Segfault)
#Thanks to tony2001, I found the previous fix -r321089 is actually not a 
correct one.
#The key problem there is because the traits didn't correct set the 
property_info.offset
#for private properties. so here come the new fix.

Bugs: https://bugs.php.net/60558 (Re-Opened) Invalid read and writes
  https://bugs.php.net/60536 (Closed) Traits Segfault
  
Changed paths:
U   php/php-src/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/Zend/zend_compile.c
U   php/php-src/branches/PHP_5_4/Zend/zend_object_handlers.c
U   php/php-src/trunk/Zend/zend_compile.c
U   php/php-src/trunk/Zend/zend_object_handlers.c

Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS	2011-12-19 16:14:50 UTC (rev 321165)
+++ php/php-src/branches/PHP_5_4/NEWS	2011-12-19 16:48:18 UTC (rev 321166)
@@ -7,6 +7,7 @@
   . Fixed bug #60536 (Traits Segfault). (Laruence)
   . Fixed bug #60362 (non-existent sub-sub keys should not have values).
 (Laruence, alan_k, Stas)
+  . Fixed bug #60558 (Invalid read and writes). (Laruence)

 - CLI SAPI:
   . Fixed bug #60477 (Segfault after two multipart/form-data POST requests,

Modified: php/php-src/branches/PHP_5_4/Zend/zend_compile.c
===
--- php/php-src/branches/PHP_5_4/Zend/zend_compile.c	2011-12-19 16:14:50 UTC (rev 321165)
+++ php/php-src/branches/PHP_5_4/Zend/zend_compile.c	2011-12-19 16:48:18 UTC (rev 321166)
@@ -4208,6 +4208,50 @@
 }
 /* }}} */

+static void zend_traits_register_private_property(zend_class_entry *ce, const char *name, int name_len, zend_property_info *old_info, zval *property TSRMLS_DC) /* {{{ */
+{
+	char *priv_name;
+	int priv_name_length;
+	const char *interned_name;
+	zend_property_info property_info;
+	ulong h = zend_get_hash_value(name, name_len+1);
+	property_info = *old_info;
+
+	if (old_info-flags  ZEND_ACC_STATIC) {
+		property_info.offset = ce-default_static_members_count++;
+		ce-default_static_members_table = perealloc(ce-default_static_members_table, sizeof(zval*) * ce-default_static_members_count, ce-type == ZEND_INTERNAL_CLASS);
+		ce-default_static_members_table[property_info.offset] = property;
+		if (ce-type == ZEND_USER_CLASS) {
+			ce-static_members_table = ce-default_static_members_table;
+		}
+	} else {
+		property_info.offset = ce-default_properties_count++;
+		ce-default_properties_table = perealloc(ce-default_properties_table, sizeof(zval*) * ce-default_properties_count, ce-type == ZEND_INTERNAL_CLASS);
+		ce-default_properties_table[property_info.offset] = property;
+	}
+
+	zend_mangle_property_name(priv_name, priv_name_length, ce-name, ce-name_length, name, name_len, ce-type  ZEND_INTERNAL_CLASS);
+	property_info.name = priv_name;
+	property_info.name_length = priv_name_length;
+
+	interned_name = zend_new_interned_string(property_info.name, property_info.name_length+1, 0 TSRMLS_CC);
+	if (interned_name != property_info.name) {
+		if (ce-type == ZEND_USER_CLASS) {
+			efree((char*)property_info.name);
+		} else {
+			free((char*)property_info.name);
+		}
+		property_info.name = interned_name;
+	}
+
+	property_info.h = zend_get_hash_value(property_info.name, property_info.name_length+1);
+
+	property_info.ce = ce;
+
+	zend_hash_quick_update(ce-properties_info, name, name_len+1, h, property_info, sizeof(zend_property_info), NULL);
+}
+/* }}} */
+
 static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* {{{ */
 {
 	size_t i;
@@ -4295,6 +4339,17 @@
 	prop_name,
 	ce-name);
 	}
+} else {
+	/* private property, make the property_info.offset indenpended */
+	if (property_info-flags  ZEND_ACC_STATIC) {
+		prop_value = ce-traits[i]-default_static_members_table[property_info-offset];
+	} else {
+		prop_value = ce-traits[i]-default_properties_table[property_info-offset];
+	}
+	Z_ADDREF_P(prop_value);
+
+	zend_traits_register_private_property(ce, prop_name, prop_name_length, property_info, prop_value TSRMLS_CC);
+	return;
 }
 			}


Modified: php/php-src/branches/PHP_5_4/Zend/zend_object_handlers.c
===
--- php/php-src/branches/PHP_5_4/Zend/zend_object_handlers.c	2011-12-19 16:14:50 UTC (rev 321165)
+++ php/php-src/branches/PHP_5_4/Zend/zend_object_handlers.c	2011-12-19 16:48:18 UTC (rev 321166)
@@ -62,7 +62,6 @@
 		ALLOC_HASHTABLE(zobj-properties);
 		zend_hash_init(zobj-properties, 0, NULL, ZVAL_PTR_DTOR, 0);
 		if (ce-default_properties_count) {
-			char *flags = ecalloc(ce-default_properties_count, sizeof(char));
 			for (zend_hash_internal_pointer_reset_ex(ce-properties_info, pos);
 			 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/tests/lang/bug29566.phpt branches/PHP_5_4/tests/strings/offsets_chaining_5.phpt trunk/tests/lang/bug29566.phpt trunk/tests/strings/offsets_chaining_5.phpt

2011-12-19 Thread Xinchen Hui
laruence Mon, 19 Dec 2011 16:57:36 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=321167

Log:
Fix tests

Changed paths:
U   php/php-src/branches/PHP_5_4/tests/lang/bug29566.phpt
U   php/php-src/branches/PHP_5_4/tests/strings/offsets_chaining_5.phpt
U   php/php-src/trunk/tests/lang/bug29566.phpt
U   php/php-src/trunk/tests/strings/offsets_chaining_5.phpt

Modified: php/php-src/branches/PHP_5_4/tests/lang/bug29566.phpt
===
--- php/php-src/branches/PHP_5_4/tests/lang/bug29566.phpt   2011-12-19 
16:48:18 UTC (rev 321166)
+++ php/php-src/branches/PHP_5_4/tests/lang/bug29566.phpt   2011-12-19 
16:57:36 UTC (rev 321167)
@@ -12,5 +12,7 @@
 ?
 ===DONE===
 --EXPECTF--
+Warning: Illegal string offset 'nosuchkey' in %sbug29566.php on line %d
+
 Warning: Invalid argument supplied for foreach() in %sbug29566.php on line %d
 ===DONE===

Modified: php/php-src/branches/PHP_5_4/tests/strings/offsets_chaining_5.phpt
===
--- php/php-src/branches/PHP_5_4/tests/strings/offsets_chaining_5.phpt  
2011-12-19 16:48:18 UTC (rev 321166)
+++ php/php-src/branches/PHP_5_4/tests/strings/offsets_chaining_5.phpt  
2011-12-19 16:57:36 UTC (rev 321167)
@@ -15,8 +15,13 @@
 --EXPECTF--
 bool(true)
 string(6) foobar
-bool(true)
+bool(false)
+
+Warning: Illegal string offset 'foo' in %soffsets_chaining_5.php on line %d
 string(1) f
-bool(true)
+bool(false)
+
+Warning: Illegal string offset 'foo' in %soffsets_chaining_5.php on line %d
+
+Warning: Illegal string offset 'bar' in %soffsets_chaining_5.php on line %d
 string(1) f
-

Modified: php/php-src/trunk/tests/lang/bug29566.phpt
===
--- php/php-src/trunk/tests/lang/bug29566.phpt  2011-12-19 16:48:18 UTC (rev 
321166)
+++ php/php-src/trunk/tests/lang/bug29566.phpt  2011-12-19 16:57:36 UTC (rev 
321167)
@@ -12,5 +12,7 @@
 ?
 ===DONE===
 --EXPECTF--
+Warning: Illegal string offset 'nosuchkey' in %sbug29566.php on line %d
+
 Warning: Invalid argument supplied for foreach() in %sbug29566.php on line %d
 ===DONE===

Modified: php/php-src/trunk/tests/strings/offsets_chaining_5.phpt
===
--- php/php-src/trunk/tests/strings/offsets_chaining_5.phpt 2011-12-19 
16:48:18 UTC (rev 321166)
+++ php/php-src/trunk/tests/strings/offsets_chaining_5.phpt 2011-12-19 
16:57:36 UTC (rev 321167)
@@ -15,8 +15,13 @@
 --EXPECTF--
 bool(true)
 string(6) foobar
-bool(true)
+bool(false)
+
+Warning: Illegal string offset 'foo' in %soffsets_chaining_5.php on line %d
 string(1) f
-bool(true)
+bool(false)
+
+Warning: Illegal string offset 'foo' in %soffsets_chaining_5.php on line %d
+
+Warning: Illegal string offset 'bar' in %soffsets_chaining_5.php on line %d
 string(1) f
-

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

Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/NEWS branches/PHP_5_4/Zend/zend_compile.c branches/PHP_5_4/Zend/zend_object_handlers.c trunk/Zend/zend_compile.c trunk/Zend/zend_object_handlers.c

2011-12-19 Thread Stefan Marr
Hi:

Thanks guys!

I have only briefly rechecked the code, and dont remember at the moment how the 
default property table works, but for me it feels like these offsets are also 
incorrect for public or protected stuff that gets newly added to the class?

Best regards
Stefan

On 19 Dec 2011, at 17:48, Xinchen Hui wrote:

 laruence Mon, 19 Dec 2011 16:48:18 +
 
 Revision: http://svn.php.net/viewvc?view=revisionrevision=321166
 
 Log:
 Fixed bug #60558 (Invalid read and writes)
 Re-Fixed bug #60536 (Traits Segfault)
 #Thanks to tony2001, I found the previous fix -r321089 is actually not a 
 correct one.
 #The key problem there is because the traits didn't correct set the 
 property_info.offset
 #for private properties. so here come the new fix.
 
 Bugs: https://bugs.php.net/60558 (Re-Opened) Invalid read and writes
  https://bugs.php.net/60536 (Closed) Traits Segfault
 
 Changed paths:
U   php/php-src/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/Zend/zend_compile.c
U   php/php-src/branches/PHP_5_4/Zend/zend_object_handlers.c
U   php/php-src/trunk/Zend/zend_compile.c
U   php/php-src/trunk/Zend/zend_object_handlers.c
 
 svn-diffs-321166.txt-- 
 PHP CVS Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Stefan Marr
Software Languages Lab
Vrije Universiteit Brussel
Pleinlaan 2 / B-1050 Brussels / Belgium
http://soft.vub.ac.be/~smarr
Phone: +32 2 629 2974
Fax:   +32 2 629 3525


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



Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/NEWS branches/PHP_5_4/Zend/zend_compile.c branches/PHP_5_4/Zend/zend_object_handlers.c trunk/Zend/zend_compile.c trunk/Zend/zend_object_handlers.c

2011-12-19 Thread Xinchen Hui
Hi:
 For public and protected properties, you will have only one copy
in the child class, so there is no such conflict.

Thanks

Sent from my iPhone

在 2011-12-20,1:12,Stefan Marr p...@stefan-marr.de 写道:

 Hi:

 Thanks guys!

 I have only briefly rechecked the code, and dont remember at the moment how 
 the default property table works, but for me it feels like these offsets are 
 also incorrect for public or protected stuff that gets newly added to the 
 class?

 Best regards
 Stefan

 On 19 Dec 2011, at 17:48, Xinchen Hui wrote:

 laruence Mon, 19 Dec 2011 16:48:18 +

 Revision: http://svn.php.net/viewvc?view=revisionrevision=321166

 Log:
 Fixed bug #60558 (Invalid read and writes)
 Re-Fixed bug #60536 (Traits Segfault)
 #Thanks to tony2001, I found the previous fix -r321089 is actually not a 
 correct one.
 #The key problem there is because the traits didn't correct set the 
 property_info.offset
 #for private properties. so here come the new fix.

 Bugs: https://bugs.php.net/60558 (Re-Opened) Invalid read and writes
 https://bugs.php.net/60536 (Closed) Traits Segfault

 Changed paths:
   U   php/php-src/branches/PHP_5_4/NEWS
   U   php/php-src/branches/PHP_5_4/Zend/zend_compile.c
   U   php/php-src/branches/PHP_5_4/Zend/zend_object_handlers.c
   U   php/php-src/trunk/Zend/zend_compile.c
   U   php/php-src/trunk/Zend/zend_object_handlers.c

 svn-diffs-321166.txt--
 PHP CVS Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

 --
 Stefan Marr
 Software Languages Lab
 Vrije Universiteit Brussel
 Pleinlaan 2 / B-1050 Brussels / Belgium
 http://soft.vub.ac.be/~smarr
 Phone: +32 2 629 2974
 Fax:   +32 2 629 3525


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



Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/NEWS branches/PHP_5_4/Zend/zend_compile.c branches/PHP_5_4/Zend/zend_object_handlers.c trunk/Zend/zend_compile.c trunk/Zend/zend_object_handlers.c

2011-12-19 Thread Xinchen Hui
s/class/object/

Sent from my iPhone

在 2011-12-20,9:29,Xinchen Hui larue...@gmail.com 写道:

 Hi:
 For public and protected properties, you will have only one copy
 in the child class, so there is no such conflict.

 Thanks

 Sent from my iPhone

 在 2011-12-20,1:12,Stefan Marr p...@stefan-marr.de 写道:

 Hi:

 Thanks guys!

 I have only briefly rechecked the code, and dont remember at the moment how 
 the default property table works, but for me it feels like these offsets are 
 also incorrect for public or protected stuff that gets newly added to the 
 class?

 Best regards
 Stefan

 On 19 Dec 2011, at 17:48, Xinchen Hui wrote:

 laruence Mon, 19 Dec 2011 16:48:18 +

 Revision: http://svn.php.net/viewvc?view=revisionrevision=321166

 Log:
 Fixed bug #60558 (Invalid read and writes)
 Re-Fixed bug #60536 (Traits Segfault)
 #Thanks to tony2001, I found the previous fix -r321089 is actually not a 
 correct one.
 #The key problem there is because the traits didn't correct set the 
 property_info.offset
 #for private properties. so here come the new fix.

 Bugs: https://bugs.php.net/60558 (Re-Opened) Invalid read and writes
https://bugs.php.net/60536 (Closed) Traits Segfault

 Changed paths:
  U   php/php-src/branches/PHP_5_4/NEWS
  U   php/php-src/branches/PHP_5_4/Zend/zend_compile.c
  U   php/php-src/branches/PHP_5_4/Zend/zend_object_handlers.c
  U   php/php-src/trunk/Zend/zend_compile.c
  U   php/php-src/trunk/Zend/zend_object_handlers.c

 svn-diffs-321166.txt--
 PHP CVS Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

 --
 Stefan Marr
 Software Languages Lab
 Vrije Universiteit Brussel
 Pleinlaan 2 / B-1050 Brussels / Belgium
 http://soft.vub.ac.be/~smarr
 Phone: +32 2 629 2974
 Fax:   +32 2 629 3525


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