[PHP-CVS] com php-src: Fix tests expecting specific resource IDs: Zend/tests/bug41421.phpt ext/session/tests/session_name_error.phpt ext/standard/tests/array/each.phpt ext/standard/tests/file/007_erro
Commit:50377b5bf2bc4cd6f77816a9216e035d71bc2ec8 Author:Eric Stenson erics...@php.net Fri, 13 Dec 2013 10:42:32 -0800 Parents: 41eaac3491cfcad02ebab5f86ece018d9e3c4cc6 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=50377b5bf2bc4cd6f77816a9216e035d71bc2ec8 Log: Fix tests expecting specific resource IDs When Wincache or APC are installed, the resource IDs are not the same. This is because Wincache takes a few resource objects for itself. As a result, these tests become false positives. On Windows boxes, the microtime precision is not granular enough to reliably register a difference if two calls to uniqid() are made concurrently. This is a fix to the uniqid() test to avoid the false positive when run on Windows machines. Also, added a test to exercise the 'more_entropy' variant of uniqid(). Changed paths: M Zend/tests/bug41421.phpt M ext/session/tests/session_name_error.phpt M ext/standard/tests/array/each.phpt M ext/standard/tests/file/007_error.phpt M ext/standard/tests/file/fgetss_error.phpt M ext/standard/tests/file/ftruncate_error.phpt M ext/standard/tests/general_functions/floatval.phpt M ext/standard/tests/general_functions/gettype_settype_basic.phpt M ext/standard/tests/general_functions/print_r.phpt M ext/standard/tests/general_functions/strval.phpt M ext/standard/tests/general_functions/type.phpt M ext/standard/tests/general_functions/var_dump.phpt M ext/standard/tests/strings/implode1.phpt M tests/strings/001.phpt diff --git a/Zend/tests/bug41421.phpt b/Zend/tests/bug41421.phpt index f10db10..f39fb15 100644 --- a/Zend/tests/bug41421.phpt +++ b/Zend/tests/bug41421.phpt @@ -24,6 +24,6 @@ Warning: feof(): wrapper::stream_eof is not implemented! Assuming EOF in %s on l Fatal error: Uncaught exception 'Exception' in %s:%d Stack trace: #0 [internal function]: wrapper-stream_eof() -#1 %s(%d): feof(Resource id #6) +#1 %s(%d): feof(Resource id #%d) #2 {main} thrown in %s on line %d diff --git a/ext/session/tests/session_name_error.phpt b/ext/session/tests/session_name_error.phpt index 1b99d4e..9f0101d 100644 --- a/ext/session/tests/session_name_error.phpt +++ b/ext/session/tests/session_name_error.phpt @@ -231,6 +231,6 @@ string(12) Hello World! -- Iteration 24 -- Warning: session_name() expects parameter 1 to be string, resource given in %s on line %d -resource(5) of type (stream) +resource(%d) of type (stream) NULL Done \ No newline at end of file diff --git a/ext/standard/tests/array/each.phpt b/ext/standard/tests/array/each.phpt index 19ee728..974808c 100644 Binary files a/ext/standard/tests/array/each.phpt and b/ext/standard/tests/array/each.phpt differ diff --git a/ext/standard/tests/file/007_error.phpt b/ext/standard/tests/file/007_error.phpt index a369c9d..112beb3 100644 --- a/ext/standard/tests/file/007_error.phpt +++ b/ext/standard/tests/file/007_error.phpt @@ -76,7 +76,7 @@ bool(false) Warning: fopen() expects at least 2 parameters, 0 given in %s on line %d bool(false) -Warning: fclose(): 5 is not a valid stream resource in %s on line %d +Warning: fclose(): %d is not a valid stream resource in %s on line %d bool(false) Warning: fclose() expects parameter 1 to be resource, string given in %s on line %d @@ -85,7 +85,7 @@ bool(false) Warning: fclose() expects exactly 1 parameter, 0 given in %s on line %d bool(false) -Warning: feof(): 5 is not a valid stream resource in %s on line %d +Warning: feof(): %d is not a valid stream resource in %s on line %d bool(false) Warning: feof() expects parameter 1 to be resource, string given in %s on line %d diff --git a/ext/standard/tests/file/fgetss_error.phpt b/ext/standard/tests/file/fgetss_error.phpt index 3691e96..2b4ad68 100644 --- a/ext/standard/tests/file/fgetss_error.phpt +++ b/ext/standard/tests/file/fgetss_error.phpt @@ -98,7 +98,7 @@ bool(false) Warning: fgetss() expects parameter 1 to be resource, object given in %s on line %d bool(false) -- Testing fgetss() with closed/unset file handle -- -Warning: fgetss(): 5 is not a valid stream resource in %s on line %d +Warning: fgetss(): %d is not a valid stream resource in %s on line %d bool(false) Warning: fgetss() expects parameter 1 to be resource, null given in %s on line %d diff --git a/ext/standard/tests/file/ftruncate_error.phpt b/ext/standard/tests/file/ftruncate_error.phpt index a28095b..254ad76 100644 --- a/ext/standard/tests/file/ftruncate_error.phpt +++ b/ext/standard/tests/file/ftruncate_error.phpt @@ -114,7 +114,7 @@ Warning: ftruncate() expects parameter 1 to be resource, object given in %s on l bool(false) -- Testing ftruncate() with closed/unset file handle -- -Warning: ftruncate(): 5 is not a valid stream resource in %s on line %d +Warning: ftruncate(): %d is not a valid stream resource in %s on line %d bool(false) int(36) diff --git a/ext/standard/tests/general_functions/floatval.phpt
[PHP-CVS] com php-src: Add Tests for #65784 in 5.5: Zend/tests/bug65784.phpt
Commit:dde552f2ee921550646c4236471c1252a9534b52 Author:Xinchen Hui larue...@gmail.com Fri, 13 Dec 2013 01:45:45 +0800 Parents: 54213b462d725aa10088909feceac63aaa1896d8 Branches: PHP-5.5 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=dde552f2ee921550646c4236471c1252a9534b52 Log: Add Tests for #65784 in 5.5 Bugs: https://bugs.php.net/65784 Changed paths: A Zend/tests/bug65784.phpt Diff: diff --git a/Zend/tests/bug65784.phpt b/Zend/tests/bug65784.phpt new file mode 100644 index 000..adc3411 --- /dev/null +++ b/Zend/tests/bug65784.phpt @@ -0,0 +1,62 @@ +--TEST-- +Fixed Bug #65784 (Segfault with finally) +--XFAIL-- +This bug is not fixed in 5.5 due to ABI BC +--FILE-- +?php +function foo1() { + try { + throw new Exception(not catch); + return true; + } finally { + try { + throw new Exception(catched); + } catch (Exception $e) { + } + } +} +try { + $foo = foo1(); + var_dump($foo); +} catch (Exception $e) { + do { + var_dump($e-getMessage()); + } while ($e = $e-getPrevious()); +} + +function foo2() { + try { + try { + throw new Exception(catched); + return true; + } finally { + try { + throw new Exception(catched); + } catch (Exception $e) { + } + } + } catch (Exception $e) { + } +} + +$foo = foo2(); +var_dump($foo); + +function foo3() { + try { + throw new Exception(not catched); + return true; + } finally { + try { + throw new NotExists(); + } catch (Exception $e) { + } + } +} + +$bar = foo3(); +--EXPECTF-- +string(9) not catch +NULL + +Fatal error: Class 'NotExists' not found in %sbug65784.php on line %d -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/standard/basic_functions.c
Commit:de79c51555a9bcc4d10cdcf2337986cc3321f4e9 Author:Xinchen Hui larue...@php.net Sun, 17 Nov 2013 17:05:04 +0800 Parents: d0cd1127024410bd7b055500d1bd879c4187b832 823e330c75a7ed87dcdcd692f8672420c1abe244 Branches: PHP-5.5 PHP-5.6 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=de79c51555a9bcc4d10cdcf2337986cc3321f4e9 Log: Merge branch 'PHP-5.4' into PHP-5.5 Changed paths: MM ext/standard/basic_functions.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.5': ext/standard/basic_functions.c
Commit:5a282136a3b5c44f1afa6af86f967ac6918e7013 Author:Xinchen Hui larue...@php.net Sun, 17 Nov 2013 17:11:20 +0800 Parents: 3e4e1732967f6912277fa1ec64b358c7d1b18759 5e9268f4694e917f991857839fac160d2954331f Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5a282136a3b5c44f1afa6af86f967ac6918e7013 Log: Merge branch 'PHP-5.5' Changed paths: MM ext/standard/basic_functions.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.5' into PHP-5.6: ext/standard/basic_functions.c
Commit:140a42f779b83f5c32656741f9fd26f34edc0b1b Author:Xinchen Hui larue...@php.net Sun, 17 Nov 2013 17:20:13 +0800 Parents: 81d0ba10bac7bd2c4820374931ad8862cc434800 5e9268f4694e917f991857839fac160d2954331f Branches: PHP-5.6 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=140a42f779b83f5c32656741f9fd26f34edc0b1b Log: Merge branch 'PHP-5.5' into PHP-5.6 Changed paths: MM ext/standard/basic_functions.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch '5.4': sapi/litespeed/lsapi_main.c
Commit:1407b4a08085cc6b4b534baa2ca9eb40f8d39241 Author:George Wang gw...@php.net Fri, 12 Oct 2012 13:29:37 -0400 Parents: 6fbcf693750d682b223660d3299a0b6864915acc 68e528a6bca59fcbcefeb49a6fcf992c8648475f Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1407b4a08085cc6b4b534baa2ca9eb40f8d39241 Log: Merge branch '5.4' * 5.4: sapi/litespeed/lsapi_main.c: Fix bug #63228 Bugs: https://bugs.php.net/63228 Changed paths: MM sapi/litespeed/lsapi_main.c Diff: diff --cc sapi/litespeed/lsapi_main.c index 5f4d2e6,7058342..338b8e9 --- a/sapi/litespeed/lsapi_main.c +++ b/sapi/litespeed/lsapi_main.c @@@ -413,25 -585,25 +413,25 @@@ static int processReq( TSRMLS_D static void cli_usage( TSRMLS_D ) { -static const char * usage = -Usage: php\n - php -[b|c|h|i|q|s|v|?] [file] [args...]\n - Run in LSAPI mode, only '-b', '-s' and '-c' are effective\n - Run in Command Line Interpreter mode when parameters are specified\n -\n - -b address:port|port Bind Path for external LSAPI Server mode\n - -c path|file Look for php.ini file in this directory\n - -hThis help\n - -iPHP information\n - -qQuiet-mode. Suppress HTTP Header output.\n - -sDisplay colour syntax highlighted source.\n - -vVersion number\n - -?This help\n -\n - args...Arguments passed to script.\n; -php_output_startup(); -php_output_activate(TSRMLS_C); -php_printf( %s, usage ); + static const char * usage = + Usage: php\n +php -[b|c|h|i|q|s|v|?] [file] [args...]\n +Run in LSAPI mode, only '-b', '-s' and '-c' are effective\n +Run in Command Line Interpreter mode when parameters are specified\n + \n +-b address:port|port Bind Path for external LSAPI Server mode\n +-c path|file Look for php.ini file in this directory\n +-hThis help\n +-iPHP information\n +-qQuiet-mode. Suppress HTTP Header output.\n +-sDisplay colour syntax highlighted source.\n +-vVersion number\n +-?This help\n + \n +args... Arguments passed to script.\n; + php_output_startup(); + php_output_activate(TSRMLS_C); - php_printf( usage ); ++ php_printf( %s, usage ); #ifdef PHP_OUTPUT_NEWAPI php_output_end_all(TSRMLS_C); #else -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Added Zend Debugger to the note about the load order (by trash4you at online dot de): ext/opcache/README
Commit:0adba0abb9df1493c8b38299d4139d7bf0ecc4f5 Author:Xinchen Hui larue...@gmail.com Wed, 23 Oct 2013 19:26:24 +0800 Parents: 6af3683a4c2eefc5bdeba0b495635be9827afea0 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0adba0abb9df1493c8b38299d4139d7bf0ecc4f5 Log: Added Zend Debugger to the note about the load order (by trash4you at online dot de) Changed paths: M ext/opcache/README Diff: diff --git a/ext/opcache/README b/ext/opcache/README index 6c3cc74..4652158 100644 --- a/ext/opcache/README +++ b/ext/opcache/README @@ -31,8 +31,8 @@ Quick Install zend_extension=/...full path.../opcache.so -NOTE: In case you are going to use Zend OPcache together with Xdebug, -be sure that Xdebug is loaded after OPcache. php -v must show Xdebug +NOTE: In case you are going to use Zend OPcache together with Xdebug or Zend Debugger, +be sure that the debugger is loaded after OPcache. php -v must show the debugger after OPcache. - Restart PHP -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.5': ext/opcache/ZendAccelerator.c
Commit:aed56fc9a7951e132b016a2deb8c4ede68bb02b4 Author:Xinchen Hui larue...@php.net Mon, 21 Oct 2013 17:41:03 +0800 Parents: 19e8052be31d8361477906932f4c6dc9cd738de2 098855433dc5d609e3970f0bc9d6766c007273f3 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=aed56fc9a7951e132b016a2deb8c4ede68bb02b4 Log: Merge branch 'PHP-5.5' Changed paths: MM ext/opcache/ZendAccelerator.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Exclude bison 3.0 by Mike: Zend/acinclude.m4
Commit:be581ec66d2e9085e9e12a70cbec227be00b8725 Author:Xinchen Hui larue...@php.net Tue, 17 Sep 2013 16:54:27 +0800 Parents: 52ff129607a7193cccbc6bdfbf1c1e8586e8d0d2 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=be581ec66d2e9085e9e12a70cbec227be00b8725 Log: Exclude bison 3.0 by Mike Changed paths: M Zend/acinclude.m4 Diff: diff --git a/Zend/acinclude.m4 b/Zend/acinclude.m4 index fe3ab63..7fa8c99 100644 --- a/Zend/acinclude.m4 +++ b/Zend/acinclude.m4 @@ -9,7 +9,7 @@ AC_DEFUN([LIBZEND_BISON_CHECK],[ # non-working versions, e.g. 3.0 3.2; # remove none when introducing the first incompatible bison version an # separate any following additions by spaces - bison_version_exclude=none + bison_version_exclude=3.0 # for standalone build of Zend Engine test -z $SED SED=sed -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #65665 (Exception not properly caught when opcache enabled): NEWS ext/opcache/Optimizer/block_pass.c ext/opcache/tests/bug65665.phpt
Commit:46f18ccf0d11b18c3eebdd19d4057966dfcca6fe Author:Xinchen Hui larue...@php.net Mon, 16 Sep 2013 14:43:01 +0800 Parents: 9eaffd34c123ae5782054cd32bf6caa50ff2b7d2 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=46f18ccf0d11b18c3eebdd19d4057966dfcca6fe Log: Fixed bug #65665 (Exception not properly caught when opcache enabled) Bugs: https://bugs.php.net/65665 Changed paths: M NEWS M ext/opcache/Optimizer/block_pass.c A ext/opcache/tests/bug65665.phpt Diff: diff --git a/NEWS b/NEWS index 5ec672e..37db7e6 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,8 @@ PHP NEWS scaling methods. (Pierre) - OPcache: + . Fixed bug #65665 (Exception not properly caught when opcache enabled). +(Laruence) . Fixed bug #65510 (5.5.2 crashes in _get_zval_ptr_ptr_var). (Dmitry) - SPL: diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c index 43ae304..1c34cff 100644 --- a/ext/opcache/Optimizer/block_pass.c +++ b/ext/opcache/Optimizer/block_pass.c @@ -1283,11 +1283,15 @@ static void assemble_code_blocks(zend_cfg *cfg, zend_op_array *op_array) /* adjust exception jump targets */ if (op_array-last_try_catch) { - int i; - for (i = 0; i op_array-last_try_catch; i++) { - op_array-try_catch_array[i].try_op = cfg-try[i]-start_opline - new_opcodes; - op_array-try_catch_array[i].catch_op = cfg-catch[i]-start_opline - new_opcodes; + int i, j; + for (i = 0, j = 0; i op_array-last_try_catch; i++) { + if (cfg-try[i]-access) { + op_array-try_catch_array[j].try_op = cfg-try[i]-start_opline - new_opcodes; + op_array-try_catch_array[j].catch_op = cfg-catch[i]-start_opline - new_opcodes; + j++; + } } + op_array-last_try_catch = j; efree(cfg-try); efree(cfg-catch); } diff --git a/ext/opcache/tests/bug65665.phpt b/ext/opcache/tests/bug65665.phpt new file mode 100644 index 000..ac5c18d --- /dev/null +++ b/ext/opcache/tests/bug65665.phpt @@ -0,0 +1,118 @@ +--TEST-- +Bug #65665 (Exception not properly caught when opcache enabled) +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +--SKIPIF-- +?php require_once('skipif.inc'); ? +--FILE-- +?php +function foo() { + try + { + switch (1) + { + case 0: + try + { + + } + catch (Exception $e) + { + + } + + break; + + case 1: + try + { + throw new Exception('aaa'); + } + catch (Exception $e) + { + echo correct\n; + } + + break; + } + } + catch (Exception $e) + { + echo wrong\n; + } + return; +} + +function foo1() { + try + { + switch (1) + { + case 0: + try + { + + } + catch (Exception $e) + { +dummy: + echo ect\n; + } + + break; + + case 1: + try + { + throw new Exception('aaa'); + } + catch (Exception $e) + { + echo corr; + goto dummy; + } + break; + } + } + catch (Exception $e) + { + echo wrong\n; + } + return; +} + +function foo2() { + try + { + switch (1) + { + case 0: + try + { +dummy: + throw new Exception('aaa'); + } + catch (Exception $e) + { + echo correct\n; + } + + break; + + case 1: + goto dummy; + break; + } + } + catch (Exception $e) + { + echo wrong\n; + } + return; +} +foo();foo1();foo2(); +--EXPECT-- +correct +correct +correct -- PHP CVS Mailing List (http://www.php.net
[PHP-CVS] com php-src: Add test for ISSUE #128: ext/opcache/tests/issue0128.phpt
Commit:1916aaa272a19e118eae7ad53622174a3fd4a15e Author:Xinchen Hui larue...@php.net Mon, 16 Sep 2013 14:58:18 +0800 Parents: 46f18ccf0d11b18c3eebdd19d4057966dfcca6fe Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1916aaa272a19e118eae7ad53622174a3fd4a15e Log: Add test for ISSUE #128 Bugs: https://bugs.php.net/128 Changed paths: A ext/opcache/tests/issue0128.phpt Diff: diff --git a/ext/opcache/tests/issue0128.phpt b/ext/opcache/tests/issue0128.phpt new file mode 100644 index 000..637f675 --- /dev/null +++ b/ext/opcache/tests/issue0128.phpt @@ -0,0 +1,16 @@ +--TEST-- +ISSUE #128 (opcache_invalidate segmentation fault) +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.optimization_level=-1 +--SKIPIF-- +?php require_once('skipif.inc'); ? +--FILE-- +?php +var_dump(opcache_invalidate('1')); +var_dump(okey); +? +--EXPECT-- +bool(false) +string(4) okey -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Add a XFAIL test for #64896: Zend/tests/bug64896.phpt
Commit:ed038d2ee330f827e24dc865ec8963175c1bfc2e Author:Xinchen Hui larue...@php.net Mon, 2 Sep 2013 16:02:24 +0800 Parents: bfb1fe10cbe2a72678809e102231995db1a7b424 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ed038d2ee330f827e24dc865ec8963175c1bfc2e Log: Add a XFAIL test for #64896 Bugs: https://bugs.php.net/64896 Changed paths: A Zend/tests/bug64896.phpt Diff: diff --git a/Zend/tests/bug64896.phpt b/Zend/tests/bug64896.phpt new file mode 100644 index 000..e3e9f05 --- /dev/null +++ b/Zend/tests/bug64896.phpt @@ -0,0 +1,47 @@ +--TEST-- +Bug #64896 (Segfault with gc_collect_cycles using unserialize on certain objects) +--XFAIL-- +We can not fix this bug with a significant (performace slow down) change to gc +--FILE-- +?php +$bar = NULL; +class bad +{ + private $_private = array(); + + public function __construct() + { + $this-_private[] = 'php'; + } + + public function __destruct() + { + global $bar; + $bar = $this; + } +} + +$foo = new stdclass; +$foo-foo = $foo; +$foo-bad = new bad; + +gc_disable(); + +unserialize(serialize($foo)); +gc_collect_cycles(); +var_dump($bar); +/* will output: +object(bad)#4 (1) { + [_private:bad:private]= + UNKNOWN:0 +} +*/ +? +--EXPECTF-- +bject(bad)#%d (1) { + [_private:bad:private]= + array(1) { +[0]= +string(3) php + } +} -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Typo....: Zend/tests/bug64896.phpt
Commit:6c48c6bc789e4a2f5bf480bd2c62070ee1152e62 Author:Xinchen Hui larue...@php.net Mon, 2 Sep 2013 16:15:52 +0800 Parents: ed038d2ee330f827e24dc865ec8963175c1bfc2e Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6c48c6bc789e4a2f5bf480bd2c62070ee1152e62 Log: Typo Changed paths: M Zend/tests/bug64896.phpt Diff: diff --git a/Zend/tests/bug64896.phpt b/Zend/tests/bug64896.phpt index e3e9f05..3e955bb 100644 --- a/Zend/tests/bug64896.phpt +++ b/Zend/tests/bug64896.phpt @@ -1,7 +1,7 @@ --TEST-- Bug #64896 (Segfault with gc_collect_cycles using unserialize on certain objects) --XFAIL-- -We can not fix this bug with a significant (performace slow down) change to gc +We can not fix this bug without a significant (performace slow down) change to gc --FILE-- ?php $bar = NULL; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: Zend/zend_API.c
Commit:f0cb67402f2bcd3dc310cf938dfce799ccec7c7b Author:Xinchen Hui larue...@php.net Thu, 29 Aug 2013 14:01:54 +0800 Parents: bd677b43a78ebc0779ed64781172225d15b35671 72027cd0848f1a5c580c601573448cdea9b095ca Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f0cb67402f2bcd3dc310cf938dfce799ccec7c7b Log: Merge branch 'PHP-5.4' into PHP-5.5 Changed paths: MM Zend/zend_API.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fix bug #65579 (Using traits with get_class_methods causes segfault).: NEWS Zend/tests/bug65579.phpt Zend/zend_API.c
Commit:72027cd0848f1a5c580c601573448cdea9b095ca Author:Adam Harvey ahar...@php.net Wed, 28 Aug 2013 20:33:42 -0700 Parents: 3745bdadc03a146fd37a3528658abc86bc8494df Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=72027cd0848f1a5c580c601573448cdea9b095ca Log: Fix bug #65579 (Using traits with get_class_methods causes segfault). Specifically, this checks if there are trait aliases defined in the class scope before attempting to dereference the first trait alias. This handles the case where a trait alias was used in a child trait but no aliases exist in the concrete class. Bugs: https://bugs.php.net/65579 Changed paths: M NEWS A Zend/tests/bug65579.phpt M Zend/zend_API.c Diff: diff --git a/NEWS b/NEWS index 093fa20..b718a74 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ PHP NEWS ?? ??? 2013, PHP 5.4.20 - Core: + . Fixed bug #65579 (Using traits with get_class_methods causes segfault). +(Adam) . Fixed bug #65490 (Duplicate calls to get lineno filename for DTRACE_FUNCTION_*). (Chris Jones) . Fixed bug #65483 (quoted-printable encode stream filter incorrectly encoding diff --git a/Zend/tests/bug65579.phpt b/Zend/tests/bug65579.phpt new file mode 100644 index 000..25d74ed --- /dev/null +++ b/Zend/tests/bug65579.phpt @@ -0,0 +1,29 @@ +--TEST-- +Bug #65579 (Using traits with get_class_methods causes segfault) +--FILE-- +?php +trait ParentTrait { +public function testMethod() { } +} + +trait ChildTrait { +use ParentTrait { +testMethod as testMethodFromParentTrait; +} +public function testMethod() { } +} + +class TestClass { +use ChildTrait; +} + +$obj = new TestClass(); +var_dump(get_class_methods($obj)); +? +--EXPECT-- +array(2) { + [0]= + string(10) testMethod + [1]= + string(25) testmethodfromparenttrait +} diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 90d27b7..870a9b6 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -3917,15 +3917,16 @@ ZEND_API const char* zend_find_alias_name(zend_class_entry *ce, const char *name { zend_trait_alias *alias, **alias_ptr; - alias_ptr = ce-trait_aliases; - alias = *alias_ptr; - while (alias) { - if (alias-alias_len == len - !strncasecmp(name, alias-alias, alias-alias_len)) { - return alias-alias; - } - alias_ptr++; + if (alias_ptr = ce-trait_aliases) { alias = *alias_ptr; + while (alias) { + if (alias-alias_len == len + !strncasecmp(name, alias-alias, alias-alias_len)) { + return alias-alias; + } + alias_ptr++; + alias = *alias_ptr; + } } return name; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: Zend/zend_API.c
Commit:e356d790309acf870dc22be7d00edaed8261 Author:Xinchen Hui larue...@php.net Thu, 29 Aug 2013 14:02:34 +0800 Parents: f0cb67402f2bcd3dc310cf938dfce799ccec7c7b 747daa53546bfa2c4a0fd88d2d3dffd30356c1ad Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e356d790309acf870dc22be7d00edaed8261 Log: Merge branch 'PHP-5.4' into PHP-5.5 Changed paths: MM Zend/zend_API.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Avoid compiler warning: Zend/zend_API.c
Commit:747daa53546bfa2c4a0fd88d2d3dffd30356c1ad Author:Xinchen Hui larue...@php.net Thu, 29 Aug 2013 14:02:15 +0800 Parents: 72027cd0848f1a5c580c601573448cdea9b095ca Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=747daa53546bfa2c4a0fd88d2d3dffd30356c1ad Log: Avoid compiler warning Changed paths: M Zend/zend_API.c Diff: diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 870a9b6..620a8f0 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -3917,7 +3917,7 @@ ZEND_API const char* zend_find_alias_name(zend_class_entry *ce, const char *name { zend_trait_alias *alias, **alias_ptr; - if (alias_ptr = ce-trait_aliases) { + if ((alias_ptr = ce-trait_aliases)) { alias = *alias_ptr; while (alias) { if (alias-alias_len == len -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Update NEWS: NEWS
Commit:4e3de606b54425029cc4617215a3360bb8550b2f Author:Xinchen Hui larue...@php.net Fri, 30 Aug 2013 11:22:58 +0800 Parents: e4fe53e2007791ff20fa00d5663f1766ccc5b148 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4e3de606b54425029cc4617215a3360bb8550b2f Log: Update NEWS Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index 518c997..d637d0a 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ PHP NEWS ?? ??? 2013, PHP 5.5.4 - Core: + . Fixed bug #60598 (cli/apache sapi segfault on objects manipulation). +(Laruence) . Improved fputcsv() to allow specifying escape character. . Fixed bug #65490 (Duplicate calls to get lineno filename for DTRACE_FUNCTION_*). (Chris Jones) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #60598 (cli/apache sapi segfault on objects manipulation): NEWS Zend/tests/bug60598.phpt Zend/zend_objects_API.c
Commit:7da6498342d76c34892bfa247bc1779d8f5ee1e6 Author:Xinchen Hui larue...@php.net Fri, 30 Aug 2013 11:20:24 +0800 Parents: dfc6feb6e84f27094e6a2e3947caa094f7c35d26 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7da6498342d76c34892bfa247bc1779d8f5ee1e6 Log: Fixed bug #60598 (cli/apache sapi segfault on objects manipulation) Bugs: https://bugs.php.net/60598 Changed paths: M NEWS A Zend/tests/bug60598.phpt M Zend/zend_objects_API.c Diff: diff --git a/NEWS b/NEWS index 6169cd0..42b69f5 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ PHP NEWS ?? ??? 2013, PHP 5.4.20 - Core: + . Fixed bug #60598 (cli/apache sapi segfault on objects manipulation). +(Laruence) . Fixed bug #65579 (Using traits with get_class_methods causes segfault). (Adam) . Fixed bug #65490 (Duplicate calls to get lineno filename for diff --git a/Zend/tests/bug60598.phpt b/Zend/tests/bug60598.phpt new file mode 100644 index 000..75a --- /dev/null +++ b/Zend/tests/bug60598.phpt @@ -0,0 +1,30 @@ +--TEST-- +Bug #60598 (cli/apache sapi segfault on objects manipulation) +--FILE-- +?php +define('OBJECT_COUNT', 1); + +$containers = array(); + +class Object { +protected $_guid = 0; +public function __construct() { + global $containers; + $this-guid = 1; +$containers[spl_object_hash($this)] = $this; +} +public function __destruct() { + global $containers; +$containers[spl_object_hash($this)] = NULL; +} +} + +for ($i = 0; $i OBJECT_COUNT; ++$i) { +new Object(); +} + +// You probably won't see this because of the zend_mm_heap corrupted +? +If you see this, try to increase OBJECT_COUNT to 100,000 +--EXPECT-- +If you see this, try to increase OBJECT_COUNT to 100,000 diff --git a/Zend/zend_objects_API.c b/Zend/zend_objects_API.c index 1fe5d0c..b5dd48f 100644 --- a/Zend/zend_objects_API.c +++ b/Zend/zend_objects_API.c @@ -57,6 +57,11 @@ ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TS obj-dtor(obj-object, i TSRMLS_CC); obj = objects-object_buckets[i].bucket.obj; obj-refcount--; + + if (obj-refcount == 0) { + /* in case gc_collect_cycle is triggered before free_storage */ + GC_REMOVE_ZOBJ_FROM_BUFFER(obj); + } } } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed compiler warnings: Zend/zend_operators.c Zend/zend_operators.h
Commit:0119bbba6b97e8657a92b0dc6327b04aad9532e7 Author:Xinchen Hui larue...@php.net Tue, 27 Aug 2013 15:44:30 +0800 Parents: 1c67a9940a7855bf485ae628d739d8c78ac6d1da Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0119bbba6b97e8657a92b0dc6327b04aad9532e7 Log: Fixed compiler warnings warning: 'local_dval' may be used uninitialized in this function [-Wmaybe-uninitialized] warning: 'dval2' may be used uninitialized in this function [-Wmaybe-uninitialized] Changed paths: M Zend/zend_operators.c M Zend/zend_operators.h Diff: diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 88995c4..5c84deb2 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -2138,8 +2138,8 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2) /* {{{ */ { int ret1, ret2; int oflow1, oflow2; - long lval1, lval2; - double dval1, dval2; + long lval1 = 0, lval2 = 0; + double dval1 = 0.0, dval2 = 0.0; if ((ret1=is_numeric_string_ex(Z_STRVAL_P(s1), Z_STRLEN_P(s1), lval1, dval1, 0, oflow1)) (ret2=is_numeric_string_ex(Z_STRVAL_P(s2), Z_STRLEN_P(s2), lval2, dval2, 0, oflow2))) { diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h index 0b890ff..6e7c1c0 100644 --- a/Zend/zend_operators.h +++ b/Zend/zend_operators.h @@ -132,7 +132,7 @@ static inline zend_uchar is_numeric_string_ex(const char *str, int length, long { const char *ptr; int base = 10, digits = 0, dp_or_e = 0; - double local_dval; + double local_dval = 0.0; zend_uchar type; if (!length) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.5': Zend/zend_operators.c Zend/zend_operators.h
Commit:72f80b2997920bf6fadc83ddcb3908252a9064eb Author:Xinchen Hui larue...@php.net Tue, 27 Aug 2013 15:45:27 +0800 Parents: 4b67c781f3fdd93e6a602ee980176720f1ace10e 0119bbba6b97e8657a92b0dc6327b04aad9532e7 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=72f80b2997920bf6fadc83ddcb3908252a9064eb Log: Merge branch 'PHP-5.5' Changed paths: MM Zend/zend_operators.c MM Zend/zend_operators.h Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed #65431 in zend_exception.c by Sixd: Zend/zend_exceptions.c
Commit:8280393828e31913da45ba5ae5efbce34d90f8a8 Author:Xinchen Hui larue...@php.net Thu, 15 Aug 2013 11:47:44 +0800 Parents: 9d62807190ebda858acbb09ad832c96570a97c40 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8280393828e31913da45ba5ae5efbce34d90f8a8 Log: Fixed #65431 in zend_exception.c by Sixd Bugs: https://bugs.php.net/65431 Changed paths: M Zend/zend_exceptions.c Diff: diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index f07c113..14ae75e 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -85,12 +85,12 @@ void zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ */ { #ifdef HAVE_DTRACE if (DTRACE_EXCEPTION_THROWN_ENABLED()) { - char *classname; - int name_len; + const char *classname; + zend_uint name_len; if (exception != NULL) { zend_get_object_classname(exception, classname, name_len TSRMLS_CC); - DTRACE_EXCEPTION_THROWN(classname); + DTRACE_EXCEPTION_THROWN((char *)classname); } else { DTRACE_EXCEPTION_THROWN(NULL); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.5': Zend/zend_vm_def.h Zend/zend_vm_execute.h main/main.c
Commit:b6fa0b40f7e1f942febdc35513f310a5880c4eb0 Author:Xinchen Hui larue...@php.net Wed, 14 Aug 2013 11:44:53 +0800 Parents: f95cd93408997bd03e1811060d1f25680dc66607 f3d18add089113a032d785169a6859c8719db307 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b6fa0b40f7e1f942febdc35513f310a5880c4eb0 Log: Merge branch 'PHP-5.5' Changed paths: MM Zend/zend_vm_def.h MM Zend/zend_vm_execute.h MM main/main.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed #65431 (Discarded qualifiers from pointer target warnings when using --enable-dtrace) by Sixd: Zend/zend.c Zend/zend_dtrace.c Zend/zend_vm_def.h Zend/zend_vm_execute.h mai
Commit:f4dc2240a048050a87a6e3e31573f13a2256cf2e Author:Xinchen Hui larue...@php.net Wed, 14 Aug 2013 11:42:39 +0800 Parents: 72aacbf735c59d4414b6111284a6232befd093fc Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f4dc2240a048050a87a6e3e31573f13a2256cf2e Log: Fixed #65431 (Discarded qualifiers from pointer target warnings when using --enable-dtrace) by Sixd Bugs: https://bugs.php.net/65431 Changed paths: M Zend/zend.c M Zend/zend_dtrace.c M Zend/zend_vm_def.h M Zend/zend_vm_execute.h M main/main.c Diff: diff --git a/Zend/zend.c b/Zend/zend.c index fc443d9..8560308 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -1097,7 +1097,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */ if(DTRACE_ERROR_ENABLED()) { char *dtrace_error_buffer; zend_vspprintf(dtrace_error_buffer, 0, format, args); - DTRACE_ERROR(dtrace_error_buffer, error_filename, error_lineno); + DTRACE_ERROR(dtrace_error_buffer, (char *)error_filename, error_lineno); efree(dtrace_error_buffer); } #endif /* HAVE_DTRACE */ diff --git a/Zend/zend_dtrace.c b/Zend/zend_dtrace.c index 5b2d0d2..8846893 100644 --- a/Zend/zend_dtrace.c +++ b/Zend/zend_dtrace.c @@ -24,7 +24,7 @@ #ifdef HAVE_DTRACE /* PHP DTrace probes {{{ */ -static inline char *dtrace_get_executed_filename(TSRMLS_D) +static inline const char *dtrace_get_executed_filename(TSRMLS_D) { if (EG(current_execute_data) EG(current_execute_data)-op_array) { return EG(current_execute_data)-op_array-filename; @@ -36,9 +36,9 @@ static inline char *dtrace_get_executed_filename(TSRMLS_D) ZEND_API zend_op_array *dtrace_compile_file(zend_file_handle *file_handle, int type TSRMLS_DC) { zend_op_array *res; - DTRACE_COMPILE_FILE_ENTRY(file_handle-opened_path, file_handle-filename); + DTRACE_COMPILE_FILE_ENTRY(file_handle-opened_path, (char *)file_handle-filename); res = compile_file(file_handle, type TSRMLS_CC); - DTRACE_COMPILE_FILE_RETURN(file_handle-opened_path, file_handle-filename); + DTRACE_COMPILE_FILE_RETURN(file_handle-opened_path, (char *)file_handle-filename); return res; } @@ -47,7 +47,7 @@ ZEND_API zend_op_array *dtrace_compile_file(zend_file_handle *file_handle, int t ZEND_API void dtrace_execute(zend_op_array *op_array TSRMLS_DC) { int lineno; - char *scope, *filename, *funcname, *classname; + const char *scope, *filename, *funcname, *classname; scope = filename = funcname = classname = NULL; /* we need filename and lineno for both execute and function probes */ @@ -65,41 +65,41 @@ ZEND_API void dtrace_execute(zend_op_array *op_array TSRMLS_DC) } if (DTRACE_EXECUTE_ENTRY_ENABLED()) { - DTRACE_EXECUTE_ENTRY(filename, lineno); + DTRACE_EXECUTE_ENTRY((char *)filename, lineno); } if (DTRACE_FUNCTION_ENTRY_ENABLED() funcname != NULL) { - DTRACE_FUNCTION_ENTRY(funcname, filename, lineno, classname, scope); + DTRACE_FUNCTION_ENTRY((char *)funcname, (char *)filename, lineno, (char *)classname, (char *)scope); } execute(op_array TSRMLS_CC); if (DTRACE_FUNCTION_RETURN_ENABLED() funcname != NULL) { - DTRACE_FUNCTION_RETURN(funcname, filename, lineno, classname, scope); + DTRACE_FUNCTION_RETURN((char *)funcname, (char *)filename, lineno, (char *)classname, (char *)scope); } if (DTRACE_EXECUTE_RETURN_ENABLED()) { - DTRACE_EXECUTE_RETURN(filename, lineno); + DTRACE_EXECUTE_RETURN((char *)filename, lineno); } } ZEND_API void dtrace_execute_internal(zend_execute_data *execute_data_ptr, int return_value_used TSRMLS_DC) { int lineno; - char *filename; + const char *filename; if (DTRACE_EXECUTE_ENTRY_ENABLED() || DTRACE_EXECUTE_RETURN_ENABLED()) { filename = dtrace_get_executed_filename(TSRMLS_C); lineno = zend_get_executed_lineno(TSRMLS_C); } if (DTRACE_EXECUTE_ENTRY_ENABLED()) { - DTRACE_EXECUTE_ENTRY(filename, lineno); + DTRACE_EXECUTE_ENTRY((char *)filename, lineno); } execute_internal(execute_data_ptr, return_value_used TSRMLS_CC); if (DTRACE_EXECUTE_RETURN_ENABLED()) { - DTRACE_EXECUTE_RETURN(filename, lineno); + DTRACE_EXECUTE_RETURN((char *)filename, lineno); } } diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 09d0b21..f6c6e6a 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -2984,7 +2984,7 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, CV) #ifdef HAVE_DTRACE if (DTRACE_EXCEPTION_CAUGHT_ENABLED()) { - DTRACE_EXCEPTION_CAUGHT(ce-name
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: Zend/zend.c Zend/zend_dtrace.c Zend/zend_vm_def.h Zend/zend_vm_execute.h main/main.c
Commit:f3d18add089113a032d785169a6859c8719db307 Author:Xinchen Hui larue...@php.net Wed, 14 Aug 2013 11:44:37 +0800 Parents: bab33f7e05fce2ec3834149826da6cbb1545d962 f4dc2240a048050a87a6e3e31573f13a2256cf2e Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f3d18add089113a032d785169a6859c8719db307 Log: Merge branch 'PHP-5.4' into PHP-5.5 Changed paths: MM Zend/zend.c MM Zend/zend_dtrace.c MM Zend/zend_vm_def.h MM Zend/zend_vm_execute.h MM main/main.c Diff: diff --cc Zend/zend_dtrace.c index 165172a,8846893..a07edd6 --- a/Zend/zend_dtrace.c +++ b/Zend/zend_dtrace.c @@@ -44,10 -44,10 +44,10 @@@ ZEND_API zend_op_array *dtrace_compile_ } /* We wrap the execute function to have fire the execute-entry/return and function-entry/return probes */ -ZEND_API void dtrace_execute(zend_op_array *op_array TSRMLS_DC) +ZEND_API void dtrace_execute_ex(zend_execute_data *execute_data TSRMLS_DC) { int lineno; - char *scope, *filename, *funcname, *classname; + const char *scope, *filename, *funcname, *classname; scope = filename = funcname = classname = NULL; /* we need filename and lineno for both execute and function probes */ @@@ -69,13 -69,13 +69,13 @@@ } if (DTRACE_FUNCTION_ENTRY_ENABLED() funcname != NULL) { - DTRACE_FUNCTION_ENTRY(funcname, filename, lineno, classname, scope); + DTRACE_FUNCTION_ENTRY((char *)funcname, (char *)filename, lineno, (char *)classname, (char *)scope); } - execute(op_array TSRMLS_CC); + execute_ex(execute_data TSRMLS_CC); if (DTRACE_FUNCTION_RETURN_ENABLED() funcname != NULL) { - DTRACE_FUNCTION_RETURN(funcname, filename, lineno, classname, scope); + DTRACE_FUNCTION_RETURN((char *)funcname, (char *)filename, lineno, (char *)classname, (char *)scope); } if (DTRACE_EXECUTE_RETURN_ENABLED()) { @@@ -83,23 -83,23 +83,23 @@@ } } -ZEND_API void dtrace_execute_internal(zend_execute_data *execute_data_ptr, int return_value_used TSRMLS_DC) +ZEND_API void dtrace_execute_internal(zend_execute_data *execute_data_ptr, zend_fcall_info *fci, int return_value_used TSRMLS_DC) { int lineno; - char *filename; + const char *filename; if (DTRACE_EXECUTE_ENTRY_ENABLED() || DTRACE_EXECUTE_RETURN_ENABLED()) { filename = dtrace_get_executed_filename(TSRMLS_C); lineno = zend_get_executed_lineno(TSRMLS_C); } if (DTRACE_EXECUTE_ENTRY_ENABLED()) { - DTRACE_EXECUTE_ENTRY(filename, lineno); + DTRACE_EXECUTE_ENTRY((char *)filename, lineno); } - execute_internal(execute_data_ptr, return_value_used TSRMLS_CC); + execute_internal(execute_data_ptr, fci, return_value_used TSRMLS_CC); if (DTRACE_EXECUTE_RETURN_ENABLED()) { - DTRACE_EXECUTE_RETURN(filename, lineno); + DTRACE_EXECUTE_RETURN((char *)filename, lineno); } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Re-fix Bug #65372 (Segfault in gc_zval_possible_root when return reference fails): Zend/zend_vm_def.h Zend/zend_vm_execute.h
Commit:a831499b4a1029118dc45375e62af42043110ade Author:Xinchen Hui larue...@php.net Tue, 6 Aug 2013 15:37:20 +0800 Parents: 47d66a0b4ea83bc4e1c9bfaa5c478cd42e28337c Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a831499b4a1029118dc45375e62af42043110ade Log: Re-fix Bug #65372 (Segfault in gc_zval_possible_root when return reference fails) Missed a zval_copy_ctor there Bugs: https://bugs.php.net/65372 Changed paths: M Zend/zend_vm_def.h M Zend/zend_vm_execute.h Diff: diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 83e40b5..09d0b21 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -2914,6 +2914,7 @@ ZEND_VM_HANDLER(111, ZEND_RETURN_BY_REF, CONST|TMP|VAR|CV, ANY) ALLOC_ZVAL(ret); INIT_PZVAL_COPY(ret, *retval_ptr_ptr); + zval_copy_ctor(ret); *EG(return_value_ptr_ptr) = ret; } break; diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 339e34b..4917cb6 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -2328,6 +2328,7 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CONST_HANDLER(ZEND_OPCODE_HAND ALLOC_ZVAL(ret); INIT_PZVAL_COPY(ret, *retval_ptr_ptr); + zval_copy_ctor(ret); *EG(return_value_ptr_ptr) = ret; } break; @@ -6749,6 +6750,7 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLE ALLOC_ZVAL(ret); INIT_PZVAL_COPY(ret, *retval_ptr_ptr); + zval_copy_ctor(ret); *EG(return_value_ptr_ptr) = ret; } break; @@ -11063,6 +11065,7 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLE ALLOC_ZVAL(ret); INIT_PZVAL_COPY(ret, *retval_ptr_ptr); + zval_copy_ctor(ret); *EG(return_value_ptr_ptr) = ret; } break; @@ -27040,6 +27043,7 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER ALLOC_ZVAL(ret); INIT_PZVAL_COPY(ret, *retval_ptr_ptr); + zval_copy_ctor(ret); *EG(return_value_ptr_ptr) = ret; } break; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.5': Zend/zend_vm_def.h Zend/zend_vm_execute.h
Commit:9b38673776fdd2501119acea04f9c5869a007cf1 Author:Xinchen Hui larue...@php.net Tue, 6 Aug 2013 15:39:46 +0800 Parents: ca0497bbac282c39048776a9f61052e67643 aa042d0c351056d4ee5ecc994cd596f7fbb427ea Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9b38673776fdd2501119acea04f9c5869a007cf1 Log: Merge branch 'PHP-5.5' Changed paths: MM Zend/zend_vm_def.h MM Zend/zend_vm_execute.h Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: Zend/zend_vm_def.h Zend/zend_vm_execute.h
Commit:aa042d0c351056d4ee5ecc994cd596f7fbb427ea Author:Xinchen Hui larue...@php.net Tue, 6 Aug 2013 15:39:33 +0800 Parents: 6e505f496905529a7976f0873a69fc222fe2d617 a831499b4a1029118dc45375e62af42043110ade Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=aa042d0c351056d4ee5ecc994cd596f7fbb427ea Log: Merge branch 'PHP-5.4' into PHP-5.5 Changed paths: MM Zend/zend_vm_def.h MM Zend/zend_vm_execute.h Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.5': Zend/zend_vm_def.h Zend/zend_vm_execute.h
Commit:78673d1badd39362dff15d4124d7df0cbcec862f Author:Xinchen Hui larue...@php.net Fri, 2 Aug 2013 18:39:58 +0800 Parents: fbd01eaecf5685911166f406a14a118acf345acf 6f1a762fab8dc42b0d2190cb3cbf89da8e0903e5 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=78673d1badd39362dff15d4124d7df0cbcec862f Log: Merge branch 'PHP-5.5' Changed paths: MM Zend/zend_vm_def.h MM Zend/zend_vm_execute.h Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: Zend/zend_vm_def.h Zend/zend_vm_execute.h
Commit:1e942dde24a8aff2ad4f7b7185e051cb019aa89d Author:Xinchen Hui larue...@php.net Fri, 2 Aug 2013 18:39:18 +0800 Parents: 1c32b97bc30ae9c3af138910ad8a05497dfb909c ce9169e360701ea3b1ab2366171c24d4de5e78e3 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1e942dde24a8aff2ad4f7b7185e051cb019aa89d Log: Merge branch 'PHP-5.4' into PHP-5.5 Changed paths: MM Zend/zend_vm_def.h MM Zend/zend_vm_execute.h Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Update NEWS: NEWS
Commit:6f1a762fab8dc42b0d2190cb3cbf89da8e0903e5 Author:Xinchen Hui larue...@php.net Fri, 2 Aug 2013 18:39:41 +0800 Parents: 1e942dde24a8aff2ad4f7b7185e051cb019aa89d Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6f1a762fab8dc42b0d2190cb3cbf89da8e0903e5 Log: Update NEWS Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index 6fe5c3a..82d4ca1 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ PHP NEWS ?? ??? 2013, PHP 5.5.2 - Core: + . Fixed bug #65372 (Segfault in gc_zval_possible_root when return reference +fails). (Laruence) . Fixed value of FILTER_SANITIZE_FULL_SPECIAL_CHARS constant (previously was erroneously set to FILTER_SANITIZE_SPECIAL_CHARS value). (Andrey avp200681 gmail com). -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug Bug #65372 (Segfault in gc_zval_possible_root when return reference fails): NEWS Zend/tests/bug65372.phpt Zend/zend_vm_def.h Zend/zend_vm_execute.h
Commit:ce9169e360701ea3b1ab2366171c24d4de5e78e3 Author:Xinchen Hui larue...@php.net Fri, 2 Aug 2013 18:37:15 +0800 Parents: cb13f8318b39f72798c3756dcfe55daae4c932e2 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ce9169e360701ea3b1ab2366171c24d4de5e78e3 Log: Fixed bug Bug #65372 (Segfault in gc_zval_possible_root when return reference fails) Bugs: https://bugs.php.net/65372 Changed paths: M NEWS A Zend/tests/bug65372.phpt M Zend/zend_vm_def.h M Zend/zend_vm_execute.h Diff: diff --git a/NEWS b/NEWS index d480e3d..0218615 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ PHP NEWS ?? ??? 2013, PHP 5.4.19 - Core. + . Fixed bug #65372 (Segfault in gc_zval_possible_root when return reference +fails). (Laruence) . Fixed bug #65304 (Use of max int in array_sum). (Laruence) . Fixed bug #65291 (get_defined_constants() causes PHP to crash in a very limited case). (Arpad) diff --git a/Zend/tests/bug65372.phpt b/Zend/tests/bug65372.phpt new file mode 100644 index 000..50fc2db --- /dev/null +++ b/Zend/tests/bug65372.phpt @@ -0,0 +1,40 @@ +--TEST-- +Bug #65372 (Segfault in gc_zval_possible_root when return reference fails) +--FILE-- +?php + +class ParentClass +{ +private static $_OBJECTS; + +public static function Get() +{ +self::$_OBJECTS[1] = new ChildClass(); +return self::$_OBJECTS[1]; +} +} + +class ChildClass extends ParentClass +{ +public $Manager; + +function __construct() +{ +$this-Manager = $this; +} + +public static function GetCurrent() +{ +return ChildClass::Get(); +} + +public static function Get() +{ +return parent::Get(); +} +} + +$staff = ChildClass::GetCurrent(); +? +--EXPECTF-- +Notice: Only variable references should be returned by reference in %sbug65372.php on line 30 diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 7346078..83e40b5 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -2910,9 +2910,11 @@ ZEND_VM_HANDLER(111, ZEND_RETURN_BY_REF, CONST|TMP|VAR|CV, ANY) } else if (EX_T(opline-op1.var).var.ptr_ptr == EX_T(opline-op1.var).var.ptr) { zend_error(E_NOTICE, Only variable references should be returned by reference); if (EG(return_value_ptr_ptr)) { - retval_ptr = *retval_ptr_ptr; - *EG(return_value_ptr_ptr) = retval_ptr; - Z_ADDREF_P(retval_ptr); + zval *ret; + + ALLOC_ZVAL(ret); + INIT_PZVAL_COPY(ret, *retval_ptr_ptr); + *EG(return_value_ptr_ptr) = ret; } break; } diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 6e466e4..339e34b 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -2324,9 +2324,11 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CONST_HANDLER(ZEND_OPCODE_HAND } else if (EX_T(opline-op1.var).var.ptr_ptr == EX_T(opline-op1.var).var.ptr) { zend_error(E_NOTICE, Only variable references should be returned by reference); if (EG(return_value_ptr_ptr)) { - retval_ptr = *retval_ptr_ptr; - *EG(return_value_ptr_ptr) = retval_ptr; - Z_ADDREF_P(retval_ptr); + zval *ret; + + ALLOC_ZVAL(ret); + INIT_PZVAL_COPY(ret, *retval_ptr_ptr); + *EG(return_value_ptr_ptr) = ret; } break; } @@ -6743,9 +6745,11 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLE } else if (EX_T(opline-op1.var).var.ptr_ptr == EX_T(opline-op1.var).var.ptr) { zend_error(E_NOTICE, Only variable references should be returned by reference); if (EG(return_value_ptr_ptr)) { - retval_ptr = *retval_ptr_ptr; - *EG(return_value_ptr_ptr) = retval_ptr; - Z_ADDREF_P(retval_ptr); + zval *ret; + + ALLOC_ZVAL(ret); + INIT_PZVAL_COPY(ret, *retval_ptr_ptr
[PHP-CVS] com php-src: Fixed tests (inet_pton behaves differently on Darwin): ext/standard/tests/network/ip2long_variation2_x64.phpt
Commit:47ac4f8670403144f1712a38ffee511b38d6040c Author:Xinchen Hui larue...@php.net Fri, 2 Aug 2013 18:43:08 +0800 Parents: 6f1a762fab8dc42b0d2190cb3cbf89da8e0903e5 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=47ac4f8670403144f1712a38ffee511b38d6040c Log: Fixed tests (inet_pton behaves differently on Darwin) Changed paths: M ext/standard/tests/network/ip2long_variation2_x64.phpt Diff: diff --git a/ext/standard/tests/network/ip2long_variation2_x64.phpt b/ext/standard/tests/network/ip2long_variation2_x64.phpt index d4b62fb..a6fde5b 100644 --- a/ext/standard/tests/network/ip2long_variation2_x64.phpt +++ b/ext/standard/tests/network/ip2long_variation2_x64.phpt @@ -1,13 +1,21 @@ --TEST-- Test ip2long() function : usage variation 2, 64 bit --SKIPIF-- -?php if(PHP_INT_SIZE != 8) {die('skip 64 bit only');} ? +?php +/* from man inet_pton : + All numbers supplied as ``parts'' in a `.' notation may be decimal, octal, or hexadecimal, as specified + in the C language (i.e., a leading 0x or 0X implies hexadecimal; otherwise, a leading 0 implies octal; + otherwise, the number is interpreted as decimal). +*/ +if(PHP_OS == 'Darwin') die(skip - inet_pton behaves differently on Darwin); +if(PHP_INT_SIZE != 8) {die('skip 64 bit only');} +? --FILE-- ?php /* Prototype : int ip2long(string ip_address) - * Description: Converts a string containing an (IPv4) Internet Protocol dotted address into a proper address + * Description: Converts a string containing an (IPv4) Internet Protocol dotted address into a proper address * Source code: ext/standard/basic_functions.c - * Alias to functions: + * Alias to functions: */ $ips = array( -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Update NEWs: NEWS
Commit:1fbcfc9bdba79772ea3d426ee55c055411dfad79 Author:Xinchen Hui larue...@php.net Thu, 25 Jul 2013 22:44:59 +0800 Parents: 9126909c08271b24cb42850b0bf888adf5992e30 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1fbcfc9bdba79772ea3d426ee55c055411dfad79 Log: Update NEWs Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index d1ff284..ff6ed35 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,7 @@ PHP NEWS some specific contents). (Stas) - SPL: + . Fixed bug #65328 (Segfault when getting SplStack object Value). (Laruence) . Added RecursiveTreeIterator setPostfix and getPostifx methods. (Joshua Thijssen) . Fixed bug #61697 (spl_autoload_functions returns lambda functions -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Upper section name: NEWS
Commit:515092917d8c31ea4fb2d80598dd672511717e4e Author:Xinchen Hui larue...@php.net Thu, 25 Jul 2013 22:45:15 +0800 Parents: 9909c4d4c4eb15a64dea0f10e10a8e3a2c0d879d Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=515092917d8c31ea4fb2d80598dd672511717e4e Log: Upper section name Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index a725547..8f7bbd8 100644 --- a/NEWS +++ b/NEWS @@ -14,7 +14,7 @@ PHP NEWS . Fixed bug #50308 (session id not appended properly for empty anchor tags). (Arpad) -- Spl: +- SPL: . Fixed bug #65328 (Segfault when getting SplStack object Value). (Laruence) - Phar: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/spl/spl_array.c
Commit:9126909c08271b24cb42850b0bf888adf5992e30 Author:Xinchen Hui larue...@php.net Thu, 25 Jul 2013 22:44:19 +0800 Parents: b8c8a04a85baf4bee2e3ce5891cd7d5d97cea303 9909c4d4c4eb15a64dea0f10e10a8e3a2c0d879d Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9126909c08271b24cb42850b0bf888adf5992e30 Log: Merge branch 'PHP-5.4' into PHP-5.5 Changed paths: MM ext/spl/spl_array.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #65328 (Segfault when getting SplStack object Value): NEWS ext/spl/spl_array.c ext/spl/tests/bug65328.phpt
Commit:9909c4d4c4eb15a64dea0f10e10a8e3a2c0d879d Author:Xinchen Hui larue...@php.net Thu, 25 Jul 2013 22:43:41 +0800 Parents: 96a53f6715ac563fa70f2db231478ecd0d313ff0 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9909c4d4c4eb15a64dea0f10e10a8e3a2c0d879d Log: Fixed bug #65328 (Segfault when getting SplStack object Value) Bugs: https://bugs.php.net/65328 Changed paths: M NEWS M ext/spl/spl_array.c A ext/spl/tests/bug65328.phpt Diff: diff --git a/NEWS b/NEWS index f76497b..a725547 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,9 @@ PHP NEWS . Fixed bug #50308 (session id not appended properly for empty anchor tags). (Arpad) +- Spl: + . Fixed bug #65328 (Segfault when getting SplStack object Value). (Laruence) + - Phar: . Fixed bug #65028 (Phar::buildFromDirectory creates corrupt archives for some specific contents). (Stas) diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index 40fbb4c..0bfb658 100644 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -1658,7 +1658,7 @@ SPL_METHOD(Array, getChildren) return; } if (instanceof_function(Z_OBJCE_PP(entry), Z_OBJCE_P(getThis()) TSRMLS_CC)) { - RETURN_ZVAL(*entry, 0, 0); + RETURN_ZVAL(*entry, 1, 0); } } diff --git a/ext/spl/tests/bug65328.phpt b/ext/spl/tests/bug65328.phpt new file mode 100644 index 000..32e6c24 --- /dev/null +++ b/ext/spl/tests/bug65328.phpt @@ -0,0 +1,348 @@ +--TEST-- +Bug #65328 (Segfault when getting SplStack object Value) +--FILE-- +?php +/** + * @author AlexanderC + */ + +class Tree +{ +/** + * @var Node + */ +protected $head; + +/** + * @param Node $head + */ +public function __construct(Node $head = null) +{ +$this-head = $head ? : new Node('HEAD'); +} + +/** + * @return Node + */ +public function getHead() +{ +return $this-head; +} + +/** + * @param mixed $uid + * @return Node|bool + */ +public function find($uid) +{ +$iterator = $this-getIterator(); + +/** @var Node $node */ +foreach($iterator as $node) { +if($node-getUid() === $uid) { +return $node; +} +} + +return false; +} + +/** + * @param mixed $uid + * @return \SplStack + */ +public function findAll($uid) +{ +$result = new \SplStack(); + +/** @var Node $node */ +foreach($this-getIterator() as $node) { +if($node-getUid() == $uid) { +$result-push($node); +} +} + +return $result; +} + +/** + * @return \RecursiveIteratorIterator + */ +public function getIterator() +{ +return new \RecursiveIteratorIterator( +$this-head-getChildren(), +\RecursiveIteratorIterator::SELF_FIRST +); +} +} + +class Node extends \RecursiveArrayIterator implements \Countable +{ +/** + * @var array + */ +protected $children = []; + +/** + * @var Node + */ +protected $parent; + +/** + * @var mixed + */ +protected $data; + +/** + * @var mixed + */ +protected $uid; + +/** + * @var int + */ +protected $index = 0; + +/** + * @var bool + */ +protected $assureUnique; + +/** + * @param mixed $data + * @param mixed $uid + * @param Node $parent + * @param bool $assureUnique + */ +public function __construct($data, $uid = null, Node $parent = null, $assureUnique = false) +{ +if(null !== $parent) { +$this-parent = $parent; +} + +$this-data = $data; +$this-uid = $uid ? : uniqid(sha1(serialize($data)), true); +$this-assureUnique = $assureUnique; +} + +/** + * @param mixed $uid + */ +public function setUid($uid) +{ +$this-uid = $uid; +} + +/** + * @return mixed + */ +public function getUid() +{ +return $this-uid; +} + +/** + * @param Node $child + */ +public function addChild(Node $child) +{ +$child-setParent($this); +$this-children[] = $child; +} + +/** + * @param array $children + */ +public function setChildren(array $children) +{ +$this-children = $children; +} + +/** + * @return array + */ +public function getChildrenArray() +{ +return $this-children; +} + +/** + * @param mixed $data + */ +public function setData($data) +{ +$this-data = $data; +} + +/** + * @return mixed + */ +public function getData() +{ +return $this-data; +} + +/** + * @param
[PHP-CVS] com php-src: Updaet NEWS: NEWS
Commit:3cd13204bb3655b11cdbe6a5c4a1d0ce17c0b950 Author:Xinchen Hui larue...@php.net Sun, 21 Jul 2013 16:19:40 +0800 Parents: 629965abe20b9d4ed4a793570791c983e705aa49 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3cd13204bb3655b11cdbe6a5c4a1d0ce17c0b950 Log: Updaet NEWS Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index 6f4479c..baa727f 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ PHP NEWS ||| ?? ??? 2013, PHP 5.5.2 +- Core: + . Fixed bug #65291 (get_defined_constants() causes PHP to crash in a very +limited case). (Arpad) + - Streams: . Fixed bug #65268 (select() implementation uses outdated tick API). (Anatol) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Reorder NEWS: NEWS
Commit:cc91fbe986c208c40b50af8154373693d4bd7c9b Author:Xinchen Hui larue...@php.net Sun, 21 Jul 2013 15:58:10 +0800 Parents: b963249456b043dba4a73cc6591d0eef11cebfbb Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cc91fbe986c208c40b50af8154373693d4bd7c9b Log: Reorder NEWS Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index 011b3d8..997a845 100644 --- a/NEWS +++ b/NEWS @@ -3,9 +3,9 @@ PHP NEWS ?? ??? 2013, PHP 5.4.19 - Core. - . Improve fix for bug #63186 (compile failure on netbsd). (Matteo) . Fixed bug #65291 (get_defined_constants() causes PHP to crash in a very limited case). (Arpad) + . Improve fix for bug #63186 (compile failure on netbsd). (Matteo) - Session: . Fixed bug #62129 (rfc1867 crashes php even though turned off). (gxd305 at -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: Zend/zend_builtin_functions.c
Commit:629965abe20b9d4ed4a793570791c983e705aa49 Author:Xinchen Hui larue...@php.net Sun, 21 Jul 2013 16:19:13 +0800 Parents: 3363e04fb48088cb6873ab79d993e556880483a3 cc91fbe986c208c40b50af8154373693d4bd7c9b Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=629965abe20b9d4ed4a793570791c983e705aa49 Log: Merge branch 'PHP-5.4' into PHP-5.5 Changed paths: MM Zend/zend_builtin_functions.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #65291 - get_defined_constants() crash with __CLASS__ in trait: NEWS Zend/tests/bug65291.phpt Zend/zend_builtin_functions.c
Commit:a015fa83a735da7342dd7ae172c4516265bed41d Author:Arpad Ray array...@gmail.com Fri, 19 Jul 2013 19:19:48 +0100 Parents: 2b9d42433f8e634593c2306d5d0ef61cc44281bf Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a015fa83a735da7342dd7ae172c4516265bed41d Log: Fixed bug #65291 - get_defined_constants() crash with __CLASS__ in trait Bugs: https://bugs.php.net/65291 Changed paths: M NEWS A Zend/tests/bug65291.phpt M Zend/zend_builtin_functions.c Diff: diff --git a/NEWS b/NEWS index 4826d0c..011b3d8 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,8 @@ PHP NEWS - Core. . Improve fix for bug #63186 (compile failure on netbsd). (Matteo) + . Fixed bug #65291 (get_defined_constants() causes PHP to crash in a very +limited case). (Arpad) - Session: . Fixed bug #62129 (rfc1867 crashes php even though turned off). (gxd305 at diff --git a/Zend/tests/bug65291.phpt b/Zend/tests/bug65291.phpt new file mode 100644 index 000..9e5cca5 --- /dev/null +++ b/Zend/tests/bug65291.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #65291 - get_defined_constants() causes PHP to crash in a very limited case. +--FILE-- +?php + +trait TestTrait +{ + public static function testStaticFunction() + { + return __CLASS__; + } +} +class Tester +{ + use TestTrait; +} + +$foo = Tester::testStaticFunction(); +get_defined_constants(); + +echo $foo; +? +--EXPECT-- +Tester diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index f29676b..1aba64e 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -1926,6 +1926,11 @@ static int add_constant_info(zend_constant *constant, void *arg TSRMLS_DC) zval *name_array = (zval *)arg; zval *const_val; + if (!constant-name) { + /* skip special constants */ + return 0; + } + MAKE_STD_ZVAL(const_val); *const_val = constant-value; zval_copy_ctor(const_val); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #65291 - get_defined_constants() crash with __CLASS__ in trait: Zend/tests/bug65291.phpt Zend/zend_builtin_functions.c
Commit:b963249456b043dba4a73cc6591d0eef11cebfbb Author:Arpad Ray array...@gmail.com Sat, 20 Jul 2013 11:05:13 +0100 Parents: a015fa83a735da7342dd7ae172c4516265bed41d Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b963249456b043dba4a73cc6591d0eef11cebfbb Log: Fixed bug #65291 - get_defined_constants() crash with __CLASS__ in trait Also fix and test for get_defined_constants(true) Bugs: https://bugs.php.net/65291 Changed paths: M Zend/tests/bug65291.phpt M Zend/zend_builtin_functions.c Diff: diff --git a/Zend/tests/bug65291.phpt b/Zend/tests/bug65291.phpt index 9e5cca5..7bc7633 100644 --- a/Zend/tests/bug65291.phpt +++ b/Zend/tests/bug65291.phpt @@ -17,6 +17,7 @@ class Tester $foo = Tester::testStaticFunction(); get_defined_constants(); +get_defined_constants(true); echo $foo; ? diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 1aba64e..dc496e9 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -1998,11 +1998,16 @@ ZEND_FUNCTION(get_defined_constants) while (zend_hash_get_current_data_ex(EG(zend_constants), (void **) val, pos) != FAILURE) { zval *const_val; + if (!val-name) { + /* skip special constants */ + goto next_constant; + } + if (val-module_number == PHP_USER_CONSTANT) { module_number = i; } else if (val-module_number i || val-module_number 0) { /* should not happen */ - goto bad_module_id; + goto next_constant; } else { module_number = val-module_number; } @@ -2019,7 +2024,7 @@ ZEND_FUNCTION(get_defined_constants) INIT_PZVAL(const_val); add_assoc_zval_ex(modules[module_number], val-name, val-name_len, const_val); -bad_module_id: +next_constant: zend_hash_move_forward_ex(EG(zend_constants), pos); } efree(module_names); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Update NEWS: NEWS
Commit:29281dee491d675185ce155e7956d1617d551c4a Author:Xinchen Hui larue...@php.net Sun, 21 Jul 2013 21:07:38 +0800 Parents: c7b58e49670ffce80422fe062196ddef31cdfc0a Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=29281dee491d675185ce155e7956d1617d551c4a Log: Update NEWS Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index baa727f..6a24e7a 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ PHP NEWS ?? ??? 2013, PHP 5.5.2 - Core: + . Fixed bug #65304 (Use of max int in array_sum). (Laruence) . Fixed bug #65291 (get_defined_constants() causes PHP to crash in a very limited case). (Arpad) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #65304 (Use of max int in array_sum): NEWS ext/standard/array.c ext/standard/tests/array/bug65304.phpt
Commit:3380de9774551964af976aa48328e7e6f9bd78ff Author:Xinchen Hui larue...@php.net Sun, 21 Jul 2013 21:07:19 +0800 Parents: cc91fbe986c208c40b50af8154373693d4bd7c9b Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3380de9774551964af976aa48328e7e6f9bd78ff Log: Fixed bug #65304 (Use of max int in array_sum) Bugs: https://bugs.php.net/65304 Changed paths: M NEWS M ext/standard/array.c A ext/standard/tests/array/bug65304.phpt Diff: diff --git a/NEWS b/NEWS index 997a845..ae429c2 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ PHP NEWS ?? ??? 2013, PHP 5.4.19 - Core. + . Fixed bug #65304 (Use of max int in array_sum). (Laruence) . Fixed bug #65291 (get_defined_constants() causes PHP to crash in a very limited case). (Arpad) . Improve fix for bug #63186 (compile failure on netbsd). (Matteo) diff --git a/ext/standard/array.c b/ext/standard/array.c index e218dc0..0eaca16 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -4037,17 +4037,7 @@ PHP_FUNCTION(array_sum) entry_n = **entry; zval_copy_ctor(entry_n); convert_scalar_to_number(entry_n TSRMLS_CC); - - if (Z_TYPE(entry_n) == IS_LONG Z_TYPE_P(return_value) == IS_LONG) { - dval = (double)Z_LVAL_P(return_value) + (double)Z_LVAL(entry_n); - if ( (double)LONG_MIN = dval dval = (double)LONG_MAX ) { - Z_LVAL_P(return_value) += Z_LVAL(entry_n); - continue; - } - } - convert_to_double(return_value); - convert_to_double(entry_n); - Z_DVAL_P(return_value) += Z_DVAL(entry_n); + fast_add_function(return_value, return_value, entry_n TSRMLS_CC); } } /* }}} */ diff --git a/ext/standard/tests/array/bug65304.phpt b/ext/standard/tests/array/bug65304.phpt new file mode 100644 index 000..e5c9dfc --- /dev/null +++ b/ext/standard/tests/array/bug65304.phpt @@ -0,0 +1,10 @@ +--TEST-- +Bug #65304 (Use of max int in array_sum) +--FILE-- +?php +var_dump(array_sum(array(PHP_INT_MAX, 1))); +var_dump(PHP_INT_MAX + 1); +? +--EXPECTF-- +float(%s) +float(%s) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/standard/array.c
Commit:c7b58e49670ffce80422fe062196ddef31cdfc0a Author:Xinchen Hui larue...@php.net Sun, 21 Jul 2013 21:07:27 +0800 Parents: 3cd13204bb3655b11cdbe6a5c4a1d0ce17c0b950 3380de9774551964af976aa48328e7e6f9bd78ff Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c7b58e49670ffce80422fe062196ddef31cdfc0a Log: Merge branch 'PHP-5.4' into PHP-5.5 Changed paths: MM ext/standard/array.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Update NEWS: NEWS
Commit:e20fc854540716117aea5e169cf2a5cbb4af0a56 Author:Xinchen Hui larue...@php.net Sun, 14 Jul 2013 11:56:37 +0800 Parents: 2c4f8234375d0847d7b690d314ea47db29dcbe47 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e20fc854540716117aea5e169cf2a5cbb4af0a56 Log: Update NEWS Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index 65fbb5f..5422b0b 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ PHP NEWS ?? ??? 2013, PHP 5.5.1 - Core: + . Fixed bug #65254 (Exception not catchable when exception thrown in autoload +with a namespace). (Laruence) . Fixed bug #65088 (Generated configure script is malformed on OpenBSD). (Adam) . Fixed bug #65108 (is_callable() triggers Fatal Error). -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: Zend/zend_vm_def.h Zend/zend_vm_execute.h
Commit:2c4f8234375d0847d7b690d314ea47db29dcbe47 Author:Xinchen Hui larue...@php.net Sun, 14 Jul 2013 11:53:56 +0800 Parents: efc89368ddcb094500adb3a8ad13559a581fd018 ebad5178c4ae0da124469b1432fb0e890f6147da Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2c4f8234375d0847d7b690d314ea47db29dcbe47 Log: Merge branch 'PHP-5.4' into PHP-5.5 Conflicts: Zend/zend_vm_def.h Zend/zend_vm_execute.h Changed paths: MM Zend/zend_vm_def.h MM Zend/zend_vm_execute.h Diff: diff --cc Zend/zend_vm_execute.h index 866502a,6e466e4..f7d7301 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@@ -1422,8 -1392,7 +1422,7 @@@ static int ZEND_FASTCALL ZEND_BRK_SPEC SAVE_OPLINE(); el = zend_brk_cont(Z_LVAL_P(opline-op2.zv), opline-op1.opline_num, - EX(op_array), EX_Ts() TSRMLS_CC); + EX(op_array), execute_data TSRMLS_CC); - ZEND_VM_JMP(EX(op_array)-opcodes + el-brk); } @@@ -1434,8 -1403,7 +1433,7 @@@ static int ZEND_FASTCALL ZEND_CONT_SPE SAVE_OPLINE(); el = zend_brk_cont(Z_LVAL_P(opline-op2.zv), opline-op1.opline_num, - EX(op_array), EX_Ts() TSRMLS_CC); + EX(op_array), execute_data TSRMLS_CC); - ZEND_VM_JMP(EX(op_array)-opcodes + el-cont); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #65254 (Exception not catchable when exception thrown in autoload with a namespace).: NEWS Zend/tests/bug65254.phpt Zend/zend_vm_def.h Zend/zend_vm_execute.h
Commit:ebad5178c4ae0da124469b1432fb0e890f6147da Author:Xinchen Hui larue...@php.net Sun, 14 Jul 2013 11:47:06 +0800 Parents: eab076020d0520267074bbbda0fec1dd69df4136 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ebad5178c4ae0da124469b1432fb0e890f6147da Log: Fixed bug #65254 (Exception not catchable when exception thrown in autoload with a namespace). Bugs: https://bugs.php.net/65254 Changed paths: M NEWS A Zend/tests/bug65254.phpt M Zend/zend_vm_def.h M Zend/zend_vm_execute.h diff --git a/NEWS b/NEWS index a172918..763e08d 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ PHP NEWS ?? ??? 2013, PHP 5.4.18 - Core: + . Fixed bug #65254 (Exception not catchable when exception thrown in autoload +with a namespace). (Laruence) . Fixed bug #65108 (is_callable() triggers Fatal Error). (David Soria Parra, Laruence) . Fixed bug #65088 (Generated configure script is malformed on OpenBSD). diff --git a/Zend/tests/bug65254.phpt b/Zend/tests/bug65254.phpt new file mode 100644 index 000..d2ebba4 --- /dev/null +++ b/Zend/tests/bug65254.phpt @@ -0,0 +1,21 @@ +--TEST-- +Bug #65254 (Exception not catchable when exception thrown in autoload with a namespace) +--FILE-- +?php +function __autoload($class) +{ +eval(namespace ns_test; class test {}); + +throw new \Exception('abcd'); +} + +try +{ +\ns_test\test::go(); +} +catch (Exception $e) +{ +echo 'caught'; +} +--EXPECT-- +caught diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 3d84a37..7346078 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -2229,9 +2229,11 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS ce = CACHED_PTR(opline-op1.literal-cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline-op1.zv), Z_STRLEN_P(opline-op1.zv), opline-op1.literal + 1, opline-extended_value TSRMLS_CC); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } if (UNEXPECTED(ce == NULL)) { - CHECK_EXCEPTION(); - ZEND_VM_NEXT_OPCODE(); + zend_error_noreturn(E_ERROR, Class '%s' not found, Z_STRVAL_P(opline-op1.zv)); } CACHE_PTR(opline-op1.literal-cache_slot, ce); } @@ -2414,9 +2416,11 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV) if (Z_TYPE_PP(obj) == IS_STRING) { ce = zend_fetch_class_by_name(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj), NULL, 0 TSRMLS_CC); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } if (UNEXPECTED(ce == NULL)) { - CHECK_EXCEPTION(); - ZEND_VM_NEXT_OPCODE(); + zend_error_noreturn(E_ERROR, Class '%s' not found, Z_STRVAL_PP(obj)); } EX(called_scope) = ce; EX(object) = NULL; @@ -3498,9 +3502,11 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST) ce = CACHED_PTR(opline-op1.literal-cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline-op1.zv), Z_STRLEN_P(opline-op1.zv), opline-op1.literal + 1, opline-extended_value TSRMLS_CC); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } if (UNEXPECTED(ce == NULL)) { - CHECK_EXCEPTION(); - ZEND_VM_NEXT_OPCODE(); + zend_error_noreturn(E_ERROR, Class '%s' not found, Z_STRVAL_P(opline-op1.zv)); } CACHE_PTR(opline-op1.literal-cache_slot, ce); } @@ -3887,15 +3893,17 @@ ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMP|VAR|CV, UNUSED|CONST|VAR) ce = CACHED_PTR(opline-op2.literal-cache_slot); } else { ce = zend_fetch_class_by_name(Z_STRVAL_P(opline-op2.zv), Z_STRLEN_P(opline-op2.zv), opline-op2.literal + 1, 0 TSRMLS_CC); - if (UNEXPECTED(ce == NULL)) { + if (UNEXPECTED(EG(exception) != NULL
[PHP-CVS] com php-src: Merge branch 'PHP-5.5': Zend/zend_vm_def.h Zend/zend_vm_execute.h
Commit:75808151e378cc0d9e3a8028011d6e00143fff3e Author:Xinchen Hui larue...@php.net Sun, 14 Jul 2013 12:01:50 +0800 Parents: b64e2218f2c6fac302cfe2900f525f084e382935 e20fc854540716117aea5e169cf2a5cbb4af0a56 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=75808151e378cc0d9e3a8028011d6e00143fff3e Log: Merge branch 'PHP-5.5' Conflicts: Zend/zend_vm_execute.h Changed paths: MM Zend/zend_vm_def.h MM Zend/zend_vm_execute.h Diff: diff --cc Zend/zend_vm_execute.h index c947c3e,f7d7301..a6fec47 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@@ -15796,9 -15804,11 +15822,11 @@@ static int ZEND_FASTCALL ZEND_UNSET_VA } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { zval_ptr_dtor(varname); } - if (free_op1.var) {zval_ptr_dtor(free_op1.var);}; + zval_ptr_dtor(free_op1.var); - CHECK_EXCEPTION(); - ZEND_VM_NEXT_OPCODE(); + HANDLE_EXCEPTION(); + } + if (UNEXPECTED(ce == NULL)) { + zend_error_noreturn(E_ERROR, Class '%s' not found, Z_STRVAL_P(opline-op2.zv)); } CACHE_PTR(opline-op2.literal-cache_slot, ce); } @@@ -20360,9 -20384,11 +20392,11 @@@ static int ZEND_FASTCALL ZEND_UNSET_VA } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { zval_ptr_dtor(varname); } - if (free_op1.var) {zval_ptr_dtor(free_op1.var);}; + zval_ptr_dtor(free_op1.var); - CHECK_EXCEPTION(); - ZEND_VM_NEXT_OPCODE(); + HANDLE_EXCEPTION(); + } + if (UNEXPECTED(ce == NULL)) { + zend_error_noreturn(E_ERROR, Class '%s' not found, Z_STRVAL_P(opline-op2.zv)); } CACHE_PTR(opline-op2.literal-cache_slot, ce); } @@@ -21781,9 -21807,11 +21817,11 @@@ static int ZEND_FASTCALL ZEND_UNSET_VA } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { zval_ptr_dtor(varname); } - if (free_op1.var) {zval_ptr_dtor(free_op1.var);}; + zval_ptr_dtor(free_op1.var); - CHECK_EXCEPTION(); - ZEND_VM_NEXT_OPCODE(); + HANDLE_EXCEPTION(); + } + if (UNEXPECTED(ce == NULL)) { + zend_error_noreturn(E_ERROR, Class '%s' not found, Z_STRVAL_P(opline-op2.zv)); } CACHE_PTR(opline-op2.literal-cache_slot, ce); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: array_column: Changing integer in test output to use %d: ext/standard/tests/array/array_column_basic.phpt
Commit:d1c261d7f890c037fdbd4f54cc3a43ff7473a2d2 Author:Ben Ramsey b...@benramsey.com Sat, 6 Jul 2013 20:50:34 + Parents: eed492ce847c5de575a3aacac63a01f63d00ea88 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d1c261d7f890c037fdbd4f54cc3a43ff7473a2d2 Log: array_column: Changing integer in test output to use %d Changed paths: M ext/standard/tests/array/array_column_basic.phpt Diff: diff --git a/ext/standard/tests/array/array_column_basic.phpt b/ext/standard/tests/array/array_column_basic.phpt index 7c30cdf..418f373 100644 --- a/ext/standard/tests/array/array_column_basic.phpt +++ b/ext/standard/tests/array/array_column_basic.phpt @@ -178,7 +178,7 @@ array(3) { *** Testing multiple data types *** array(8) { [0]= - object(stdClass)#1 (0) { + object(stdClass)#%d (0) { } [1]= float(34.2345) @@ -197,7 +197,7 @@ array(8) { } array(8) { [1]= - object(stdClass)#1 (0) { + object(stdClass)#%d (0) { } [2]= float(34.2345) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Update NEWS:w: NEWS
Commit:60bbc78bde18d2d21cd4c0eaf86d348368c8aca9 Author:Xinchen Hui larue...@php.net Thu, 27 Jun 2013 12:38:35 +0800 Parents: c2cfc242c4f194d5192c6c37d48ee341426bdf05 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=60bbc78bde18d2d21cd4c0eaf86d348368c8aca9 Log: Update NEWS:w Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index 7550fb5..9cdd3e2 100644 --- a/NEWS +++ b/NEWS @@ -36,6 +36,7 @@ PHP NEWS (Damjan Cvetko) - SPL: + . Fixed bug #65136 (RecursiveDirectoryIterator segfault). (Laruence) . Fixed bug #61828 (Memleak when calling Directory(Recursive)Iterator /Spl(Temp)FileObject ctor twice). (Laruence) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #65136 (RecursiveDirectoryIterator segfault): NEWS ext/spl/spl_directory.c
Commit:fa8611c81ee72839cdff3e72b18cc586feb4aa29 Author:Xinchen Hui larue...@php.net Thu, 27 Jun 2013 12:37:57 +0800 Parents: 76866e0a2e5e8175621edfce9b4c091d3007d42a Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=fa8611c81ee72839cdff3e72b18cc586feb4aa29 Log: Fixed bug #65136 (RecursiveDirectoryIterator segfault) Bugs: https://bugs.php.net/65136 Changed paths: M NEWS M ext/spl/spl_directory.c Diff: diff --git a/NEWS b/NEWS index c7e4c58..a4295e8 100644 --- a/NEWS +++ b/NEWS @@ -42,6 +42,7 @@ PHP NEWS (Damjan Cvetko) - SPL: + . Fixed bug #65136 (RecursiveDirectoryIterator segfault). (Laruence) . Fixed bug #61828 (Memleak when calling Directory(Recursive)Iterator /Spl(Temp)FileObject ctor twice). (Laruence) diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 056e7e4..7f0ce63 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -1510,7 +1510,7 @@ SPL_METHOD(RecursiveDirectoryIterator, hasChildren) Returns an iterator for the current entry if it is a directory */ SPL_METHOD(RecursiveDirectoryIterator, getChildren) { - zval zpath, zflags; + zval *zpath, *zflags; spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); spl_filesystem_object *subdir; char slash = SPL_HAS_FLAG(intern-flags, SPL_FILE_DIR_UNIXPATHS) ? '/' : DEFAULT_SLASH; @@ -1524,11 +1524,13 @@ SPL_METHOD(RecursiveDirectoryIterator, getChildren) if (SPL_HAS_FLAG(intern-flags, SPL_FILE_DIR_CURRENT_AS_PATHNAME)) { RETURN_STRINGL(intern-file_name, intern-file_name_len, 1); } else { - INIT_PZVAL(zflags); - INIT_PZVAL(zpath); - ZVAL_LONG(zflags, intern-flags); - ZVAL_STRINGL(zpath, intern-file_name, intern-file_name_len, 0); - spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), return_value, 0, zpath, zflags TSRMLS_CC); + MAKE_STD_ZVAL(zflags); + MAKE_STD_ZVAL(zpath); + ZVAL_LONG(zflags, intern-flags); + ZVAL_STRINGL(zpath, intern-file_name, intern-file_name_len, 1); + spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), return_value, 0, zpath, zflags TSRMLS_CC); + zval_ptr_dtor(zpath); + zval_ptr_dtor(zflags); subdir = (spl_filesystem_object*)zend_object_store_get_object(return_value TSRMLS_CC); if (subdir) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/spl/spl_directory.c
Commit:c2cfc242c4f194d5192c6c37d48ee341426bdf05 Author:Xinchen Hui larue...@php.net Thu, 27 Jun 2013 12:38:13 +0800 Parents: 402b3aaf56cbf3ce191f9d8985b056dc41c94dba fa8611c81ee72839cdff3e72b18cc586feb4aa29 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c2cfc242c4f194d5192c6c37d48ee341426bdf05 Log: Merge branch 'PHP-5.4' into PHP-5.5 Changed paths: MM ext/spl/spl_directory.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug (is_callable() triggers Fatal Error): NEWS Zend/tests/bug65108.phpt Zend/zend_API.c
Commit:9cf3e65391d6aa637e5471449499e957cff6ee89 Author:Xinchen Hui larue...@php.net Mon, 24 Jun 2013 23:45:08 +0800 Parents: a0d48e01edb90a6b9a3db39104b9d7b098001dba Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9cf3e65391d6aa637e5471449499e957cff6ee89 Log: Fixed bug (is_callable() triggers Fatal Error) This bug is also exists in 5.4, and previous fix by dsp is not complete for __callStatic stituation, see test script Changed paths: M NEWS A Zend/tests/bug65108.phpt M Zend/zend_API.c Diff: diff --git a/NEWS b/NEWS index 9ec6740..2dbe468 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ PHP NEWS ?? ??? 2013, PHP 5.4.18 - Core: + . Fixed bug #65108 (is_callable() triggers Fatal Error). +(David Soria Parra, Laruence) . Fixed bug #65088 (Generated configure script is malformed on OpenBSD). (Adam) diff --git a/Zend/tests/bug65108.phpt b/Zend/tests/bug65108.phpt new file mode 100644 index 000..d3e5a65 --- /dev/null +++ b/Zend/tests/bug65108.phpt @@ -0,0 +1,27 @@ +--TEST-- +Bug #65108 (is_callable() triggers Fatal Error) +--FILE-- +?php +class C { + private function f() {} + static function __callStatic($name, $args) {} +} + +class B { + public function B() { + $isCallable = is_callable(array(new C, 'f')); + var_dump($isCallable); + } +} + +new B(); + +Class E { + private function f() {} + function __call($name, $args) {} +} +$isCallable = is_callable(array('E', 'f')); +var_dump($isCallable); +--EXPECT-- +bool(false) +bool(false) diff --git a/Zend/zend_API.c b/Zend/zend_API.c index e1f80c7..90d27b7 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2779,8 +2779,8 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca } if ((check_flags IS_CALLABLE_CHECK_NO_ACCESS) == 0 (fcc-calling_scope -(fcc-calling_scope-__call || - fcc-calling_scope-__callstatic))) { +((fcc-object_ptr fcc-calling_scope-__call) || + (!fcc-object_ptr fcc-calling_scope-__callstatic { if (fcc-function_handler-op_array.fn_flags ZEND_ACC_PRIVATE) { if (!zend_check_private(fcc-function_handler, fcc-object_ptr ? Z_OBJCE_P(fcc-object_ptr) : EG(scope), lmname, mlen TSRMLS_CC)) { retval = 0; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: NEWS Zend/zend_API.c
Commit:a6a3aa5d4930bd5134cc5f16e0c931c4a532b1da Author:Xinchen Hui larue...@php.net Mon, 24 Jun 2013 23:49:30 +0800 Parents: ecd9d7625098bfc0a14ffa1fc39535848e71fc80 9cf3e65391d6aa637e5471449499e957cff6ee89 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a6a3aa5d4930bd5134cc5f16e0c931c4a532b1da Log: Merge branch 'PHP-5.4' into PHP-5.5 Conflicts: Zend/zend_API.c Changed paths: MM NEWS MM Zend/zend_API.c Diff: diff --cc NEWS index 0a57834,2dbe468..a777e8d --- a/NEWS +++ b/NEWS @@@ -1,14 -1,12 +1,15 @@@ PHP NEWS ||| -?? ??? 2013, PHP 5.4.18 +?? ??? 2013, PHP 5.5.1 - Core: - . Fixed bug #65108 (is_callable() triggers Fatal Error). -(David Soria Parra, Laruence) . Fixed bug #65088 (Generated configure script is malformed on OpenBSD). (Adam) - . Fixed bug #65108 (is_callable() triggers Fatal Error). (David Soria Parra) ++ . Fixed bug #65108 (is_callable() triggers Fatal Error). ++(David Soria Parra, Laruence) + +OPcache + . OPcache must be compatible with LiteSpeed SAPI (Dmitry) - CLI server: . Fixed bug #65066 (Cli server not responsive when responding with 422 http -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Update NEWS: NEWS
Commit:efd3c72de3e736758b5a94194228ea1415049789 Author:Xinchen Hui larue...@php.net Tue, 25 Jun 2013 13:39:31 +0800 Parents: 9d9ec2a90e59d939f2281d29dd6b9caed4f14a39 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=efd3c72de3e736758b5a94194228ea1415049789 Log: Update NEWS Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index a777e8d..ee3d858 100644 --- a/NEWS +++ b/NEWS @@ -8,7 +8,7 @@ PHP NEWS . Fixed bug #65108 (is_callable() triggers Fatal Error). (David Soria Parra, Laruence) -OPcache +- OPcache . OPcache must be compatible with LiteSpeed SAPI (Dmitry) - CLI server: @@ -30,6 +30,10 @@ OPcache . Implemented FR #63472 (Setting SO_BINDTODEVICE with socket_set_option). (Damjan Cvetko) +- SPL: + . Fixed bug #61828 (Memleak when calling Directory(Recursive)Iterator +/Spl(Temp)FileObject ctor twice). (Laruence) + 20 Jun 2013, PHP 5.5.0 - Core: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed Bug #61828 (Memleak when calling Directory(Recursive)Iterator/Spl(Temp)FileObject ctor twice): NEWS ext/spl/spl_directory.c ext/spl/tests/bug61828.phpt
Commit:38eb909d064ecbbf51d5869a629dae91a6ed9dcf Author:Xinchen Hui larue...@php.net Tue, 25 Jun 2013 13:37:56 +0800 Parents: 982c11573dd23d3070dfdd149e4ef1a5a1d14dab Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=38eb909d064ecbbf51d5869a629dae91a6ed9dcf Log: Fixed Bug #61828 (Memleak when calling Directory(Recursive)Iterator/Spl(Temp)FileObject ctor twice) Bugs: https://bugs.php.net/61828 Changed paths: M NEWS M ext/spl/spl_directory.c A ext/spl/tests/bug61828.phpt Diff: diff --git a/NEWS b/NEWS index e441cd3..685c037 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,10 @@ PHP NEWS . Implemented FR #63472 (Setting SO_BINDTODEVICE with socket_set_option). (Damjan Cvetko) +- SPL: + . Fixed bug #61828 (Memleak when calling Directory(Recursive)Iterator +/Spl(Temp)FileObject ctor twice). (Laruence) + ?? ??? 2013, PHP 5.4.17 - Core: diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index f43a370..056e7e4 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -710,6 +710,12 @@ void spl_filesystem_object_construct(INTERNAL_FUNCTION_PARAMETERS, long ctor_fla } intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); + if (intern-_path) { + /* object is alreay initialized */ + zend_restore_error_handling(error_handling TSRMLS_CC); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Directory object is already initialized); + return; + } intern-flags = flags; #ifdef HAVE_GLOB if (SPL_HAS_FLAG(ctor_flags, DIT_CTOR_GLOB) strstr(path, glob://) != path) { diff --git a/ext/spl/tests/bug61828.phpt b/ext/spl/tests/bug61828.phpt new file mode 100644 index 000..04d435e --- /dev/null +++ b/ext/spl/tests/bug61828.phpt @@ -0,0 +1,11 @@ +--TEST-- +Bug #61828 (Memleak when calling Directory(Recursive)Iterator/Spl(Temp)FileObject ctor twice) +--FILE-- +?php +$x = new DirectoryIterator('.'); +$x-__construct('/tmp'); +echo Okey; +? +--EXPECTF-- +Warning: DirectoryIterator::__construct(): Directory object is already initialized in %sbug61828.php on line 3 +Okey -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.5': ext/opcache/ZendAccelerator.c
Commit:d99a76ca965dac487b457a6599a4f42ba06ad033 Author:Xinchen Hui larue...@php.net Tue, 25 Jun 2013 13:48:54 +0800 Parents: d8374c5590370056cf2001e5a2f879ab9a3e77b0 157ccaf507b7a94c43db4ec1b7321aac5cc68e8b Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d99a76ca965dac487b457a6599a4f42ba06ad033 Log: Merge branch 'PHP-5.5' Changed paths: MM ext/opcache/ZendAccelerator.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #64827 Segfault in zval_mark_grey (zend_gc.c): NEWS ext/opcache/ZendAccelerator.c
Commit:157ccaf507b7a94c43db4ec1b7321aac5cc68e8b Author:Xinchen Hui larue...@php.net Tue, 25 Jun 2013 13:47:50 +0800 Parents: efd3c72de3e736758b5a94194228ea1415049789 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=157ccaf507b7a94c43db4ec1b7321aac5cc68e8b Log: Fixed bug #64827 Segfault in zval_mark_grey (zend_gc.c) I can not get a reproduce script since the context is very strict. Of course I will try to make one, but for now, I just commit this first. Bugs: https://bugs.php.net/64827 Changed paths: M NEWS M ext/opcache/ZendAccelerator.c Diff: diff --git a/NEWS b/NEWS index ee3d858..18eedd3 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,7 @@ PHP NEWS (David Soria Parra, Laruence) - OPcache + . Fixed bug #64827 (Segfault in zval_mark_grey (zend_gc.c)). (Laruence) . OPcache must be compatible with LiteSpeed SAPI (Dmitry) - CLI server: diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 4d98397..efd902f 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -2163,7 +2163,10 @@ static void accel_fast_zval_ptr_dtor(zval **zval_ptr) case IS_CONSTANT_ARRAY: { TSRMLS_FETCH(); + GC_REMOVE_ZVAL_FROM_BUFFER(zvalue); if (zvalue-value.ht (zvalue-value.ht != EG(symbol_table))) { + /* break possible cycles */ + Z_TYPE_P(zvalue) = IS_NULL; zvalue-value.ht-pDestructor = (dtor_func_t)accel_fast_zval_ptr_dtor; accel_fast_hash_destroy(zvalue-value.ht); } @@ -2173,6 +2176,7 @@ static void accel_fast_zval_ptr_dtor(zval **zval_ptr) { TSRMLS_FETCH(); + GC_REMOVE_ZVAL_FROM_BUFFER(zvalue); Z_OBJ_HT_P(zvalue)-del_ref(zvalue TSRMLS_CC); } break; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fix test typo: ext/xmlreader/tests/012.phpt
Commit:2ce4bd7f2d44016ba05aae32e10b8ea5d6293034 Author:Xinchen Hui larue...@php.net Wed, 19 Jun 2013 11:15:52 +0800 Parents: 6b896fa57f01e7ad165e48846bad6e2d3bdca953 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2ce4bd7f2d44016ba05aae32e10b8ea5d6293034 Log: Fix test typo Changed paths: M ext/xmlreader/tests/012.phpt Diff: diff --git a/ext/xmlreader/tests/012.phpt b/ext/xmlreader/tests/012.phpt index 94fb340..e0edeef 100644 --- a/ext/xmlreader/tests/012.phpt +++ b/ext/xmlreader/tests/012.phpt @@ -38,7 +38,7 @@ $reader-close(); echo \nUsing URI:\n; $reader = new XMLReader(); -$file = dirname(__FILE__) . '/_012.xml'; +$file = dirname(__FILE__) . '/012.xml'; if (DIRECTORY_SEPARATOR == '\\') { $file = str_replace('\\',/, $file); } @@ -52,7 +52,7 @@ var_dump($reader-getAttribute('baz')); $reader-close(); $reader = new XMLReader(); -$reader-open(dirname(__FILE__) . '/_012.xml'); +$reader-open(dirname(__FILE__) . '/012.xml'); $reader-setParserProperty(XMLReader::DEFAULTATTRS, true); while($reader-read() $reader-nodeType != XMLReader::ELEMENT); var_dump($reader-getAttribute('bar')); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Update NEWS: NEWS
Commit:e3e4ec3f5569bcca5ed6ee784889e6b908c77374 Author:Xinchen Hui larue...@php.net Sun, 16 Jun 2013 22:56:47 +0800 Parents: 6cd6349ff8842a9356723b7b192eb3c93fb64c7e Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e3e4ec3f5569bcca5ed6ee784889e6b908c77374 Log: Update NEWS Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index 757e918..b3117ad 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,10 @@ PHP NEWS . Fixed bug #64966 (segfault in zend_do_fcall_common_helper_SPEC). (Laruence) . Fixed bug #64934 (Apache2 TS crash with get_browser()). (Anatol) +- PDO: + . Fixed bug #63176 (Segmentation fault when instantiate 2 persistent PDO to +the same db server). (Laruence) + - SPL: . Fixed bug #64997 (Segfault while using RecursiveIteratorIterator on 64-bits systems). (Laruence) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #63176 (Segmentation fault when instantiate 2 persistent PDO to the same db server): NEWS ext/pdo/pdo_dbh.c ext/pdo_mysql/tests/bug63176.phpt
Commit:49e57a31659a82443b9413127f8d58a72f09ed5b Author:Xinchen Hui larue...@php.net Sun, 16 Jun 2013 22:55:59 +0800 Parents: 7457867ba8c46e276d2bcb6e47766a9f5abb0c79 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=49e57a31659a82443b9413127f8d58a72f09ed5b Log: Fixed bug #63176 (Segmentation fault when instantiate 2 persistent PDO to the same db server) Bugs: https://bugs.php.net/63176 Changed paths: M NEWS M ext/pdo/pdo_dbh.c A ext/pdo_mysql/tests/bug63176.phpt Diff: diff --git a/NEWS b/NEWS index d9634ff..f8d3d78 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,10 @@ PHP NEWS - FPM: . Fixed Bug #64915 (error_log ignored when daemonize=0). (Remi) +- PDO: + . Fixed bug #63176 (Segmentation fault when instantiate 2 persistent PDO to +the same db server). (Laruence) + - PDO_DBlib: . Fixed bug #63638 (Cannot connect to SQL Server 2008 with PDO dblib). (Stanley Sufficool) diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index e6265f5..25db684 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -338,6 +338,9 @@ static PHP_METHOD(PDO, dbh_constructor) if (pdbh-std.properties) { zend_hash_destroy(dbh-std.properties); efree(dbh-std.properties); + if (dbh-std.properties_table) { + efree(dbh-std.properties_table); + } } else { pdbh-std.ce = dbh-std.ce; pdbh-def_stmt_ce = dbh-def_stmt_ce; @@ -1575,6 +1578,7 @@ static void pdo_dbh_free_storage(pdo_dbh_t *dbh TSRMLS_DC) } zend_object_std_dtor(dbh-std TSRMLS_CC); dbh-std.properties = NULL; + dbh-std.properties_table = NULL; dbh_free(dbh TSRMLS_CC); } diff --git a/ext/pdo_mysql/tests/bug63176.phpt b/ext/pdo_mysql/tests/bug63176.phpt new file mode 100644 index 000..392a90b --- /dev/null +++ b/ext/pdo_mysql/tests/bug63176.phpt @@ -0,0 +1,54 @@ +--TEST-- +Bug #63176 (Segmentation fault when instantiate 2 persistent PDO to the same db server) +--SKIPIF-- +?php +require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc'); +require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::skip(); +? +--FILE-- +?php +require(dirname(__FILE__). DIRECTORY_SEPARATOR . 'config.inc'); +class PDO2 extends PDO { + protected $transLevel; +} + +class PDO3 extends PDO { + protected $tomato; +} + + +class ModelA { + public function __construct($h) { + var_dump($h); + if ($h) { + $this-db = new PDO2(PDO_MYSQL_TEST_DSN, PDO_MYSQL_TEST_USER, PDO_MYSQL_TEST_PASS, array(PDO::ATTR_PERSISTENT = true)); + } else { + $this-db = new PDO2(PDO_MYSQL_TEST_DSN, PDO_MYSQL_TEST_USER, PDO_MYSQL_TEST_PASS, array(PDO::ATTR_PERSISTENT = true)); + } + $this-db-query('SELECT 1')-fetchAll(); + } +} + +$a = new ModelA(true); +$b = new ModelA(false); + +var_dump($a); +var_dump($b); +--EXPECTF-- +bool(true) +bool(false) +object(ModelA)#%d (1) { + [db]= + object(PDO2)#%d (1) { +[transLevel:protected]= +NULL + } +} +object(ModelA)#%d (1) { + [db]= + object(PDO2)#%d (1) { +[transLevel:protected]= +NULL + } +} -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fix typo in test: ext/pdo_mysql/tests/bug63176.phpt
Commit:cfb1ffb4fa9d8a8561ffa509e187808b09608074 Author:Xinchen Hui larue...@php.net Mon, 17 Jun 2013 13:22:20 +0800 Parents: ebef8c417614e90ec1a07366ad540e06532a68ba Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cfb1ffb4fa9d8a8561ffa509e187808b09608074 Log: Fix typo in test Changed paths: M ext/pdo_mysql/tests/bug63176.phpt Diff: diff --git a/ext/pdo_mysql/tests/bug63176.phpt b/ext/pdo_mysql/tests/bug63176.phpt index 392a90b..ee928c0 100644 --- a/ext/pdo_mysql/tests/bug63176.phpt +++ b/ext/pdo_mysql/tests/bug63176.phpt @@ -24,7 +24,7 @@ class ModelA { if ($h) { $this-db = new PDO2(PDO_MYSQL_TEST_DSN, PDO_MYSQL_TEST_USER, PDO_MYSQL_TEST_PASS, array(PDO::ATTR_PERSISTENT = true)); } else { - $this-db = new PDO2(PDO_MYSQL_TEST_DSN, PDO_MYSQL_TEST_USER, PDO_MYSQL_TEST_PASS, array(PDO::ATTR_PERSISTENT = true)); + $this-db = new PDO3(PDO_MYSQL_TEST_DSN, PDO_MYSQL_TEST_USER, PDO_MYSQL_TEST_PASS, array(PDO::ATTR_PERSISTENT = true)); } $this-db-query('SELECT 1')-fetchAll(); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #64988 (Class loading order affects E_STRICT warning): NEWS Zend/tests/bug64988.phpt Zend/zend_compile.c
Commit:d8792d87cf978ef2a977362a7ef8f357820867c2 Author:Xinchen Hui larue...@php.net Mon, 10 Jun 2013 21:26:11 +0800 Parents: 53c39e2b4ed32b508763a4db18fd918ab0d036ca Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d8792d87cf978ef2a977362a7ef8f357820867c2 Log: Fixed bug #64988 (Class loading order affects E_STRICT warning) Bugs: https://bugs.php.net/64988 Changed paths: M NEWS A Zend/tests/bug64988.phpt M Zend/zend_compile.c Diff: diff --git a/NEWS b/NEWS index 60af878..567c81b 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ PHP NEWS ?? ??? 2013, PHP 5.4.17 - Core: + . Fixed bug #64988 (Class loading order affects E_STRICT warning). (Laruence) . Fixed bug #64966 (segfault in zend_do_fcall_common_helper_SPEC). (Laruence) . Fixed bug #64960 (Segfault in gc_zval_possible_root). (Laruence) . Fixed bug #64934 (Apache2 TS crash with get_browser()). (Anatol) diff --git a/Zend/tests/bug64988.phpt b/Zend/tests/bug64988.phpt new file mode 100644 index 000..34fd482 --- /dev/null +++ b/Zend/tests/bug64988.phpt @@ -0,0 +1,30 @@ +--TEST-- +Bug #64988 (Class loading order affects E_STRICT warning) +--FILE-- +?php +abstract class Base1 { + public function insert(array $data){ + return array_reverse($data); + } +} + +class Noisy1 extends Base1 { + public function insert(array $data, $option1 = Null) { + if (!empty($option1)) { + $data['option1'] = $option1; + } + return parent::insert($data); + } +} +class Smooth1 extends Noisy1 { + public function insert(array $data) { + return parent::insert($data, count($data)); + } +} + +$o = new Smooth1(); +echo okey; +? +--EXPECTF-- +Strict Standards: Declaration of Smooth1::insert() should be compatible with Noisy1::insert(array $data, $option1 = NULL) in %sbug64988.php on line 20 +okey diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 3959517..ab6020c 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -3267,11 +3267,11 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function * if (child-common.prototype (child-common.prototype-common.fn_flags ZEND_ACC_ABSTRACT)) { if (!zend_do_perform_implementation_check(child, child-common.prototype TSRMLS_CC)) { - zend_error(E_COMPILE_ERROR, Declaration of %s::%s() must be compatible with %s, ZEND_FN_SCOPE_NAME(child), child-common.function_name, zend_get_function_declaration(child-common.prototype? child-common.prototype : parent TSRMLS_CC)); + zend_error(E_COMPILE_ERROR, Declaration of %s::%s() must be compatible with %s, ZEND_FN_SCOPE_NAME(child), child-common.function_name, zend_get_function_declaration(child-common.prototype TSRMLS_CC)); } } else if (EG(error_reporting) E_STRICT || EG(user_error_handler)) { /* Check E_STRICT (or custom error handler) before the check so that we save some time */ if (!zend_do_perform_implementation_check(child, parent TSRMLS_CC)) { - char *method_prototype = zend_get_function_declaration(child-common.prototype? child-common.prototype : parent TSRMLS_CC); + char *method_prototype = zend_get_function_declaration(parent TSRMLS_CC); zend_error(E_STRICT, Declaration of %s::%s() should be compatible with %s, ZEND_FN_SCOPE_NAME(child), child-common.function_name, method_prototype); efree(method_prototype); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: NEWS Zend/zend_compile.c
Commit:a9d005c04e73621f81d441ef7afaae0dca18a58c Author:Xinchen Hui larue...@php.net Mon, 10 Jun 2013 21:31:25 +0800 Parents: 46d3738d0a0584e40a067bf88fe3b17df9e9e2b2 d8792d87cf978ef2a977362a7ef8f357820867c2 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a9d005c04e73621f81d441ef7afaae0dca18a58c Log: Merge branch 'PHP-5.4' into PHP-5.5 Conflicts: Zend/zend_compile.c Changed paths: MM NEWS MM Zend/zend_compile.c Diff: diff --cc NEWS index b2cb8c2,567c81b..757e918 --- a/NEWS +++ b/NEWS @@@ -1,22 -1,13 +1,23 @@@ PHP NEWS ||| -?? ??? 2013, PHP 5.4.17 +?? ??? 2013, PHP 5.5.0 Release Candidate 4 - Core: + . Fixed bug #64988 (Class loading order affects E_STRICT warning). (Laruence) . Fixed bug #64966 (segfault in zend_do_fcall_common_helper_SPEC). (Laruence) - . Fixed bug #64960 (Segfault in gc_zval_possible_root). (Laruence) . Fixed bug #64934 (Apache2 TS crash with get_browser()). (Anatol) +- SPL: + . Fixed bug #64997 (Segfault while using RecursiveIteratorIterator on +64-bits systems). (Laruence) + +06 Jun 2013, PHP 5.5.0 Release Candidate 3 + +- Core: + . Fixed bug #64960 (Segfault in gc_zval_possible_root). (Laruence) + . Fixed bug #64879 (Heap based buffer overflow in quoted_printable_encode, +CVE 2013-2110). (Stas) + - FPM: . Fixed Bug #64915 (error_log ignored when daemonize=0). (Remi) diff --cc Zend/zend_compile.c index 8674f92,ab6020c..a2aa909 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@@ -3464,12 -3267,12 +3464,12 @@@ static void do_inheritance_check_on_met if (child-common.prototype (child-common.prototype-common.fn_flags ZEND_ACC_ABSTRACT)) { if (!zend_do_perform_implementation_check(child, child-common.prototype TSRMLS_CC)) { - zend_error(E_COMPILE_ERROR, Declaration of %s::%s() must be compatible with %s, ZEND_FN_SCOPE_NAME(child), child-common.function_name, zend_get_function_declaration(child-common.prototype? child-common.prototype : parent TSRMLS_CC)); - zend_error(E_COMPILE_ERROR, Declaration of %s::%s() must be compatible with %s, ZEND_FN_SCOPE_NAME(child), child-common.function_name, zend_get_function_declaration(child-common.prototype TSRMLS_CC)); ++ zend_error(E_COMPILE_ERROR, Declaration of %s::%s() must be compatible with %s, ZEND_FN_SCOPE_NAME(child), child-common.function_name, zend_get_function_declaration(child-common.prototype TSRMLS_CC)); } } else if (EG(error_reporting) E_STRICT || EG(user_error_handler)) { /* Check E_STRICT (or custom error handler) before the check so that we save some time */ if (!zend_do_perform_implementation_check(child, parent TSRMLS_CC)) { - char *method_prototype = zend_get_function_declaration(child-common.prototype? child-common.prototype : parent TSRMLS_CC); + char *method_prototype = zend_get_function_declaration(parent TSRMLS_CC); - zend_error(E_STRICT, Declaration of %s::%s() should be compatible with %s, ZEND_FN_SCOPE_NAME(child), child-common.function_name, method_prototype); + zend_error(E_STRICT, Declaration of %s::%s() should be compatible with %s, ZEND_FN_SCOPE_NAME(child), child-common.function_name, method_prototype); efree(method_prototype); } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed merge wrongly: Zend/zend_vm_def.h Zend/zend_vm_execute.h
Commit:e14800dd46ce9adbaa696fec6b2f1741bbc3abba Author:Xinchen Hui larue...@php.net Sun, 9 Jun 2013 14:24:05 +0800 Parents: 3cc891bf3a27eb13a101da3391b75cfa77a117ae Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e14800dd46ce9adbaa696fec6b2f1741bbc3abba Log: Fixed merge wrongly Changed paths: M Zend/zend_vm_def.h M Zend/zend_vm_execute.h Diff: diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 40e2e42..15cef71 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -2685,7 +2685,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY) zval_ptr_dtor(ret-var.ptr); } } else if (RETURN_VALUE_USED(opline)) { - EX_T(opline-result.u.var).var.ptr = NULL; + EX_T(opline-result.var).var.ptr = NULL; } } else if (fbc-type == ZEND_USER_FUNCTION) { EX(original_return_value) = EG(return_value_ptr_ptr); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index ad6d708..4982cc2 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -649,7 +649,7 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR zval_ptr_dtor(ret-var.ptr); } } else if (RETURN_VALUE_USED(opline)) { - EX_T(opline-result.u.var).var.ptr = NULL; + EX_T(opline-result.var).var.ptr = NULL; } } else if (fbc-type == ZEND_USER_FUNCTION) { EX(original_return_value) = EG(return_value_ptr_ptr); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: ext/spl/spl_iterators.c
Commit:f338510c94f71fdf5f0ea9990dfb36e9b4215028 Author:Xinchen Hui larue...@php.net Sun, 9 Jun 2013 22:25:07 +0800 Parents: e14800dd46ce9adbaa696fec6b2f1741bbc3abba 75c57122e36897c81c33dae81c436f7bad65e35c Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f338510c94f71fdf5f0ea9990dfb36e9b4215028 Log: Merge branch 'PHP-5.3' into PHP-5.4 Changed paths: MM ext/spl/spl_iterators.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Update NEWS: NEWS
Commit:8ae43caeeeacf3338d6f1218455b5aa4b9ef09f7 Author:Xinchen Hui larue...@php.net Sun, 9 Jun 2013 22:26:07 +0800 Parents: 3f229f43644bcf450c43103364cc8a800961c45e Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8ae43caeeeacf3338d6f1218455b5aa4b9ef09f7 Log: Update NEWS Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index d4ad9cc..b2cb8c2 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,10 @@ PHP NEWS . Fixed bug #64966 (segfault in zend_do_fcall_common_helper_SPEC). (Laruence) . Fixed bug #64934 (Apache2 TS crash with get_browser()). (Anatol) +- SPL: + . Fixed bug #64997 (Segfault while using RecursiveIteratorIterator on +64-bits systems). (Laruence) + 06 Jun 2013, PHP 5.5.0 Release Candidate 3 - Core: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Update NEWs: NEWS
Commit:fdd73796866cd95ffc3af1864509c2af8d983949 Author:Xinchen Hui larue...@php.net Sun, 9 Jun 2013 22:25:28 +0800 Parents: f338510c94f71fdf5f0ea9990dfb36e9b4215028 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=fdd73796866cd95ffc3af1864509c2af8d983949 Log: Update NEWs Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index 78bcb00..60af878 100644 --- a/NEWS +++ b/NEWS @@ -21,6 +21,9 @@ PHP NEWS - PDO_pgsql: . Fixed Bug #64949 (Buffer overflow in _pdo_pgsql_error). (Remi) +- SPL: + . Fixed bug #64997 (Segfault while using RecursiveIteratorIterator on +64-bits systems). (Laruence) 06 Jun 2013, PHP 5.4.16 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #64997 (Segfault while using RecursiveIteratorIterator on 64-bits systems): NEWS ext/spl/spl_iterators.c
Commit:75c57122e36897c81c33dae81c436f7bad65e35c Author:Xinchen Hui larue...@php.net Sun, 9 Jun 2013 22:24:48 +0800 Parents: e8f004d54252e0130b88131bdc46a41ed365c51e Branches: PHP-5.3 PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=75c57122e36897c81c33dae81c436f7bad65e35c Log: Fixed bug #64997 (Segfault while using RecursiveIteratorIterator on 64-bits systems) Bugs: https://bugs.php.net/64997 Changed paths: M NEWS M ext/spl/spl_iterators.c Diff: diff --git a/NEWS b/NEWS index 7f54f39..d9861d0 100644 --- a/NEWS +++ b/NEWS @@ -17,7 +17,11 @@ PHP NEWS . Fixed bug #64949 (Buffer overflow in _pdo_pgsql_error). (Remi) - pgsql: - - Fixed bug #64609 (pg_convert enum type support). (Matteo) + . Fixed bug #64609 (pg_convert enum type support). (Matteo) + +- SPL: + . Fixed bug #64997 (Segfault while using RecursiveIteratorIterator on +64-bits systems). (Laruence) 06 Jun 2013, PHP 5.3.26 diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index 91f7c8e..cd0af8f 100644 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -1025,12 +1025,12 @@ static void spl_recursive_tree_iterator_get_entry(spl_recursive_it_object * obje zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, error_handling TSRMLS_CC); if (data *data) { RETVAL_ZVAL(*data, 1, 0); - } - if (Z_TYPE_P(return_value) == IS_ARRAY) { - zval_dtor(return_value); - ZVAL_STRINGL(return_value, Array, sizeof(Array)-1, 1); - } else { - convert_to_string(return_value); + if (Z_TYPE_P(return_value) == IS_ARRAY) { + zval_dtor(return_value); + ZVAL_STRINGL(return_value, Array, sizeof(Array)-1, 1); + } else { + convert_to_string(return_value); + } } zend_restore_error_handling(error_handling TSRMLS_CC); } @@ -1131,8 +1131,15 @@ SPL_METHOD(RecursiveTreeIterator, current) } } + INIT_ZVAL(prefix); + INIT_ZVAL(entry); spl_recursive_tree_iterator_get_prefix(object, prefix TSRMLS_CC); spl_recursive_tree_iterator_get_entry(object, entry TSRMLS_CC); + if (Z_TYPE(entry) != IS_STRING) { + zval_dtor(prefix); + zval_dtor(entry); + RETURN_NULL(); + } spl_recursive_tree_iterator_get_postfix(object, postfix TSRMLS_CC); str_len = Z_STRLEN(prefix) + Z_STRLEN(entry) + Z_STRLEN(postfix); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/spl/spl_iterators.c
Commit:3f229f43644bcf450c43103364cc8a800961c45e Author:Xinchen Hui larue...@php.net Sun, 9 Jun 2013 22:25:49 +0800 Parents: b839e6921da08adf1d8413cea5c2a21da069e23e fdd73796866cd95ffc3af1864509c2af8d983949 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3f229f43644bcf450c43103364cc8a800961c45e Log: Merge branch 'PHP-5.4' into PHP-5.5 Changed paths: MM ext/spl/spl_iterators.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #64966 (segfault in zend_do_fcall_common_helper_SPEC): NEWS Zend/tests/bug64966.phpt Zend/zend_vm_def.h Zend/zend_vm_execute.h
Commit:e8f004d54252e0130b88131bdc46a41ed365c51e Author:Xinchen Hui larue...@php.net Sun, 9 Jun 2013 13:20:40 +0800 Parents: 1aee7ad63672747bd941f169ef42bed5765137e0 Branches: PHP-5.3 PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e8f004d54252e0130b88131bdc46a41ed365c51e Log: Fixed bug #64966 (segfault in zend_do_fcall_common_helper_SPEC) Bugs: https://bugs.php.net/64966 Changed paths: M NEWS A Zend/tests/bug64966.phpt M Zend/zend_vm_def.h M Zend/zend_vm_execute.h Diff: diff --git a/NEWS b/NEWS index fc0842f..7f54f39 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,9 @@ PHPNEWS ||| ?? ??? 2013, PHP 5.3.27 + - Core: + . Fixed bug #64966 (segfault in zend_do_fcall_common_helper_SPEC). (Laruence) . Fixed bug #64960 (Segfault in gc_zval_possible_root). (Laruence) . Fixed bug #64934 (Apache2 TS crash with get_browser()). (Anatol) diff --git a/Zend/tests/bug64966.phpt b/Zend/tests/bug64966.phpt new file mode 100644 index 000..27fec3b --- /dev/null +++ b/Zend/tests/bug64966.phpt @@ -0,0 +1,30 @@ +--TEST-- +Bug #64966 (segfault in zend_do_fcall_common_helper_SPEC) +--FILE-- +?php +error_reporting(E_ALL); +set_error_handler(function($error) { throw new Exception(); }, E_RECOVERABLE_ERROR); + +function test($func) { + $a = $func(); + return true; +} +class A { + public function b() { + test(strlen); + test(iterator_apply); + } +} + +$a = new A(); +$a-b(); +? +--EXPECTF-- +Fatal error: Uncaught exception 'Exception' in %sbug64966.php:3 +Stack trace: +#0 [internal function]: {closure}(4096, 'Argument 1 pass...', '/home/huixinche...', 6, Array) +#1 %sbug64966.php(6): iterator_apply('') +#2 %sbug64966.php(12): test('iterator_apply') +#3 %sbug64966.php(17): A-b() +#4 {main} + thrown in %sbug64966.php on line 3 diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 02566f3..d471f39 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -2327,6 +2327,8 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY) if (!RETURN_VALUE_USED(opline)) { zval_ptr_dtor(EX_T(opline-result.u.var).var.ptr); } + } else if (RETURN_VALUE_USED(opline)) { + EX_T(opline-result.u.var).var.ptr = NULL; } } else if (EX(function_state).function-type == ZEND_USER_FUNCTION) { EX(original_return_value) = EG(return_value_ptr_ptr); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index f6220b0..993b822 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -327,6 +327,8 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR if (!RETURN_VALUE_USED(opline)) { zval_ptr_dtor(EX_T(opline-result.u.var).var.ptr); } + } else if (RETURN_VALUE_USED(opline)) { + EX_T(opline-result.u.var).var.ptr = NULL; } } else if (EX(function_state).function-type == ZEND_USER_FUNCTION) { EX(original_return_value) = EG(return_value_ptr_ptr); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Update NEWS: NEWS
Commit:6139358804ce41df3bbe54a7e8df6c6eb303c8b6 Author:Xinchen Hui larue...@php.net Sun, 9 Jun 2013 13:49:43 +0800 Parents: f372e00332c06f0e659dd755ecf7ca8e920dee42 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6139358804ce41df3bbe54a7e8df6c6eb303c8b6 Log: Update NEWS Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index de1f6d0..d4ad9cc 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,9 @@ PHPNEWS ||| ?? ??? 2013, PHP 5.5.0 Release Candidate 4 + - Core: + . Fixed bug #64966 (segfault in zend_do_fcall_common_helper_SPEC). (Laruence) . Fixed bug #64934 (Apache2 TS crash with get_browser()). (Anatol) 06 Jun 2013, PHP 5.5.0 Release Candidate 3 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Update NEWS: NEWS
Commit:3cc891bf3a27eb13a101da3391b75cfa77a117ae Author:Xinchen Hui larue...@php.net Sun, 9 Jun 2013 13:39:40 +0800 Parents: ab22fda7e52f097297f1dcdf06f474cea858adc0 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3cc891bf3a27eb13a101da3391b75cfa77a117ae Log: Update NEWS Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index e1aa27a..78bcb00 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ PHP NEWS ?? ??? 2013, PHP 5.4.17 - Core: + . Fixed bug #64966 (segfault in zend_do_fcall_common_helper_SPEC). (Laruence) . Fixed bug #64960 (Segfault in gc_zval_possible_root). (Laruence) . Fixed bug #64934 (Apache2 TS crash with get_browser()). (Anatol) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: Zend/zend_vm_def.h Zend/zend_vm_execute.h
Commit:ab22fda7e52f097297f1dcdf06f474cea858adc0 Author:Xinchen Hui larue...@php.net Sun, 9 Jun 2013 13:35:45 +0800 Parents: a7e25bdd486c28958c2db2f28c9fda63bb938405 e8f004d54252e0130b88131bdc46a41ed365c51e Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ab22fda7e52f097297f1dcdf06f474cea858adc0 Log: Merge branch 'PHP-5.3' into PHP-5.4 Changed paths: MM Zend/zend_vm_def.h MM Zend/zend_vm_execute.h Diff: diff --cc Zend/zend_vm_def.h index eed65e3,d471f39..40e2e42 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@@ -2682,27 -2325,26 +2682,29 @@@ ZEND_VM_HELPER(zend_do_fcall_common_hel } if (!RETURN_VALUE_USED(opline)) { - zval_ptr_dtor(EX_T(opline-result.u.var).var.ptr); + zval_ptr_dtor(ret-var.ptr); } + } else if (RETURN_VALUE_USED(opline)) { + EX_T(opline-result.u.var).var.ptr = NULL; } - } else if (EX(function_state).function-type == ZEND_USER_FUNCTION) { + } else if (fbc-type == ZEND_USER_FUNCTION) { EX(original_return_value) = EG(return_value_ptr_ptr); EG(active_symbol_table) = NULL; - EG(active_op_array) = EX(function_state).function-op_array; + EG(active_op_array) = fbc-op_array; EG(return_value_ptr_ptr) = NULL; - if (RETURN_VALUE_USED(opline)) { - EG(return_value_ptr_ptr) = EX_T(opline-result.u.var).var.ptr; - EX_T(opline-result.u.var).var.ptr = NULL; - EX_T(opline-result.u.var).var.ptr_ptr = EX_T(opline-result.u.var).var.ptr; - EX_T(opline-result.u.var).var.fcall_returned_reference = EX(function_state).function-common.return_reference; + if (RETURN_VALUE_USED(opline)) { + temp_variable *ret = EX_T(opline-result.var); + + ret-var.ptr = NULL; + EG(return_value_ptr_ptr) = ret-var.ptr; + ret-var.ptr_ptr = ret-var.ptr; + ret-var.fcall_returned_reference = (fbc-common.fn_flags ZEND_ACC_RETURN_REFERENCE) != 0; } - if (zend_execute == execute !EG(exception)) { - EX(call_opline) = opline; - ZEND_VM_ENTER(); + if (EXPECTED(zend_execute == execute)) { + if (EXPECTED(EG(exception) == NULL)) { + ZEND_VM_ENTER(); + } } else { zend_execute(EG(active_op_array) TSRMLS_CC); } diff --cc Zend/zend_vm_execute.h index 18b3f47,993b822..ad6d708 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@@ -646,27 -325,26 +646,29 @@@ static int ZEND_FASTCALL zend_do_fcall_ } if (!RETURN_VALUE_USED(opline)) { - zval_ptr_dtor(EX_T(opline-result.u.var).var.ptr); + zval_ptr_dtor(ret-var.ptr); } + } else if (RETURN_VALUE_USED(opline)) { + EX_T(opline-result.u.var).var.ptr = NULL; } - } else if (EX(function_state).function-type == ZEND_USER_FUNCTION) { + } else if (fbc-type == ZEND_USER_FUNCTION) { EX(original_return_value) = EG(return_value_ptr_ptr); EG(active_symbol_table) = NULL; - EG(active_op_array) = EX(function_state).function-op_array; + EG(active_op_array) = fbc-op_array; EG(return_value_ptr_ptr) = NULL; if (RETURN_VALUE_USED(opline)) { - EG(return_value_ptr_ptr) = EX_T(opline-result.u.var).var.ptr; - EX_T(opline-result.u.var).var.ptr = NULL; - EX_T(opline-result.u.var).var.ptr_ptr = EX_T(opline-result.u.var).var.ptr; - EX_T(opline-result.u.var).var.fcall_returned_reference = EX(function_state).function-common.return_reference; + temp_variable *ret = EX_T(opline-result.var); + + ret-var.ptr = NULL; + EG(return_value_ptr_ptr) = ret-var.ptr; + ret-var.ptr_ptr = ret-var.ptr; + ret-var.fcall_returned_reference = (fbc-common.fn_flags ZEND_ACC_RETURN_REFERENCE) != 0; } - if (zend_execute == execute !EG(exception)) { - EX(call_opline) = opline; - ZEND_VM_ENTER(); + if (EXPECTED(zend_execute == execute)) { + if (EXPECTED(EG(exception) == NULL)) { + ZEND_VM_ENTER
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: Zend/zend_vm_def.h Zend/zend_vm_execute.h
Commit:f372e00332c06f0e659dd755ecf7ca8e920dee42 Author:Xinchen Hui larue...@php.net Sun, 9 Jun 2013 13:49:26 +0800 Parents: bccacb630858f28370acbf014c8514709e3d689a 3cc891bf3a27eb13a101da3391b75cfa77a117ae Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f372e00332c06f0e659dd755ecf7ca8e920dee42 Log: Merge branch 'PHP-5.4' into PHP-5.5 Conflicts: Zend/zend_vm_def.h Changed paths: MM Zend/zend_vm_def.h MM Zend/zend_vm_execute.h diff --cc Zend/zend_vm_def.h index 386641a,40e2e42..ca62dde --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@@ -1829,268 -1819,6 +1829,270 @@@ ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VA ZEND_VM_NEXT_OPCODE(); } +ZEND_VM_HELPER(zend_leave_helper, ANY, ANY) +{ + zend_bool nested = EX(nested); + zend_op_array *op_array = EX(op_array); + + EG(current_execute_data) = EX(prev_execute_data); + EG(opline_ptr) = NULL; + if (!EG(active_symbol_table)) { + i_free_compiled_variables(execute_data); + } + + zend_vm_stack_free((char*)execute_data - (ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * op_array-T) TSRMLS_CC); + + if ((op_array-fn_flags ZEND_ACC_CLOSURE) op_array-prototype) { + zval_ptr_dtor((zval**)op_array-prototype); + } + + if (nested) { + execute_data = EG(current_execute_data); + } + if (nested) { + USE_OPLINE + + LOAD_REGS(); + LOAD_OPLINE(); + if (UNEXPECTED(opline-opcode == ZEND_INCLUDE_OR_EVAL)) { + + EX(function_state).function = (zend_function *) EX(op_array); + EX(function_state).arguments = NULL; + + EG(opline_ptr) = EX(opline); + EG(active_op_array) = EX(op_array); + EG(return_value_ptr_ptr) = EX(original_return_value); + destroy_op_array(op_array TSRMLS_CC); + efree(op_array); + if (UNEXPECTED(EG(exception) != NULL)) { + zend_throw_exception_internal(NULL TSRMLS_CC); + HANDLE_EXCEPTION_LEAVE(); + } + + ZEND_VM_INC_OPCODE(); + ZEND_VM_LEAVE(); + } else { + EG(opline_ptr) = EX(opline); + EG(active_op_array) = EX(op_array); + EG(return_value_ptr_ptr) = EX(original_return_value); + if (EG(active_symbol_table)) { + zend_clean_and_cache_symbol_table(EG(active_symbol_table) TSRMLS_CC); + } + EG(active_symbol_table) = EX(symbol_table); + + EX(function_state).function = (zend_function *) EX(op_array); + EX(function_state).arguments = NULL; + + if (EG(This)) { + if (UNEXPECTED(EG(exception) != NULL) EX(call)-is_ctor_call) { + if (EX(call)-is_ctor_result_used) { + Z_DELREF_P(EG(This)); + } + if (Z_REFCOUNT_P(EG(This)) == 1) { + zend_object_store_ctor_failed(EG(This) TSRMLS_CC); + } + } + zval_ptr_dtor(EG(This)); + } + EG(This) = EX(current_this); + EG(scope) = EX(current_scope); + EG(called_scope) = EX(current_called_scope); + + EX(call)--; + + zend_vm_stack_clear_multiple(1 TSRMLS_CC); + + if (UNEXPECTED(EG(exception) != NULL)) { + zend_throw_exception_internal(NULL TSRMLS_CC); + if (RETURN_VALUE_USED(opline) EX_T(opline-result.var).var.ptr) { + zval_ptr_dtor(EX_T(opline-result.var).var.ptr); + } + HANDLE_EXCEPTION_LEAVE(); + } + + ZEND_VM_INC_OPCODE(); + ZEND_VM_LEAVE(); + } + } + ZEND_VM_RETURN(); +} + +ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY) +{ + USE_OPLINE + zend_bool should_change_scope = 0; + zend_function *fbc = EX(function_state).function; + + SAVE_OPLINE(); + EX(object) = EX(call)-object; + if (UNEXPECTED((fbc-common.fn_flags (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) != 0)) { + if (UNEXPECTED((fbc-common.fn_flags ZEND_ACC_ABSTRACT) != 0
[PHP-CVS] com php-src: Merge branch 'PHP-5.5': Zend/zend_vm_def.h Zend/zend_vm_execute.h
Commit:46005788304ea406dbc1f5f21cc76456fecc8594 Author:Xinchen Hui larue...@php.net Sun, 9 Jun 2013 13:50:06 +0800 Parents: 2c0f09540e18371387eb291906f19b8b94e1ca5a 6139358804ce41df3bbe54a7e8df6c6eb303c8b6 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=46005788304ea406dbc1f5f21cc76456fecc8594 Log: Merge branch 'PHP-5.5' Changed paths: MM Zend/zend_vm_def.h MM Zend/zend_vm_execute.h Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #64960 (Segfault in gc_zval_possible_root): NEWS Zend/tests/bug64960.phpt Zend/zend_execute_API.c
Commit:3c87945c95c9c31986e690bb046c70e58c8d8896 Author:Xinchen Hui larue...@php.net Wed, 5 Jun 2013 17:25:00 +0800 Parents: 93e0d78ec655f59ebfa82b2c6f8486c43651c1d0 Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3c87945c95c9c31986e690bb046c70e58c8d8896 Log: Fixed bug #64960 (Segfault in gc_zval_possible_root) Bugs: https://bugs.php.net/64960 Changed paths: M NEWS A Zend/tests/bug64960.phpt M Zend/zend_execute_API.c Diff: diff --git a/NEWS b/NEWS index 60a4035..fbb470b 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ PHPNEWS ||| ?? ??? 2013, PHP 5.3.27 +- Core: + . Fixed bug #64960 (Segfault in gc_zval_possible_root). (Laruence) - PDO_firebird: . Fixed bug #64037 (Firebird return wrong value for numeric field). diff --git a/Zend/tests/bug64960.phpt b/Zend/tests/bug64960.phpt new file mode 100644 index 000..b31cca3 --- /dev/null +++ b/Zend/tests/bug64960.phpt @@ -0,0 +1,40 @@ +--TEST-- +Bug #64960 (Segfault in gc_zval_possible_root) +--FILE-- +?php +// this makes ob_end_clean raise an error +ob_end_flush(); + +class ExceptionHandler { + public function __invoke (Exception $e) + { + // this triggers the custom error handler + ob_end_clean(); + } +} + +// this must be a class, closure does not trigger segfault +set_exception_handler(new ExceptionHandler()); + +// exception must be throwed from error handler. +set_error_handler(function() +{ + $e = new Exception; + $e-_trace = debug_backtrace(); + + throw $e; +}); + +// trigger error handler +$a['waa']; +? +--EXPECTF-- +Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush in %sbug64960.php on line 3 + +Fatal error: Uncaught exception 'Exception' in %sbug64960.php:19 +Stack trace: +#0 [internal function]: {closure}(8, 'ob_end_clean():...', '%s', 9, Array) +#1 %sbug64960.php(9): ob_end_clean() +#2 [internal function]: ExceptionHandler-__invoke(Object(Exception)) +#3 {main} + thrown in %sbug64960.php on line 19 diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 9781889..687520d 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -263,15 +263,13 @@ void shutdown_executor(TSRMLS_D) /* {{{ */ if (EG(user_error_handler)) { zeh = EG(user_error_handler); EG(user_error_handler) = NULL; - zval_dtor(zeh); - FREE_ZVAL(zeh); + zval_ptr_dtor(zeh); } if (EG(user_exception_handler)) { zeh = EG(user_exception_handler); EG(user_exception_handler) = NULL; - zval_dtor(zeh); - FREE_ZVAL(zeh); + zval_ptr_dtor(zeh); } zend_stack_destroy(EG(user_error_handlers_error_reporting)); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Update NEWS: NEWS
Commit:3c93402f86bc0a0a9cdf87b480d8bb856e360059 Author:Xinchen Hui larue...@php.net Wed, 5 Jun 2013 17:29:04 +0800 Parents: f597f5561e658643d2f7f6e35c12b283760e1ac3 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3c93402f86bc0a0a9cdf87b480d8bb856e360059 Log: Update NEWS Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index 371ec37..9fd0f3f 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,9 @@ PHP NEWS ||| ?? ??? 2013, PHP 5.4.17 +- Core: + . Fixed bug #64960 (Segfault in gc_zval_possible_root). (Laruence) + - FPM: . Fixed Bug #64915 (error_log ignored when daemonize=0). (Remi) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: Zend/zend_execute_API.c
Commit:f597f5561e658643d2f7f6e35c12b283760e1ac3 Author:Xinchen Hui larue...@php.net Wed, 5 Jun 2013 17:26:10 +0800 Parents: efdeec3c0eb8e1bd9d14af37be6979fb46eda5df 3c87945c95c9c31986e690bb046c70e58c8d8896 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f597f5561e658643d2f7f6e35c12b283760e1ac3 Log: Merge branch 'PHP-5.3' into PHP-5.4 Changed paths: MM Zend/zend_execute_API.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: Zend/zend_execute_API.c
Commit:e89537f2a349d5d1f401e010ec6f17cff4035719 Author:Xinchen Hui larue...@php.net Wed, 5 Jun 2013 17:30:09 +0800 Parents: 785f4c5fc68422ae23c1acc37b823f214c52ca5d 3c93402f86bc0a0a9cdf87b480d8bb856e360059 Branches: PHP-5.5 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e89537f2a349d5d1f401e010ec6f17cff4035719 Log: Merge branch 'PHP-5.4' into PHP-5.5 Changed paths: MM Zend/zend_execute_API.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Update NEWS: NEWS
Commit:7da648ff2f5c32d99e80fb3d712c2b95b19188c0 Author:Xinchen Hui larue...@php.net Wed, 5 Jun 2013 17:30:57 +0800 Parents: e89537f2a349d5d1f401e010ec6f17cff4035719 Branches: PHP-5.5 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7da648ff2f5c32d99e80fb3d712c2b95b19188c0 Log: Update NEWS Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index 1523cbc..7e6fcc3 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ PHP NEWS ?? ??? 2013, PHP 5.5.0 Release Candidate 3 - Core: + . Fixed bug #64960 (Segfault in gc_zval_possible_root). (Laruence) . Fixed bug #64879 (Heap based buffer overflow in quoted_printable_encode, CVE 2013-2110). (Stas) @@ -10,8 +11,8 @@ PHP NEWS . Fixed Bug #64915 (error_log ignored when daemonize=0). (Remi) - GD: - . Fixed Bug #64961 (segfault in imagesetinterpolation). (Remi) . Fixed Bug #64962 (imagerotate produces corrupted image). (Remi) + . Fixed Bug #64961 (segfault in imagesetinterpolation). (Remi) - Hash: . Fixed Bug #64745 (hash_pbkdf2() truncates data when using default length -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Missed SKIPIF: ext/filter/tests/bug49510.phpt ext/mbstring/tests/mb_str_functions_opt-parameter.phpt
Commit:699dc04c5597a6dbd5d4fac43096d01ea37e6069 Author:Xinchen Hui larue...@php.net Thu, 9 May 2013 15:57:25 +0800 Parents: 898ddcb9e12cbbf9c51fe5d203474caea5d65083 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=699dc04c5597a6dbd5d4fac43096d01ea37e6069 Log: Missed SKIPIF Changed paths: M ext/filter/tests/bug49510.phpt M ext/mbstring/tests/mb_str_functions_opt-parameter.phpt Diff: diff --git a/ext/filter/tests/bug49510.phpt b/ext/filter/tests/bug49510.phpt index 3f365cc..340c1cc 100644 --- a/ext/filter/tests/bug49510.phpt +++ b/ext/filter/tests/bug49510.phpt @@ -1,5 +1,7 @@ --TEST-- -#49510 boolean validation fails with FILTER_NULL_ON_FAILURE +Bug #49510 boolean validation fails with FILTER_NULL_ON_FAILURE +--SKIPIF-- +?php if (!extension_loaded(filter)) die(skip); ? --FILE-- ?php var_dump(filter_var(false, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)); diff --git a/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt b/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt index 5fb642f..6219e58 100644 --- a/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt +++ b/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt @@ -1,5 +1,7 @@ --TEST-- Optional long parameter might be null +--SKIPIF-- +?php extension_loaded('mbstring') or die('skip mbstring not available'); ? --FILE-- ?php echo mb_strpos('abb', 'b', null, 'UTF-8') . \n; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fix #64749 (warning: cast from pointer to integer of different size): Zend/zend_compile.c
Commit:9155d17fefec7c2a71e1c0b8d8324d5e1fa43433 Author:Xinchen Hui larue...@php.net Sat, 4 May 2013 20:42:50 +0800 Parents: b2ef8672c76159b20b50a78d1e7b30f8f4945958 Branches: PHP-5.5 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9155d17fefec7c2a71e1c0b8d8324d5e1fa43433 Log: Fix #64749 (warning: cast from pointer to integer of different size) Bugs: https://bugs.php.net/64749 Changed paths: M Zend/zend_compile.c Diff: diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 3c0d753..862f82d 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -288,7 +288,7 @@ ZEND_API zend_bool zend_is_compiling(TSRMLS_D) /* {{{ */ static zend_uint get_temporary_variable(zend_op_array *op_array) /* {{{ */ { - return (zend_uint)EX_TMP_VAR_NUM(0, (op_array-T)++); + return (zend_uint)(zend_uintptr_t)EX_TMP_VAR_NUM(0, (op_array-T)++); } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: ext/mysqlnd/mysqlnd_result.c
Commit:d54432ed98e1ba563677d40f32f5bb10124478af Author:Xinchen Hui larue...@php.net Sat, 27 Apr 2013 23:38:10 +0800 Parents: e9b03c412ba44826de2c8150c7a930fe9aa17074 c7b8368ed579ddd539af95427902215f0530b4ea Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d54432ed98e1ba563677d40f32f5bb10124478af Log: Merge branch 'PHP-5.3' into PHP-5.4 Changed paths: MM ext/mysqlnd/mysqlnd_result.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fix memory realted to #64726: ext/mysqli/tests/bug64726.phpt ext/mysqlnd/mysqlnd_result.c
Commit:c7b8368ed579ddd539af95427902215f0530b4ea Author:Xinchen Hui larue...@php.net Sat, 27 Apr 2013 23:36:56 +0800 Parents: bf5506f511e66a2b827988d611ccda4d75abc44e Branches: PHP-5.3 PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c7b8368ed579ddd539af95427902215f0530b4ea Log: Fix memory realted to #64726 Bugs: https://bugs.php.net/64726 Changed paths: A ext/mysqli/tests/bug64726.phpt M ext/mysqlnd/mysqlnd_result.c Diff: diff --git a/ext/mysqli/tests/bug64726.phpt b/ext/mysqli/tests/bug64726.phpt new file mode 100644 index 000..3e43916 --- /dev/null +++ b/ext/mysqli/tests/bug64726.phpt @@ -0,0 +1,23 @@ +--TEST-- +Bug #63398 (Memleak when calling fetch_object on a use_result and DB pointer has closed) +--SKIPIF-- +?php +require_once('skipif.inc'); +require_once(connect.inc); +if (!$IS_MYSQLND) { +die(skip mysqlnd only test); +} +require_once('skipifconnectfailure.inc'); +? +--FILE-- +?php +require 'connect.inc'; +$db = new my_mysqli($host, $user, $passwd, $db, $port, $socket); + +$result = $db-query('SELECT 1', MYSQLI_USE_RESULT); +$db-close(); +var_dump($result-fetch_array()); +? +--EXPECTF-- +Warning: mysqli_result::fetch_array(): Error while reading a row in %sbug64726.php on line %d +bool(false) diff --git a/ext/mysqlnd/mysqlnd_result.c b/ext/mysqlnd/mysqlnd_result.c index 884de8b..a5ea3c4 100644 --- a/ext/mysqlnd/mysqlnd_result.c +++ b/ext/mysqlnd/mysqlnd_result.c @@ -1547,6 +1547,7 @@ MYSQLND_METHOD(mysqlnd_res, fetch_into)(MYSQLND_RES * result, unsigned int flags mysqlnd_array_init(return_value, mysqlnd_num_fields(result) * 2); if (FAIL == result-m.fetch_row(result, (void *)return_value, flags, fetched_anything TSRMLS_CC)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Error while reading a row); + zval_dtor(return_value); RETVAL_FALSE; } else if (fetched_anything == FALSE) { zval_dtor(return_value); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #64726 (Segfault when calling fetch_object on a use_result and DB pointer has closed): NEWS ext/mysqli/mysqli.c ext/mysqli/tests/bug64726.phpt
Commit:8f5a534b215905790a4dd5465804c1fbc21468c4 Author:Xinchen Hui larue...@php.net Sat, 27 Apr 2013 23:41:31 +0800 Parents: d54432ed98e1ba563677d40f32f5bb10124478af Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8f5a534b215905790a4dd5465804c1fbc21468c4 Log: Fixed bug #64726 (Segfault when calling fetch_object on a use_result and DB pointer has closed) Bugs: https://bugs.php.net/64726 Changed paths: M NEWS M ext/mysqli/mysqli.c M ext/mysqli/tests/bug64726.phpt Diff: diff --git a/NEWS b/NEWS index 5987131..3d37baf 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,10 @@ PHP NEWS - Fileinfo: . Upgraded libmagic to 5.14. (Anatol) +- MySQLi: + . Fixed bug #64726 (Segfault when calling fetch_object on a use_result and DB +pointer has closed). (Laruence) + - Zip: . Fixed bug #64342 (ZipArchive::addFile() has to check for file existence). (Anatol) diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index a4c1b87..45e39d0 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -1257,7 +1257,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags php_mysqli_fetch_into_hash_aux(return_value, result, fetchtype TSRMLS_CC); - if (into_object Z_TYPE_P(return_value) != IS_NULL) { + if (into_object Z_TYPE_P(return_value) == IS_ARRAY) { zval dataset = *return_value; zend_fcall_info fci; zend_fcall_info_cache fcc; diff --git a/ext/mysqli/tests/bug64726.phpt b/ext/mysqli/tests/bug64726.phpt index 3e43916..1f9bbaa 100644 --- a/ext/mysqli/tests/bug64726.phpt +++ b/ext/mysqli/tests/bug64726.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #63398 (Memleak when calling fetch_object on a use_result and DB pointer has closed) +Bug #63398 (Segfault when calling fetch_object on a use_result and DB pointer has closed) --SKIPIF-- ?php require_once('skipif.inc'); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Update NEWS: NEWS
Commit:a56a95e58d14daac83c65bb121352475e7b4eb42 Author:Xinchen Hui larue...@php.net Sat, 27 Apr 2013 23:42:18 +0800 Parents: 1c07590ed7bf8b5fca9f232eae321e26f05acbd9 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a56a95e58d14daac83c65bb121352475e7b4eb42 Log: Update NEWS Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index ddac905..135ca48 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,10 @@ PHP NEWS - CURL: . Remove curl stream wrappers. (Pierrick) +- MySQLi: + . Fixed bug #64726 (Segfault when calling fetch_object on a use_result and DB +pointer has closed). (Laruence) + - Zip: . Fixed bug #64342 (ZipArchive::addFile() has to check for file existence). (Anatol) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/mysqli/mysqli.c ext/mysqlnd/mysqlnd_result.c
Commit:1c07590ed7bf8b5fca9f232eae321e26f05acbd9 Author:Xinchen Hui larue...@php.net Sat, 27 Apr 2013 23:41:51 +0800 Parents: ca148c030fd71203ea026263ce99be3ec49f0865 8f5a534b215905790a4dd5465804c1fbc21468c4 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1c07590ed7bf8b5fca9f232eae321e26f05acbd9 Log: Merge branch 'PHP-5.4' into PHP-5.5 Changed paths: MM ext/mysqli/mysqli.c MM ext/mysqlnd/mysqlnd_result.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: ext/mysqli/tests/bug64726.phpt
Commit:7b9eabaf51d6b91d250b19d78d400993231e2a64 Author:Xinchen Hui larue...@php.net Sat, 27 Apr 2013 23:50:02 +0800 Parents: 8f5a534b215905790a4dd5465804c1fbc21468c4 15b554cd9ba6b8553f45ea8408b3f0386965bef6 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7b9eabaf51d6b91d250b19d78d400993231e2a64 Log: Merge branch 'PHP-5.3' into PHP-5.4 Changed paths: MM ext/mysqli/tests/bug64726.phpt Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Also fixed bug #64726 in 5.3: NEWS ext/mysqli/mysqli.c ext/mysqli/tests/bug64726.phpt
Commit:15b554cd9ba6b8553f45ea8408b3f0386965bef6 Author:Xinchen Hui larue...@php.net Sat, 27 Apr 2013 23:49:43 +0800 Parents: c7b8368ed579ddd539af95427902215f0530b4ea Branches: PHP-5.3 PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=15b554cd9ba6b8553f45ea8408b3f0386965bef6 Log: Also fixed bug #64726 in 5.3 Bugs: https://bugs.php.net/64726 Changed paths: M NEWS M ext/mysqli/mysqli.c M ext/mysqli/tests/bug64726.phpt Diff: diff --git a/NEWS b/NEWS index 5ea0f5a..284a31a 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ PHP NEWS ||| ?? ??? 2013, PHP 5.3.26 +- MySQLi: + . Fixed bug #64726 (Segfault when calling fetch_object on a use_result and DB +pointer has closed). (Laruence) + ?? ??? 2013, PHP 5.3.25 ### ADD ENTRIES ABOVE FOR 5.3.26. 5.3.25 NEWS WILL BE UPDATED BY RM ON MERGE ### diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index 86f6070..2941b4a 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -1259,7 +1259,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags #endif - if (into_object Z_TYPE_P(return_value) != IS_NULL) { + if (into_object Z_TYPE_P(return_value) == IS_ARRAY) { zval dataset = *return_value; zend_fcall_info fci; zend_fcall_info_cache fcc; diff --git a/ext/mysqli/tests/bug64726.phpt b/ext/mysqli/tests/bug64726.phpt index 3e43916..83c4e3c 100644 --- a/ext/mysqli/tests/bug64726.phpt +++ b/ext/mysqli/tests/bug64726.phpt @@ -16,8 +16,8 @@ $db = new my_mysqli($host, $user, $passwd, $db, $port, $socket); $result = $db-query('SELECT 1', MYSQLI_USE_RESULT); $db-close(); -var_dump($result-fetch_array()); +var_dump($result-fetch_object()); ? --EXPECTF-- -Warning: mysqli_result::fetch_array(): Error while reading a row in %sbug64726.php on line %d +Warning: mysqli_result::fetch_object(): Error while reading a row in %sbug64726.php on line %d bool(false) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #64677 (execution operator `` stealing surrounding arguments): NEWS Zend/tests/bug64677.phpt Zend/zend_compile.c
Commit:6ed16753c146ea2a06271ac537761430bad3059a Author:Xinchen Hui larue...@php.net Sat, 20 Apr 2013 15:23:49 +0800 Parents: 0704e4badb3abdfbdd5efc2b6d51c8abd6e5629a Branches: PHP-5.5 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6ed16753c146ea2a06271ac537761430bad3059a Log: Fixed bug #64677 (execution operator `` stealing surrounding arguments) Bugs: https://bugs.php.net/64677 Changed paths: M NEWS A Zend/tests/bug64677.phpt M Zend/zend_compile.c Diff: diff --git a/NEWS b/NEWS index 969780e..15aa0bc 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ PHP NEWS ||| ?? ??? 20??, PHP 5.5.0 Beta 4 +- Core: + . Fixed bug #64677 (execution operator `` stealing surrounding arguments). +(Laruence) + - Zip: . Fixed bug #64342 (ZipArchive::addFile() has to check for file existence). (Anatol) diff --git a/Zend/tests/bug64677.phpt b/Zend/tests/bug64677.phpt new file mode 100644 index 000..44a7c5f --- /dev/null +++ b/Zend/tests/bug64677.phpt @@ -0,0 +1,21 @@ +--TEST-- +Bug #64677 (execution operator `` stealing surrounding arguments) +--FILE-- +?PHP +class cat { + public function show_output($prepend, $output = '') { + } +} +$cat = new cat(); +$cat-show_output('Files: ', trim(`cd .`)); // this gives invalid args to shell_exec +$cat-show_output('Files: ', `cd .`); // this causes a segmentation fault +$cat-show_output(`cd .`); // this causes a segmentation fault + +function show_outputa($prepend, $output) { + echo Okey; +} +show_outputa('Files: ', `cd .`); // this works as expected + +? +--EXPECT-- +Okey diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 7680790..3c0d753 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -5702,6 +5702,7 @@ void zend_do_shell_exec(znode *result, const znode *cmd TSRMLS_DC) /* {{{ */ GET_CACHE_SLOT(opline-op1.constant); opline-extended_value = 1; SET_UNUSED(opline-op2); + opline-op2.num = CG(context).nested_calls; GET_NODE(result, opline-result); if (CG(context).nested_calls + 1 CG(active_op_array)-nested_calls) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Includes 5 new phpTests to check that the error message DOM_NOT_FOUND is properly raised by the method DOMNode::insertBefore(newNode, [refNode]).: ext/dom/tests/DOMDocument_vali
Commit:92bbe6be722209189e6f84b8ea2127949567d95e Author:Antonio Diaz Ruiz dejalat...@gmail.com Mon, 15 Apr 2013 23:30:58 +0200 Committer: Xinchen Hui larue...@php.net Sun, 21 Apr 2013 11:05:59 +0800 Parents: ba292b037f58c6cb0ef090936811cc658eadd26f Branches: PHP-5.4 PHP-5.5 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=92bbe6be722209189e6f84b8ea2127949567d95e Log: Includes 5 new phpTests to check that the error message DOM_NOT_FOUND is properly raised by the method DOMNode::insertBefore(newNode, [refNode]). Each file covers a different test case DOMNode_insertBefore_error2.phpt: refNode is a sibling of the node where newNode wanted to be inserted. DOMNode_insertBefore_error3.phpt: refNode is the parent of the node where newNode wanted to be inserted. DOMNode_insertBefore_error4.phpt: refNode is a brand new node. DOMNode_insertBefore_error5.phpt: refNode is a descendant (not child) of the node where newNode wanted to be inserted. DOMNode_insertBefore_error6.phpt: refNode is the node where newNode wanted to be inserted. Changed paths: M ext/dom/tests/DOMDocument_validate_on_parse_variation.phpt A ext/dom/tests/DOMNode_insertBefore_error2.phpt A ext/dom/tests/DOMNode_insertBefore_error3.phpt A ext/dom/tests/DOMNode_insertBefore_error4.phpt A ext/dom/tests/DOMNode_insertBefore_error5.phpt A ext/dom/tests/DOMNode_insertBefore_error6.phpt Diff: diff --git a/ext/dom/tests/DOMDocument_validate_on_parse_variation.phpt b/ext/dom/tests/DOMDocument_validate_on_parse_variation.phpt index d0cea29..4dfafa2 100644 --- a/ext/dom/tests/DOMDocument_validate_on_parse_variation.phpt +++ b/ext/dom/tests/DOMDocument_validate_on_parse_variation.phpt @@ -13,7 +13,7 @@ require_once('skipif.inc'); require_once('dom_test.inc'); chdir(__DIR__); -$XMLStringGood = file_get_contents('note.xml'); +$XMLStringGood = file_get_contents(dirname(__FILE__).'/note.xml'); $dom = new DOMDocument; $dom-resolveExternals = TRUE; diff --git a/ext/dom/tests/DOMNode_insertBefore_error2.phpt b/ext/dom/tests/DOMNode_insertBefore_error2.phpt new file mode 100644 index 000..5d389f5 --- /dev/null +++ b/ext/dom/tests/DOMNode_insertBefore_error2.phpt @@ -0,0 +1,38 @@ +--TEST-- +Test DOMNode::insertBefore() check the error code DOM_NOT_FOUND is raised +--DESCRIPTION-- +DOMNode::insertBefore(newNode, [refNode]) +DOM_NOT_FOUND is raised if refnode is not a child +This test checks the error message is raised when the refnode is a sibling +--CREDITS-- +Antonio Diaz Ruiz dejalat...@gmail.com +--INI-- +assert.bail=true +--SKIPIF-- +?php include('skipif.inc'); ? +--FILE-- +?php +$dom = new DOMDocument(); + +$doc = $dom-load(dirname(__FILE__) . /book.xml, LIBXML_NOBLANKS); +assert('$doc === true'); + +$parent_node = $dom-getElementsByTagName(book)-item(0); +assert('!is_null($parent_node)'); + +$new_node = $dom-createElement('newnode'); +assert('$new_node !== false'); + +// getting a sibling as reference node to insert + +$ref_node = $dom-getElementsByTagName(book)-item(1); + +try { +$parent_node-insertBefore($new_node, $ref_node); +} catch(DOMException $e) { + echo $e-getMessage(); +} + +? +--EXPECT-- +Not Found Error diff --git a/ext/dom/tests/DOMNode_insertBefore_error3.phpt b/ext/dom/tests/DOMNode_insertBefore_error3.phpt new file mode 100644 index 000..0d70a56 --- /dev/null +++ b/ext/dom/tests/DOMNode_insertBefore_error3.phpt @@ -0,0 +1,39 @@ +--TEST-- +Test DOMNode::insertBefore() check the error code DOM_NOT_FOUND is raised +--DESCRIPTION-- +DOMNode::insertBefore(newNode, [refNode]) +DOM_NOT_FOUND is raised if refnode is not a child +This test checks the error message is raised when refnode is the parent node +--CREDITS-- +Antonio Diaz Ruiz dejalat...@gmail.com +--INI-- +assert.bail=true +--SKIPIF-- +?php include('skipif.inc'); ? +--FILE-- +?php +$dom = new DOMDocument(); + +$doc = $dom-load(dirname(__FILE__) . /book.xml, LIBXML_NOBLANKS); +assert('$doc === true'); + +$parent_node = $dom-getElementsByTagName(book)-item(0); +assert('!is_null($parent_node)'); + +$new_node = $dom-createElement('newnode'); +assert('$new_node !== false'); + +// getting the parent node as reference node to insert + +$ref_node = $dom-getElementsByTagName(book)-item(0)-parentNode; +assert('!is_null($ref_node)'); + +try { +$parent_node-insertBefore($new_node, $ref_node); +} catch(DOMException $e) { + echo $e-getMessage(); +} + +? +--EXPECT-- +Not Found Error diff --git a/ext/dom/tests/DOMNode_insertBefore_error4.phpt b/ext/dom/tests/DOMNode_insertBefore_error4.phpt new file mode 100644 index 000..d063c54 --- /dev/null +++ b/ext/dom/tests/DOMNode_insertBefore_error4.phpt @@ -0,0 +1,38 @@ +--TEST-- +Test DOMNode::insertBefore() check the error code DOM_NOT_FOUND is raised +--DESCRIPTION-- +DOMNode::insertBefore(newNode, [refNode]) +DOM_NOT_FOUND is raised if refnode is not a child +This test checks the error message is raised when the refnode is a brand
[PHP-CVS] com php-src: Includes 5 new phpTests to check that the error message DOM_NOT_FOUND is properly raised by the method DOMNode::insertBefore(newNode, [refNode]).: ext/dom/tests/DOMDocument_vali
Commit:9bf80bc29419b265384188b4c90e528d7203b795 Author:Antonio Diaz Ruiz dejalat...@gmail.com Mon, 15 Apr 2013 23:30:58 +0200 Parents: 279285598d79384143ef350f76192c816061ca7c Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9bf80bc29419b265384188b4c90e528d7203b795 Log: Includes 5 new phpTests to check that the error message DOM_NOT_FOUND is properly raised by the method DOMNode::insertBefore(newNode, [refNode]). Each file covers a different test case DOMNode_insertBefore_error2.phpt: refNode is a sibling of the node where newNode wanted to be inserted. DOMNode_insertBefore_error3.phpt: refNode is the parent of the node where newNode wanted to be inserted. DOMNode_insertBefore_error4.phpt: refNode is a brand new node. DOMNode_insertBefore_error5.phpt: refNode is a descendant (not child) of the node where newNode wanted to be inserted. DOMNode_insertBefore_error6.phpt: refNode is the node where newNode wanted to be inserted. Changed paths: M ext/dom/tests/DOMDocument_validate_on_parse_variation.phpt A ext/dom/tests/DOMNode_insertBefore_error2.phpt A ext/dom/tests/DOMNode_insertBefore_error3.phpt A ext/dom/tests/DOMNode_insertBefore_error4.phpt A ext/dom/tests/DOMNode_insertBefore_error5.phpt A ext/dom/tests/DOMNode_insertBefore_error6.phpt Diff: diff --git a/ext/dom/tests/DOMDocument_validate_on_parse_variation.phpt b/ext/dom/tests/DOMDocument_validate_on_parse_variation.phpt index d0cea29..4dfafa2 100644 --- a/ext/dom/tests/DOMDocument_validate_on_parse_variation.phpt +++ b/ext/dom/tests/DOMDocument_validate_on_parse_variation.phpt @@ -13,7 +13,7 @@ require_once('skipif.inc'); require_once('dom_test.inc'); chdir(__DIR__); -$XMLStringGood = file_get_contents('note.xml'); +$XMLStringGood = file_get_contents(dirname(__FILE__).'/note.xml'); $dom = new DOMDocument; $dom-resolveExternals = TRUE; diff --git a/ext/dom/tests/DOMNode_insertBefore_error2.phpt b/ext/dom/tests/DOMNode_insertBefore_error2.phpt new file mode 100644 index 000..5d389f5 --- /dev/null +++ b/ext/dom/tests/DOMNode_insertBefore_error2.phpt @@ -0,0 +1,38 @@ +--TEST-- +Test DOMNode::insertBefore() check the error code DOM_NOT_FOUND is raised +--DESCRIPTION-- +DOMNode::insertBefore(newNode, [refNode]) +DOM_NOT_FOUND is raised if refnode is not a child +This test checks the error message is raised when the refnode is a sibling +--CREDITS-- +Antonio Diaz Ruiz dejalat...@gmail.com +--INI-- +assert.bail=true +--SKIPIF-- +?php include('skipif.inc'); ? +--FILE-- +?php +$dom = new DOMDocument(); + +$doc = $dom-load(dirname(__FILE__) . /book.xml, LIBXML_NOBLANKS); +assert('$doc === true'); + +$parent_node = $dom-getElementsByTagName(book)-item(0); +assert('!is_null($parent_node)'); + +$new_node = $dom-createElement('newnode'); +assert('$new_node !== false'); + +// getting a sibling as reference node to insert + +$ref_node = $dom-getElementsByTagName(book)-item(1); + +try { +$parent_node-insertBefore($new_node, $ref_node); +} catch(DOMException $e) { + echo $e-getMessage(); +} + +? +--EXPECT-- +Not Found Error diff --git a/ext/dom/tests/DOMNode_insertBefore_error3.phpt b/ext/dom/tests/DOMNode_insertBefore_error3.phpt new file mode 100644 index 000..0d70a56 --- /dev/null +++ b/ext/dom/tests/DOMNode_insertBefore_error3.phpt @@ -0,0 +1,39 @@ +--TEST-- +Test DOMNode::insertBefore() check the error code DOM_NOT_FOUND is raised +--DESCRIPTION-- +DOMNode::insertBefore(newNode, [refNode]) +DOM_NOT_FOUND is raised if refnode is not a child +This test checks the error message is raised when refnode is the parent node +--CREDITS-- +Antonio Diaz Ruiz dejalat...@gmail.com +--INI-- +assert.bail=true +--SKIPIF-- +?php include('skipif.inc'); ? +--FILE-- +?php +$dom = new DOMDocument(); + +$doc = $dom-load(dirname(__FILE__) . /book.xml, LIBXML_NOBLANKS); +assert('$doc === true'); + +$parent_node = $dom-getElementsByTagName(book)-item(0); +assert('!is_null($parent_node)'); + +$new_node = $dom-createElement('newnode'); +assert('$new_node !== false'); + +// getting the parent node as reference node to insert + +$ref_node = $dom-getElementsByTagName(book)-item(0)-parentNode; +assert('!is_null($ref_node)'); + +try { +$parent_node-insertBefore($new_node, $ref_node); +} catch(DOMException $e) { + echo $e-getMessage(); +} + +? +--EXPECT-- +Not Found Error diff --git a/ext/dom/tests/DOMNode_insertBefore_error4.phpt b/ext/dom/tests/DOMNode_insertBefore_error4.phpt new file mode 100644 index 000..d063c54 --- /dev/null +++ b/ext/dom/tests/DOMNode_insertBefore_error4.phpt @@ -0,0 +1,38 @@ +--TEST-- +Test DOMNode::insertBefore() check the error code DOM_NOT_FOUND is raised +--DESCRIPTION-- +DOMNode::insertBefore(newNode, [refNode]) +DOM_NOT_FOUND is raised if refnode is not a child +This test checks the error message is raised when the refnode is a brand new node +--CREDITS-- +Antonio Diaz Ruiz dejalat...@gmail.com +--INI--
[PHP-CVS] com php-src: Using absolute path to get the file note.xml: ext/dom/tests/DOMDocument_validate_on_parse_variation.phpt
Commit:8a019f3882ad593863ade742b13fc4e26ad80659 Author:Antonio Diaz Ruiz dejalat...@gmail.com Wed, 17 Apr 2013 22:30:04 +0200 Parents: b41145bc5c457d9713fe8d48befc6e6470903313 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8a019f3882ad593863ade742b13fc4e26ad80659 Log: Using absolute path to get the file note.xml Changed paths: M ext/dom/tests/DOMDocument_validate_on_parse_variation.phpt Diff: diff --git a/ext/dom/tests/DOMDocument_validate_on_parse_variation.phpt b/ext/dom/tests/DOMDocument_validate_on_parse_variation.phpt index d0cea29..4dfafa2 100644 --- a/ext/dom/tests/DOMDocument_validate_on_parse_variation.phpt +++ b/ext/dom/tests/DOMDocument_validate_on_parse_variation.phpt @@ -13,7 +13,7 @@ require_once('skipif.inc'); require_once('dom_test.inc'); chdir(__DIR__); -$XMLStringGood = file_get_contents('note.xml'); +$XMLStringGood = file_get_contents(dirname(__FILE__).'/note.xml'); $dom = new DOMDocument; $dom-resolveExternals = TRUE; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixs the name of the variable in the assertion: ext/dom/tests/DOMNode_insertBefore_error2.phpt ext/dom/tests/DOMNode_insertBefore_error3.phpt ext/dom/tests/DOMNode_insertBefore_
Commit:4ee47678a0a0c9e17c5afaa7852213644926609d Author:Antonio Diaz Ruiz dejalat...@gmail.com Wed, 17 Apr 2013 23:06:36 +0200 Parents: 8a019f3882ad593863ade742b13fc4e26ad80659 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4ee47678a0a0c9e17c5afaa7852213644926609d Log: Fixs the name of the variable in the assertion Changed paths: M ext/dom/tests/DOMNode_insertBefore_error2.phpt M ext/dom/tests/DOMNode_insertBefore_error3.phpt M ext/dom/tests/DOMNode_insertBefore_error4.phpt M ext/dom/tests/DOMNode_insertBefore_error5.phpt M ext/dom/tests/DOMNode_insertBefore_error6.phpt Diff: diff --git a/ext/dom/tests/DOMNode_insertBefore_error2.phpt b/ext/dom/tests/DOMNode_insertBefore_error2.phpt index 13dd3f3..5d389f5 100644 --- a/ext/dom/tests/DOMNode_insertBefore_error2.phpt +++ b/ext/dom/tests/DOMNode_insertBefore_error2.phpt @@ -21,7 +21,7 @@ $parent_node = $dom-getElementsByTagName(book)-item(0); assert('!is_null($parent_node)'); $new_node = $dom-createElement('newnode'); -assert('$doc !== false'); +assert('$new_node !== false'); // getting a sibling as reference node to insert diff --git a/ext/dom/tests/DOMNode_insertBefore_error3.phpt b/ext/dom/tests/DOMNode_insertBefore_error3.phpt index 3880d76..0d70a56 100644 --- a/ext/dom/tests/DOMNode_insertBefore_error3.phpt +++ b/ext/dom/tests/DOMNode_insertBefore_error3.phpt @@ -21,7 +21,7 @@ $parent_node = $dom-getElementsByTagName(book)-item(0); assert('!is_null($parent_node)'); $new_node = $dom-createElement('newnode'); -assert('$doc !== false'); +assert('$new_node !== false'); // getting the parent node as reference node to insert diff --git a/ext/dom/tests/DOMNode_insertBefore_error4.phpt b/ext/dom/tests/DOMNode_insertBefore_error4.phpt index eb84b46..d063c54 100644 --- a/ext/dom/tests/DOMNode_insertBefore_error4.phpt +++ b/ext/dom/tests/DOMNode_insertBefore_error4.phpt @@ -21,7 +21,7 @@ $parent_node = $dom-getElementsByTagName(book)-item(0); assert('!is_null($parent_node)'); $new_node = $dom-createElement('newnode'); -assert('$doc !== false'); +assert('$new_node !== false'); // could be a brand new node diff --git a/ext/dom/tests/DOMNode_insertBefore_error5.phpt b/ext/dom/tests/DOMNode_insertBefore_error5.phpt index ec985c3..36cc557 100644 --- a/ext/dom/tests/DOMNode_insertBefore_error5.phpt +++ b/ext/dom/tests/DOMNode_insertBefore_error5.phpt @@ -21,7 +21,7 @@ $parent_node = $dom-getElementsByTagName(book)-item(0); assert('!is_null($parent_node)'); $new_node = $dom-createElement('newnode'); -assert('$doc !== false'); +assert('$new_node !== false'); // creating a new node (descendant) and getting it as the refnode diff --git a/ext/dom/tests/DOMNode_insertBefore_error6.phpt b/ext/dom/tests/DOMNode_insertBefore_error6.phpt index 688c722..1fb3a96 100644 --- a/ext/dom/tests/DOMNode_insertBefore_error6.phpt +++ b/ext/dom/tests/DOMNode_insertBefore_error6.phpt @@ -22,7 +22,7 @@ assert('!is_null($parent_node)'); $ref_node = $parent_node; $new_node = $dom-createElement('newnode'); -assert('$doc !== false'); +assert('$new_node !== false'); try { $parent_node-insertBefore($new_node, $ref_node); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fix the path of the book.xml file: ext/dom/tests/DOMNode_insertBefore_error2.phpt ext/dom/tests/DOMNode_insertBefore_error3.phpt ext/dom/tests/DOMNode_insertBefore_error4.phpt e
Commit:b41145bc5c457d9713fe8d48befc6e6470903313 Author:Antonio Diaz Ruiz dejalat...@gmail.com Wed, 17 Apr 2013 22:09:05 +0200 Parents: a67ce3026218f8428d18b8e00fc8ba760ec8b096 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b41145bc5c457d9713fe8d48befc6e6470903313 Log: Fix the path of the book.xml file Changed paths: M ext/dom/tests/DOMNode_insertBefore_error2.phpt M ext/dom/tests/DOMNode_insertBefore_error3.phpt M ext/dom/tests/DOMNode_insertBefore_error4.phpt M ext/dom/tests/DOMNode_insertBefore_error5.phpt M ext/dom/tests/DOMNode_insertBefore_error6.phpt Diff: diff --git a/ext/dom/tests/DOMNode_insertBefore_error2.phpt b/ext/dom/tests/DOMNode_insertBefore_error2.phpt index eb0c691..13dd3f3 100644 --- a/ext/dom/tests/DOMNode_insertBefore_error2.phpt +++ b/ext/dom/tests/DOMNode_insertBefore_error2.phpt @@ -14,7 +14,7 @@ assert.bail=true ?php $dom = new DOMDocument(); -$doc = $dom-load(book.xml, LIBXML_NOBLANKS); +$doc = $dom-load(dirname(__FILE__) . /book.xml, LIBXML_NOBLANKS); assert('$doc === true'); $parent_node = $dom-getElementsByTagName(book)-item(0); diff --git a/ext/dom/tests/DOMNode_insertBefore_error3.phpt b/ext/dom/tests/DOMNode_insertBefore_error3.phpt index fcb7f8c..3880d76 100644 --- a/ext/dom/tests/DOMNode_insertBefore_error3.phpt +++ b/ext/dom/tests/DOMNode_insertBefore_error3.phpt @@ -14,7 +14,7 @@ assert.bail=true ?php $dom = new DOMDocument(); -$doc = $dom-load(book.xml, LIBXML_NOBLANKS); +$doc = $dom-load(dirname(__FILE__) . /book.xml, LIBXML_NOBLANKS); assert('$doc === true'); $parent_node = $dom-getElementsByTagName(book)-item(0); diff --git a/ext/dom/tests/DOMNode_insertBefore_error4.phpt b/ext/dom/tests/DOMNode_insertBefore_error4.phpt index 4a1ec96..eb84b46 100644 --- a/ext/dom/tests/DOMNode_insertBefore_error4.phpt +++ b/ext/dom/tests/DOMNode_insertBefore_error4.phpt @@ -14,7 +14,7 @@ assert.bail=true ?php $dom = new DOMDocument(); -$doc = $dom-load(book.xml, LIBXML_NOBLANKS); +$doc = $dom-load(dirname(__FILE__) . /book.xml, LIBXML_NOBLANKS); assert('$doc === true'); $parent_node = $dom-getElementsByTagName(book)-item(0); diff --git a/ext/dom/tests/DOMNode_insertBefore_error5.phpt b/ext/dom/tests/DOMNode_insertBefore_error5.phpt index 6474624..ec985c3 100644 --- a/ext/dom/tests/DOMNode_insertBefore_error5.phpt +++ b/ext/dom/tests/DOMNode_insertBefore_error5.phpt @@ -14,7 +14,7 @@ assert.bail=true ?php $dom = new DOMDocument(); -$doc = $dom-load(book.xml, LIBXML_NOBLANKS); +$doc = $dom-load(dirname(__FILE__) . /book.xml, LIBXML_NOBLANKS); assert('$doc === true'); $parent_node = $dom-getElementsByTagName(book)-item(0); diff --git a/ext/dom/tests/DOMNode_insertBefore_error6.phpt b/ext/dom/tests/DOMNode_insertBefore_error6.phpt index 77baffa..688c722 100644 --- a/ext/dom/tests/DOMNode_insertBefore_error6.phpt +++ b/ext/dom/tests/DOMNode_insertBefore_error6.phpt @@ -14,7 +14,7 @@ assert.bail=true ?php $dom = new DOMDocument(); -$doc = $dom-load(book.xml, LIBXML_NOBLANKS); +$doc = $dom-load(dirname(__FILE__) . /book.xml, LIBXML_NOBLANKS); assert('$doc === true'); $parent_node = $dom-getElementsByTagName(book)-item(0); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: PHP tests to check the DOM_NOT_FOUND error message is properly raised by the DOMNode::insertBefore method: ext/dom/tests/DOMNode_insertBefore_error2.phpt ext/dom/tests/DOMNode_i
Commit:a67ce3026218f8428d18b8e00fc8ba760ec8b096 Author:Antonio Diaz Ruiz dejalat...@gmail.com Mon, 15 Apr 2013 23:30:58 +0200 Parents: 279285598d79384143ef350f76192c816061ca7c Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a67ce3026218f8428d18b8e00fc8ba760ec8b096 Log: PHP tests to check the DOM_NOT_FOUND error message is properly raised by the DOMNode::insertBefore method Changed paths: A ext/dom/tests/DOMNode_insertBefore_error2.phpt A ext/dom/tests/DOMNode_insertBefore_error3.phpt A ext/dom/tests/DOMNode_insertBefore_error4.phpt A ext/dom/tests/DOMNode_insertBefore_error5.phpt A ext/dom/tests/DOMNode_insertBefore_error6.phpt Diff: diff --git a/ext/dom/tests/DOMNode_insertBefore_error2.phpt b/ext/dom/tests/DOMNode_insertBefore_error2.phpt new file mode 100644 index 000..eb0c691 --- /dev/null +++ b/ext/dom/tests/DOMNode_insertBefore_error2.phpt @@ -0,0 +1,38 @@ +--TEST-- +Test DOMNode::insertBefore() check the error code DOM_NOT_FOUND is raised +--DESCRIPTION-- +DOMNode::insertBefore(newNode, [refNode]) +DOM_NOT_FOUND is raised if refnode is not a child +This test checks the error message is raised when the refnode is a sibling +--CREDITS-- +Antonio Diaz Ruiz dejalat...@gmail.com +--INI-- +assert.bail=true +--SKIPIF-- +?php include('skipif.inc'); ? +--FILE-- +?php +$dom = new DOMDocument(); + +$doc = $dom-load(book.xml, LIBXML_NOBLANKS); +assert('$doc === true'); + +$parent_node = $dom-getElementsByTagName(book)-item(0); +assert('!is_null($parent_node)'); + +$new_node = $dom-createElement('newnode'); +assert('$doc !== false'); + +// getting a sibling as reference node to insert + +$ref_node = $dom-getElementsByTagName(book)-item(1); + +try { +$parent_node-insertBefore($new_node, $ref_node); +} catch(DOMException $e) { + echo $e-getMessage(); +} + +? +--EXPECT-- +Not Found Error diff --git a/ext/dom/tests/DOMNode_insertBefore_error3.phpt b/ext/dom/tests/DOMNode_insertBefore_error3.phpt new file mode 100644 index 000..fcb7f8c --- /dev/null +++ b/ext/dom/tests/DOMNode_insertBefore_error3.phpt @@ -0,0 +1,39 @@ +--TEST-- +Test DOMNode::insertBefore() check the error code DOM_NOT_FOUND is raised +--DESCRIPTION-- +DOMNode::insertBefore(newNode, [refNode]) +DOM_NOT_FOUND is raised if refnode is not a child +This test checks the error message is raised when refnode is the parent node +--CREDITS-- +Antonio Diaz Ruiz dejalat...@gmail.com +--INI-- +assert.bail=true +--SKIPIF-- +?php include('skipif.inc'); ? +--FILE-- +?php +$dom = new DOMDocument(); + +$doc = $dom-load(book.xml, LIBXML_NOBLANKS); +assert('$doc === true'); + +$parent_node = $dom-getElementsByTagName(book)-item(0); +assert('!is_null($parent_node)'); + +$new_node = $dom-createElement('newnode'); +assert('$doc !== false'); + +// getting the parent node as reference node to insert + +$ref_node = $dom-getElementsByTagName(book)-item(0)-parentNode; +assert('!is_null($ref_node)'); + +try { +$parent_node-insertBefore($new_node, $ref_node); +} catch(DOMException $e) { + echo $e-getMessage(); +} + +? +--EXPECT-- +Not Found Error diff --git a/ext/dom/tests/DOMNode_insertBefore_error4.phpt b/ext/dom/tests/DOMNode_insertBefore_error4.phpt new file mode 100644 index 000..4a1ec96 --- /dev/null +++ b/ext/dom/tests/DOMNode_insertBefore_error4.phpt @@ -0,0 +1,38 @@ +--TEST-- +Test DOMNode::insertBefore() check the error code DOM_NOT_FOUND is raised +--DESCRIPTION-- +DOMNode::insertBefore(newNode, [refNode]) +DOM_NOT_FOUND is raised if refnode is not a child +This test checks the error message is raised when the refnode is a brand new node +--CREDITS-- +Antonio Diaz Ruiz dejalat...@gmail.com +--INI-- +assert.bail=true +--SKIPIF-- +?php include('skipif.inc'); ? +--FILE-- +?php +$dom = new DOMDocument(); + +$doc = $dom-load(book.xml, LIBXML_NOBLANKS); +assert('$doc === true'); + +$parent_node = $dom-getElementsByTagName(book)-item(0); +assert('!is_null($parent_node)'); + +$new_node = $dom-createElement('newnode'); +assert('$doc !== false'); + +// could be a brand new node + +$ref_node = $dom-createElement('newnode2'); + +try { +$parent_node-insertBefore($new_node, $ref_node); +} catch(DOMException $e) { + echo $e-getMessage(); +} + +? +--EXPECT-- +Not Found Error diff --git a/ext/dom/tests/DOMNode_insertBefore_error5.phpt b/ext/dom/tests/DOMNode_insertBefore_error5.phpt new file mode 100644 index 000..6474624 --- /dev/null +++ b/ext/dom/tests/DOMNode_insertBefore_error5.phpt @@ -0,0 +1,40 @@ +--TEST-- +Test DOMNode::insertBefore() check the error code DOM_NOT_FOUND is raised +--DESCRIPTION-- +DOMNode::insertBefore(newNode, [refNode]) +DOM_NOT_FOUND is raised if refnode is not a child +This test checks the error message is raised when the refnode is a descendant but not a child +--CREDITS-- +Antonio Diaz Ruiz dejalat...@gmail.com +--INI-- +assert.bail=true +--SKIPIF-- +?php include('skipif.inc'); ? +--FILE-- +?php +$dom = new DOMDocument();
[PHP-CVS] com php-src: Fixed compiler warning cast from pointer to integer of different size: ext/opcache/shared_alloc_shm.c ext/opcache/zend_shared_alloc.c
Commit:0704e4badb3abdfbdd5efc2b6d51c8abd6e5629a Author:Xinchen Hui larue...@php.net Thu, 18 Apr 2013 17:32:46 +0800 Parents: 5a897009a83bba1a0f32982d7438d6967d1eddeb Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0704e4badb3abdfbdd5efc2b6d51c8abd6e5629a Log: Fixed compiler warning cast from pointer to integer of different size Changed paths: M ext/opcache/shared_alloc_shm.c M ext/opcache/zend_shared_alloc.c Diff: diff --git a/ext/opcache/shared_alloc_shm.c b/ext/opcache/shared_alloc_shm.c index d2b8423..d53236b 100644 --- a/ext/opcache/shared_alloc_shm.c +++ b/ext/opcache/shared_alloc_shm.c @@ -111,7 +111,7 @@ static int create_segments(size_t requested_size, zend_shared_segment_shm ***sha } shared_segments[i].common.p = shmat(shared_segments[i].shm_id, NULL, 0); - if (((int) shared_segments[i].common.p) == -1) { + if (shared_segments[i].common.p == (void *)-1) { *error_in = shmat; shmctl(shared_segments[i].shm_id, IPC_RMID, sds); return ALLOC_FAILURE; diff --git a/ext/opcache/zend_shared_alloc.c b/ext/opcache/zend_shared_alloc.c index ebfdea2..5405751 100644 --- a/ext/opcache/zend_shared_alloc.c +++ b/ext/opcache/zend_shared_alloc.c @@ -137,7 +137,7 @@ static int zend_shared_alloc_try(const zend_shared_memory_handler_entry *he, int int i; /* cleanup */ for (i = 0; i *shared_segments_count; i++) { - if ((*shared_segments_p)[i]-p (int)(*shared_segments_p)[i]-p != -1) { + if ((*shared_segments_p)[i]-p (*shared_segments_p)[i]-p != (void *)-1) { S_H(detach_segment)((*shared_segments_p)[i]); } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fix typo: ext/opcache/Optimizer/optimize_func_calls.c
Commit:580d6fe94d67f2d8780136a871e4d5290bb3dea8 Author:Xinchen Hui larue...@php.net Fri, 19 Apr 2013 10:55:11 +0800 Parents: 1192cfa58cb9b8f4c75b6d28072a4ad32fbcf5c3 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=580d6fe94d67f2d8780136a871e4d5290bb3dea8 Log: Fix typo Changed paths: M ext/opcache/Optimizer/optimize_func_calls.c Diff: diff --git a/ext/opcache/Optimizer/optimize_func_calls.c b/ext/opcache/Optimizer/optimize_func_calls.c index a597fd9..27f3ac5 100644 --- a/ext/opcache/Optimizer/optimize_func_calls.c +++ b/ext/opcache/Optimizer/optimize_func_calls.c @@ -62,7 +62,7 @@ static void optimize_func_calls(zend_op_array *op_array, zend_persistent_script MAKE_NOP(fcall); } else if (opline-extended_value == 0 call_stack[call].opline - call_stack[call].opline == ZEND_INIT_FCALL_BY_NAME + call_stack[call].opline-opcode == ZEND_INIT_FCALL_BY_NAME ZEND_OP2_TYPE(call_stack[call].opline) == IS_CONST) { zend_op *fcall = call_stack[call].opline; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php