Re: com php-src: - Fixed regression when calling func_get_args() from global scope: Zend/tests/func_get_args.phpt Zend/zend_builtin_functions.c
| From: | Dmitry Stogov | Date: | Mon, 12 Oct 2015 07:38:16 +0000 |
| Subject: | Re: com php-src: - Fixed regression when calling func_get_args() from global scope: Zend/tests/func_get_args.phpt Zend/zend_builtin_functions.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-89367@lists.php.net to get a copy of this message | ||
Hi Felipe,
EX(prev_execute_data) can't be NULL in internal function in PHP-7.
Could you please explain what did you fix with this additional check?
Thanks. Dmitry.
On Sun, Oct 11, 2015 at 4:30 PM, Felipe Pena <felipe@php.net> wrote:
> Commit: acbecd7b31b3b05dd14c11dbe5b856c7522664b3
> Author: Felipe Pena <felipensp@gmail.com> Sun, 11 Oct 2015
> 10:30:44 -0300
> Parents: 9f27624641931f2035a2798d6660e8a4a931556f
> Branches: master
>
> Link:
>
> http://git.php.net/?p=php-src.git;a=commitdiff;h=acbecd7b31b3b05dd14c11dbe5b856c7522664b3
>
> Log:
> - Fixed regression when calling func_get_args() from global scope
>
> Changed paths:
> A Zend/tests/func_get_args.phpt
> M Zend/zend_builtin_functions.c
>
>
> Diff:
> diff --git a/Zend/tests/func_get_args.phpt b/Zend/tests/func_get_args.phpt
> new file mode 100644
> index 0000000..eea8ae43
> --- /dev/null
> +++ b/Zend/tests/func_get_args.phpt
> @@ -0,0 +1,10 @@
> +--TEST--
> +Testing func_get_args()
> +--FILE--
> +<?php
> +
> +func_get_args();
> +
> +?>
> +--EXPECTF--
> +Warning: func_get_args(): Called from the global scope - no function
> context in %s on line 3
> diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
> index 8ffdcaa..347d169 100644
> --- a/Zend/zend_builtin_functions.c
> +++ b/Zend/zend_builtin_functions.c
> @@ -487,7 +487,7 @@ ZEND_FUNCTION(func_get_args)
> uint32_t i, n;
> zend_execute_data *ex = EX(prev_execute_data);
>
> - if (ZEND_CALL_INFO(ex) & ZEND_CALL_CODE) {
> + if (!ex || ZEND_CALL_INFO(ex) & ZEND_CALL_CODE) {
> zend_error(E_WARNING, "func_get_args(): Called from the
> global scope - no function context");
> RETURN_FALSE;
> }
>
>
> --
> PHP CVS Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>