Commit:    0eb02b874de8c97b6ee4c4226a95971e1d4d27ff
Author:    Xinchen Hui <larue...@php.net>         Wed, 23 May 2012 13:39:00 
+0800
Committer: Stanislav Malyshev <s...@php.net>      Wed, 23 May 2012 18:45:03 
-0500
Parents:   b595b775f771543a7d3d675e16179a5e13aff468
Branches:  PHP-5.4.4

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

Log:
Revert "Implemented FR #61602 Allow access to name of constant used as default 
value"

This reverts commit 054f3e3ce5af13c2c3a6ccd54f7dc3e2f6cd4f74.

See: http://news.php.net/php.cvs/69137 and the author confirmed.
Will commit later after the author fixed this then make a new PR.

Conflicts:

        ext/reflection/php_reflection.c

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

Changed paths:
  M  ext/reflection/php_reflection.c


Diff:
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 406da93..fe50289 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -2588,6 +2588,15 @@ ZEND_METHOD(reflection_parameter, getDefaultValue)
        if (!(param && precv)) {
                return;
        }
+       if (param->offset < param->required) {
+               zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
"Parameter is not optional");
+               return;
+       }
+       precv = _get_recv_op((zend_op_array*)param->fptr, param->offset);
+       if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2_type == 
IS_UNUSED) {
+               zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, 
"Internal error");
+               return;
+       }
 
        *return_value = *precv->op2.zv;
        INIT_PZVAL(return_value);


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

Reply via email to