From a717acd21a0cd9c4d41c6dfbb536399e9258824d Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sun, 26 Jul 2015 21:22:31 +0200 Subject: Fix RECV_VARIADIC literal compacting wrt cache slot --- Zend/tests/closure_with_variadic_typehint.phpt | 15 +++++++++++++++ ext/opcache/Optimizer/compact_literals.c | 1 + 2 files changed, 16 insertions(+) create mode 100644 Zend/tests/closure_with_variadic_typehint.phpt diff --git a/Zend/tests/closure_with_variadic_typehint.phpt b/Zend/tests/closure_with_variadic_typehint.phpt new file mode 100644 index 0000000000..3e91a6f176 --- /dev/null +++ b/Zend/tests/closure_with_variadic_typehint.phpt @@ -0,0 +1,15 @@ +--TEST-- +Closure with variadic type hint +--FILE-- + +--EXPECT-- +array(1) { + [0]=> + object(stdClass)#2 (0) { + } +} diff --git a/ext/opcache/Optimizer/compact_literals.c b/ext/opcache/Optimizer/compact_literals.c index 812f24fe8f..50caf4297b 100644 --- a/ext/opcache/Optimizer/compact_literals.c +++ b/ext/opcache/Optimizer/compact_literals.c @@ -295,6 +295,7 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx } break; case ZEND_RECV: + case ZEND_RECV_VARIADIC: case ZEND_VERIFY_RETURN_TYPE: if (opline->op2.num != -1) { opline->op2.num = cache_size; -- cgit v1.2.1