pajoye Mon, 02 Nov 2009 18:11:33 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=290152
Log: - Merge 290129, Fixed bug #49908 (throwing exception in __autoload crashes when interface is not defined) Bug: http://bugs.php.net/49908 (Closed) throwing exception in __autoload crashes when interface is not defined Changed paths: _U php/php-src/branches/PHP_5_3_1/ UU php/php-src/branches/PHP_5_3_1/NEWS A + php/php-src/branches/PHP_5_3_1/Zend/tests/bug49908.phpt (from php/php-src/branches/PHP_5_3/Zend/tests/bug49908.phpt:r290129) U php/php-src/branches/PHP_5_3_1/Zend/zend_vm_def.h U php/php-src/branches/PHP_5_3_1/Zend/zend_vm_execute.h _U php/php-src/branches/PHP_5_3_1/ext/mysql/ _U php/php-src/branches/PHP_5_3_1/ext/mysqli/ _U php/php-src/branches/PHP_5_3_1/ext/mysqlnd/ _U php/php-src/branches/PHP_5_3_1/ext/pdo_mysql/ _U php/php-src/branches/PHP_5_3_1/ext/tidy/tests/ _U php/php-src/branches/PHP_5_3_1/tests/security/open_basedir_parse_ini_file.phpt
Property changes on: php/php-src/branches/PHP_5_3_1 ___________________________________________________________________ Modified: svn:mergeinfo - /php/php-src/branches/PHP_5_3:288351,289341,289612,289621-289624,289666-289667,289690,289706,289752,289763,289768,289779,289987,289990,290029 /php/php-src/trunk:284726 + /php/php-src/branches/PHP_5_3:288351,289341,289612,289621-289624,289666-289667,289690,289706,289752,289763,289768,289779,289987,289990,290029,290129,290147 /php/php-src/trunk:284726 Modified: php/php-src/branches/PHP_5_3_1/NEWS =================================================================== --- php/php-src/branches/PHP_5_3_1/NEWS 2009-11-02 17:56:20 UTC (rev 290151) +++ php/php-src/branches/PHP_5_3_1/NEWS 2009-11-02 18:11:33 UTC (rev 290152) @@ -7,6 +7,8 @@ - Fixed crash in com_print_typeinfo when an invalid typelib is given. (Pierre) +- Fixed bug #49908 (throwing exception in __autoload crashes when interface + is not defined). (Felipe) - Fixed bug #49142 (crash when exception thrown from __tostring()). (David Soria Parra) - Fixed bug #49986 (Missing ICU DLLs on windows package). (Pierre) Property changes on: php/php-src/branches/PHP_5_3_1/NEWS ___________________________________________________________________ Modified: svn:mergeinfo - /php/php-src/branches/PHP_5_3/NEWS:288028,288034,288067,288081,288083,288085,288087-288088,288096,288111,288116-288117,288159,288202-288204,288208,288215,288246,288263,288265,288267,288329,288339,288351,288354,288378-288379,288393,288396,288411,288437,288439,288446-288448,288462,288510-288511,288514-288518,288522-288524,288531,288537,288541,288547-288548,288555,288562,288571,288575,288580,288583,288585,288598,288603,288638,288644,288653,288676,288679,288705,288741,288743,288745-288747,288749,288784,288793,288834,288892-288893,288896,288940,288943,288945,288953,288973,289004,289019,289027-289028,289030,289039,289046,289049,289076,289123,289214,289216,289247,289249,289285,289339,289341,289351,289366,289368,289372,289445-289446,289531,289546-289547,289557,289568,289581,289587,289612,289621-289624,289666-289667,289779,289987,289990,290029 /php/php-src/trunk/NEWS:284726 + /php/php-src/branches/PHP_5_3/NEWS:288028,288034,288067,288081,288083,288085,288087-288088,288096,288111,288116-288117,288159,288202-288204,288208,288215,288246,288263,288265,288267,288329,288339,288351,288354,288378-288379,288393,288396,288411,288437,288439,288446-288448,288462,288510-288511,288514-288518,288522-288524,288531,288537,288541,288547-288548,288555,288562,288571,288575,288580,288583,288585,288598,288603,288638,288644,288653,288676,288679,288705,288741,288743,288745-288747,288749,288784,288793,288834,288892-288893,288896,288940,288943,288945,288953,288973,289004,289019,289027-289028,289030,289039,289046,289049,289076,289123,289214,289216,289247,289249,289285,289339,289341,289351,289366,289368,289372,289445-289446,289531,289546-289547,289557,289568,289581,289587,289612,289621-289624,289666-289667,289779,289987,289990,290029,290129,290147 /php/php-src/trunk/NEWS:284726 Copied: php/php-src/branches/PHP_5_3_1/Zend/tests/bug49908.phpt (from rev 290129, php/php-src/branches/PHP_5_3/Zend/tests/bug49908.phpt) =================================================================== --- php/php-src/branches/PHP_5_3_1/Zend/tests/bug49908.phpt (rev 0) +++ php/php-src/branches/PHP_5_3_1/Zend/tests/bug49908.phpt 2009-11-02 18:11:33 UTC (rev 290152) @@ -0,0 +1,28 @@ +--TEST-- +Bug #49908 (throwing exception in __autoload crashes when interface is not defined) +--FILE-- +<?php + +function __autoload($className) { + var_dump($className); + + if ($className == 'Foo') { + class Foo implements Bar {}; + } else { + throw new Exception($className); + } +} + +new Foo; + +?> +--EXPECTF-- +%unicode|string%(3) "Foo" +%unicode|string%(3) "Bar" + +Fatal error: Uncaught exception 'Exception' with message 'Bar' in %s:%d +Stack trace: +#0 %s(7): __autoload('Bar') +#1 %s(13): __autoload('Foo') +#2 {main} + thrown in %s on line %d Modified: php/php-src/branches/PHP_5_3_1/Zend/zend_vm_def.h =================================================================== --- php/php-src/branches/PHP_5_3_1/Zend/zend_vm_def.h 2009-11-02 17:56:20 UTC (rev 290151) +++ php/php-src/branches/PHP_5_3_1/Zend/zend_vm_def.h 2009-11-02 18:11:33 UTC (rev 290152) @@ -4245,12 +4245,13 @@ zend_class_entry *ce = EX_T(opline->op1.u.var).class_entry; zend_class_entry *iface = zend_fetch_class(Z_STRVAL(opline->op2.u.constant), Z_STRLEN(opline->op2.u.constant), opline->extended_value TSRMLS_CC); - if (!(iface->ce_flags & ZEND_ACC_INTERFACE)) { - zend_error_noreturn(E_ERROR, "%s cannot implement %s - it is not an interface", ce->name, iface->name); + if (iface) { + if (!(iface->ce_flags & ZEND_ACC_INTERFACE)) { + zend_error_noreturn(E_ERROR, "%s cannot implement %s - it is not an interface", ce->name, iface->name); + } + zend_do_implement_interface(ce, iface TSRMLS_CC); } - zend_do_implement_interface(ce, iface TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); } Modified: php/php-src/branches/PHP_5_3_1/Zend/zend_vm_execute.h =================================================================== --- php/php-src/branches/PHP_5_3_1/Zend/zend_vm_execute.h 2009-11-02 17:56:20 UTC (rev 290151) +++ php/php-src/branches/PHP_5_3_1/Zend/zend_vm_execute.h 2009-11-02 18:11:33 UTC (rev 290152) @@ -889,12 +889,13 @@ zend_class_entry *ce = EX_T(opline->op1.u.var).class_entry; zend_class_entry *iface = zend_fetch_class(Z_STRVAL(opline->op2.u.constant), Z_STRLEN(opline->op2.u.constant), opline->extended_value TSRMLS_CC); - if (!(iface->ce_flags & ZEND_ACC_INTERFACE)) { - zend_error_noreturn(E_ERROR, "%s cannot implement %s - it is not an interface", ce->name, iface->name); + if (iface) { + if (!(iface->ce_flags & ZEND_ACC_INTERFACE)) { + zend_error_noreturn(E_ERROR, "%s cannot implement %s - it is not an interface", ce->name, iface->name); + } + zend_do_implement_interface(ce, iface TSRMLS_CC); } - zend_do_implement_interface(ce, iface TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); } Property changes on: php/php-src/branches/PHP_5_3_1/ext/mysql ___________________________________________________________________ Modified: svn:mergeinfo - /php/php-src/branches/PHP_5_3/ext/mysql:288202-289561,289612,289621-289624,289666,289690,289706,289752,289763,289768,289779,289987,289990,290029 /php/php-src/trunk/ext/mysql:284726 + /php/php-src/branches/PHP_5_3/ext/mysql:288202-289561,289612,289621-289624,289666,289690,289706,289752,289763,289768,289779,289987,289990,290029,290129,290147 /php/php-src/trunk/ext/mysql:284726 Property changes on: php/php-src/branches/PHP_5_3_1/ext/mysqli ___________________________________________________________________ Modified: svn:mergeinfo - /php/php-src/branches/PHP_5_3/ext/mysqli:288202-289561,289612,289621-289624,289666,289690,289706,289752,289763,289768,289779,289987,289990,290029 /php/php-src/trunk/ext/mysqli:284726 + /php/php-src/branches/PHP_5_3/ext/mysqli:288202-289561,289612,289621-289624,289666,289690,289706,289752,289763,289768,289779,289987,289990,290029,290129,290147 /php/php-src/trunk/ext/mysqli:284726 Property changes on: php/php-src/branches/PHP_5_3_1/ext/mysqlnd ___________________________________________________________________ Modified: svn:mergeinfo - /php/php-src/branches/PHP_5_3/ext/mysqlnd:288202-289561,289612,289621-289624,289666,289690,289706,289752,289763,289768,289779,289987,289990,290029 /php/php-src/trunk/ext/mysqlnd:284726 + /php/php-src/branches/PHP_5_3/ext/mysqlnd:288202-289561,289612,289621-289624,289666,289690,289706,289752,289763,289768,289779,289987,289990,290029,290129,290147 /php/php-src/trunk/ext/mysqlnd:284726 Property changes on: php/php-src/branches/PHP_5_3_1/ext/pdo_mysql ___________________________________________________________________ Modified: svn:mergeinfo - /php/php-src/branches/PHP_5_3/ext/pdo_mysql:288202-289561,289612,289621-289624,289666,289690,289706,289752,289763,289768,289779,289987,289990,290029 /php/php-src/trunk/ext/pdo_mysql:284726 + /php/php-src/branches/PHP_5_3/ext/pdo_mysql:288202-289561,289612,289621-289624,289666,289690,289706,289752,289763,289768,289779,289987,289990,290029,290129,290147 /php/php-src/trunk/ext/pdo_mysql:284726 Property changes on: php/php-src/branches/PHP_5_3_1/ext/tidy/tests ___________________________________________________________________ Modified: svn:mergeinfo - /php/php-src/branches/PHP_5_3/ext/tidy/tests:288351,289341,289612,289621-289624,289666-289667,289690,289706,289752,289763,289768,289779,289987,289990,290029 /php/php-src/trunk/ext/tidy/tests:284726,287798-287941 + /php/php-src/branches/PHP_5_3/ext/tidy/tests:288351,289341,289612,289621-289624,289666-289667,289690,289706,289752,289763,289768,289779,289987,289990,290029,290129,290147 /php/php-src/trunk/ext/tidy/tests:284726,287798-287941 Property changes on: php/php-src/branches/PHP_5_3_1/tests/security/open_basedir_parse_ini_file.phpt ___________________________________________________________________ Modified: svn:mergeinfo - /php/php-src/branches/PHP_5_3/tests/security/open_basedir_parse_ini_file.phpt:288351,289341,289612,289621-289624,289666-289667,289690,289706,289752,289763,289768,289779,289987,289990,290029 /php/php-src/trunk/tests/security/open_basedir_parse_ini_file.phpt:265951 + /php/php-src/branches/PHP_5_3/tests/security/open_basedir_parse_ini_file.phpt:288351,289341,289612,289621-289624,289666-289667,289690,289706,289752,289763,289768,289779,289987,289990,290029,290129,290147 /php/php-src/trunk/tests/security/open_basedir_parse_ini_file.phpt:265951
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php