com php-src: Fix handling of parse_str() with unpack in optimizer: Zend/tests/parse_str_with_unpack .phpt ext/opcache/Optimizer/zend_optimizer.c

From: Date: Sun, 05 Jun 2016 20:16:15 +0000
Subject: com php-src: Fix handling of parse_str() with unpack in optimizer: Zend/tests/parse_str_with_unpack .phpt ext/opcache/Optimizer/zend_optimizer.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-92312@lists.php.net to get a copy of this message
Commit: 3be92120ba676afdcbd40bafa9d474b7f10e286c Author: Nikita Popov <nikic@php.net> Sun, 5 Jun 2016 22:16:15 +0200 Parents: 70f05468855ec52cab4223d2e3cfd64e84b9abbd Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3be92120ba676afdcbd40bafa9d474b7f10e286c Log: Fix handling of parse_str() with unpack in optimizer Changed paths: A Zend/tests/parse_str_with_unpack.phpt M ext/opcache/Optimizer/zend_optimizer.c Diff: diff --git a/Zend/tests/parse_str_with_unpack.phpt b/Zend/tests/parse_str_with_unpack.phpt new file mode 100644 index 0000000..50b296d --- /dev/null +++ b/Zend/tests/parse_str_with_unpack.phpt @@ -0,0 +1,15 @@ +--TEST-- +Calling parse_str through argument unpacking +--FILE-- +<?php + +function test() { + $i = 0; + parse_str(...["i=41"]); + var_dump($i + 1); +} +test(); + +?> +--EXPECT-- +int(42) diff --git a/ext/opcache/Optimizer/zend_optimizer.c b/ext/opcache/Optimizer/zend_optimizer.c index ea0deb5..35dff98 100644 --- a/ext/opcache/Optimizer/zend_optimizer.c +++ b/ext/opcache/Optimizer/zend_optimizer.c @@ -596,9 +596,9 @@ uint32_t zend_optimizer_classify_function(zend_string *name, uint32_t num_args) return ZEND_FUNC_INDIRECT_VAR_ACCESS; } else if (zend_string_equals_literal(name, "compact")) { return ZEND_FUNC_INDIRECT_VAR_ACCESS; - } else if (zend_string_equals_literal(name, "parse_str") && num_args == 1) { + } else if (zend_string_equals_literal(name, "parse_str") && num_args <= 1) { return ZEND_FUNC_INDIRECT_VAR_ACCESS; - } else if (zend_string_equals_literal(name, "mb_parse_str") && num_args == 1) { + } else if (zend_string_equals_literal(name, "mb_parse_str") && num_args <= 1) { return ZEND_FUNC_INDIRECT_VAR_ACCESS; } else if (zend_string_equals_literal(name, "get_defined_vars")) { return ZEND_FUNC_INDIRECT_VAR_ACCESS;

« previous php.cvs (#92312) next »