1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 17:38:14 +02:00

Merge branch 'PHP-7.0' into PHP-7.1

This commit is contained in:
Nikita Popov
2016-11-10 22:18:42 +01:00
2 changed files with 23 additions and 0 deletions
@@ -222,6 +222,14 @@ void zend_optimize_func_calls(zend_op_array *op_array, zend_optimizer_ctx *ctx)
opline->opcode = ZEND_FETCH_STATIC_PROP_W;
}
} else {
if (opline->opcode == ZEND_FETCH_DIM_FUNC_ARG
&& opline->op2_type == IS_UNUSED) {
/* FETCH_DIM_FUNC_ARG supports UNUSED op2, while FETCH_DIM_R does not.
* Performing the replacement would create an invalid opcode. */
call_stack[call - 1].try_inline = 0;
break;
}
opline->extended_value &= ZEND_FETCH_TYPE_MASK;
if (opline->opcode != ZEND_FETCH_STATIC_PROP_FUNC_ARG) {
opline->opcode -= 12;
@@ -0,0 +1,15 @@
--TEST--
Don't create FETCH_DIM_R with UNUSED op2
--FILE--
<?php
// Order matters
test($arr[]);
function test($arg) {}
?>
--EXPECTF--
Fatal error: Uncaught Error: Cannot use [] for reading in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d