Re: com php-src: Fix bug #67436: Zend/zend_compile.c
| From: | Ferenc Kovacs | Date: | Mon, 16 Jun 2014 00:17:05 +0000 |
| Subject: | Re: com php-src: Fix bug #67436: Zend/zend_compile.c | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-78900@lists.php.net to get a copy of this message | ||
On Mon, Jun 16, 2014 at 1:40 AM, Bob Weinand <bobwei9@hotmail.com> wrote:
> Am 16.6.2014 um 01:29 schrieb Ferenc Kovacs <tyra3l@gmail.com>:
>
> On Mon, Jun 16, 2014 at 1:25 AM, Bob Weinand <bobwei9@hotmail.com> wrote:
>
>> Am 16.6.2014 um 01:21 schrieb Ferenc Kovacs <tyra3l@gmail.com>:
>>
>> On Mon, Jun 16, 2014 at 12:27 AM, Bob Weinand <bobwei9@hotmail.com>
>> wrote:
>>
>>> Am 16.6.2014 um 00:11 schrieb Stas Malyshev <smalyshev@sugarcrm.com>:
>>> > Hi!
>>> >
>>> >> Commit: ca29063da5599f463454578abe629bc21ab33b3b
>>> >> Author: Bob Weinand <bobwei9@hotmail.com> Sun, 15 Jun
>>> 2014 22:18:25 +0200
>>> >> Parents: b053c4f4f6db57c7687e700de7aa4abadef2c128
>>> >> Branches: PHP-5.4
>>> >>
>>> >> Link:
>>>
>>> http://git.php.net/?p=php-src.git;a=commitdiff;h=ca29063da5599f463454578abe629bc21ab33b3b
>>> >>
>>> >> Log:
>>> >> Fix bug #67436
>>> >>
>>> >> Bugs:
>>> >> https://bugs.php.net/67436
>>> >
>>> > Could you please explain this fix? The bug is about autoloader, but the
>>> > fix seems nothing to do with it. Also, adding a test case would be
>>> > really good, bugfixes without test cases tend to regress later.
>>> >
>>> > --
>>> > Stanislav Malyshev, Software Architect
>>> > SugarCRM: http://www.sugarcrm.com/
>>> > (408)454-6900 ext. 227
>>>
>>> Levi wanted to provide some tests. I'm sure they're ready in a few
>>> minutes....
>>>
>>> And yes, bit complicated.
>>>
>>> The issue is that we cannot invoke the autoloader during compile time
>>> (where early binding is done, when class "a" was loaded before). (That's
>>> all what it had to do with autoloaders)
>>> And so the class "c" (in that example) is not defined.
>>>
>>> In this case the class "c" was (tried to be) fetched by this
>>> zval_update_constant_ex which was invoked there by
>>> zend_get_function_declaration called by do_inheritance_check_on_method as
>>> the function signatures didn't match (E_STRICT error).
>>>
>>> So, as the autoloader couldn't be invoked (compile-time...), but the
>>> class constant was tried to be resolved, we ended up with a fatal error
>>> instead of the notice.
>>>
>>> Logical fix: don't try to resolve the class constant, but just write the
>>> constants name there. (which is maybe even more informative to the user
>>> than the value)
>>>
>>>
>>> Bob
>>
>>
>> hm,
>> I thought this was fixed with
>> 1µ¯ùuÊg,tè&
>> æÃhttp://git.php.net/?p=php-src.git;a=commit;h=f0c926564c5f7de9462d9ca7bd75014b14a63f56
>>
>> --
>> Ferenc Kovács
>> @Tyr43l - http://tyrael.hu
>>
>>
>> Nope, that was some totally unrelated bug.
>>
>> That bug occurred during an error handler at run-time, this bug here
>> during compile-time.
>>
>> Bob
>>
>
> did you read https://bugs.php.net/bug.php?id=65322 ?
> it was caused by a compile time error triggered by mismatching class
> definition, and that the error handler called for that won't be able to
> trigger the autloader (we also tracked it back to the "if (!use_autoload ||
> zend_is_compiling(TSRMLS_C)) {" check).
> maybe I'm missing something but this seems like the exact case here.
>
> --
> Ferenc Kovács
> @Tyr43l - http://tyrael.hu
>
>
> No. Still two different things. Bug 65322 is caused inside the error
> handler, inside zend_error (the error was that compilation mode wasn't
> turned off) while bug 67436 happens during compilation time, before
> zend_error is reached.
>
> Bob
>
right, I was too quick to read the attached testscripts for 67436, I missed
that in this case the autoloader is triggered by the class
definition/resolving the ancestors while in 65322 it was triggered by the
error handler caused by the error in the error in the incompatible class
definition.
--
Ferenc Kovács
@Tyr43l - http://tyrael.hu