[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-cvs
Subject:    [PHP-CVS] com php-src: Merge branch 'PHP-7.0' into PHP-7.1: =?UTF-8?Q?ext/reflectio?= =?UTF-8?Q?n/ph
From:       Xinchen Hui <laruence () php ! net>
Date:       2017-05-31 5:08:26
Message-ID: php-mail-cb7d9be3e632efb90bef89cdcd708cc81979004152 () git ! php ! net
[Download RAW message or body]

Commit:    9064dca58ba87ccdbf6cee71122e50595765cfa1
Author:    Xinchen Hui <laruence@gmail.com>         Wed, 31 May 2017 13:08:26 +0800
Parents:   316aaca15503f8e40a6c578c0f90d122e393d283 9c5717d0decd56710129a5599fe5d38f82a7bab2
Branches:  PHP-7.1

Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=9064dca58ba87ccdbf6cee71122e50595765cfa1

Log:
Merge branch 'PHP-7.0' into PHP-7.1

* PHP-7.0:
  Fixed bug #74673 (Segfault when cast Reflection object to string with undefined constant)

Conflicts:
	ext/reflection/php_reflection.c

Bugs:
https://bugs.php.net/74673

Changed paths:
  MM  ext/reflection/php_reflection.c


Diff:
diff --cc ext/reflection/php_reflection.c
index a06522d,5b162f7..db7056e
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@@ -464,10 -459,13 +464,13 @@@ static void _class_string(string *str, 
  	string_printf(str, "%s  - Constants [%d] {\n", indent, count);
  	if (count > 0) {
  		zend_string *key;
 -		zval *value;
 +		zend_class_constant *c;
  
 -		ZEND_HASH_FOREACH_STR_KEY_VAL(&ce->constants_table, key, value) {
 -			if (UNEXPECTED(zval_update_constant_ex(value, 1, NULL) == FAILURE)) {
 +		ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->constants_table, key, c) {
 +			_class_const_string(str, ZSTR_VAL(key), c, ZSTR_VAL(sub_indent.buf));
++			if (UNEXPECTED(EG(exception))) {
+ 				return;
+ 			}
 -			_const_string(str, ZSTR_VAL(key), value, indent);
  		} ZEND_HASH_FOREACH_END();
  	}
  	string_printf(str, "%s  }\n", indent);
@@@ -732,7 -707,15 +735,10 @@@ static void _parameter_string(string *s
  
  			string_write(str, " = ", sizeof(" = ")-1);
  			ZVAL_DUP(&zv, RT_CONSTANT(&fptr->op_array, precv->op2));
- 			zval_update_constant_ex(&zv, fptr->common.scope);
 -			old_scope = EG(scope);
 -			EG(scope) = fptr->common.scope;
 -			if (UNEXPECTED(zval_update_constant_ex(&zv, 1, NULL) == FAILURE)) {
 -				EG(scope) = old_scope;
++			if (UNEXPECTED(zval_update_constant_ex(&zv, fptr->common.scope) == FAILURE)) {
+ 				zval_ptr_dtor(&zv);
+ 				return;
+ 			}
 -			EG(scope) = old_scope;
  			if (Z_TYPE(zv) == IS_TRUE) {
  				string_write(str, "true", sizeof("true")-1);
  			} else if (Z_TYPE(zv) == IS_FALSE) {


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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic