com php-src: Fixed incorrect empty basic block removing: ext/opcache/Optimizer/dfa_pass.c ext/opcache/tests/jmp_ elim_002.phpt

From: Date: Tue, 12 Sep 2017 06:31:02 +0000
Subject: com php-src: Fixed incorrect empty basic block removing: ext/opcache/Optimizer/dfa_pass.c ext/opcache/tests/jmp_ elim_002.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-99371@lists.php.net to get a copy of this message
Commit: a7eda825632fc6ce6b9a4272495fbf194bb2aed3 Author: Dmitry Stogov <dmitry@zend.com> Tue, 12 Sep 2017 09:31:02 +0300 Parents: 6acfc7a23981276f5ac9dbcfa7c42242379222b1 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a7eda825632fc6ce6b9a4272495fbf194bb2aed3 Log: Fixed incorrect empty basic block removing Changed paths: M ext/opcache/Optimizer/dfa_pass.c A ext/opcache/tests/jmp_elim_002.phpt Diff: diff --git a/ext/opcache/Optimizer/dfa_pass.c b/ext/opcache/Optimizer/dfa_pass.c index d8db22c..ac40930 100644 --- a/ext/opcache/Optimizer/dfa_pass.c +++ b/ext/opcache/Optimizer/dfa_pass.c @@ -586,8 +586,8 @@ static void zend_ssa_unlink_block(zend_op_array *op_array, zend_ssa *ssa, zend_b for (i = 0; i < block->predecessors_count; i++) { zend_ssa_replace_control_link(op_array, ssa, predecessors[i], block_num, block->successors[0]); } + zend_ssa_remove_block(op_array, ssa, block_num); } - zend_ssa_remove_block(op_array, ssa, block_num); } static int zend_dfa_optimize_jmps(zend_op_array *op_array, zend_ssa *ssa) diff --git a/ext/opcache/tests/jmp_elim_002.phpt b/ext/opcache/tests/jmp_elim_002.phpt new file mode 100644 index 0000000..e396ca0 --- /dev/null +++ b/ext/opcache/tests/jmp_elim_002.phpt @@ -0,0 +1,38 @@ +--TEST-- +Incorrect empty basic block elimination +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php +function wp_get_archives( $args = '' ) { + $defaults = array( + 'type' => 'monthly', 'limit' => '', + 'format' => 'html', 'before' => '', + 'after' => '', 'show_post_count' => false, + 'echo' => 1, 'order' => 'DESC', + ); + + $r = wp_parse_args( $args, $defaults ); + + if ( ! empty( $r['limit'] ) ) { + $r['limit'] = absint( $r['limit'] ); + $r['limit'] = ' LIMIT ' . $r['limit']; + } + + $archive_date_format_over_ride = 0; + $archive_day_date_format = 'Y/m/d'; + + if (!$archive_date_format_over_ride ) { + $archive_day_date_format = get_option( 'date_format' ); + } + + if ( $r['echo'] ) { + echo $output; + } else { + return $output; + } +} +?> +OK +--EXPECT-- +OK

« previous php.cvs (#99371) next »