diff options
author | Joe Watkins <krakjoe@php.net> | 2017-01-02 09:44:02 +0000 |
---|---|---|
committer | Joe Watkins <krakjoe@php.net> | 2017-01-02 09:44:02 +0000 |
commit | 3e798c4a5f143ca46feab994d5f446c15aef8e98 (patch) | |
tree | e1196b654c889dc5de45fda5c99a2d1873a4008f | |
parent | e077735b03fd2339b2d663d29557cfb5ab2d5eff (diff) | |
parent | 935b5cb11ed672c42b2a77e10be752702e474e7f (diff) | |
download | php-git-3e798c4a5f143ca46feab994d5f446c15aef8e98.tar.gz |
Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:/php-src: (146 commits)
Flush stderr on win32 in cli_log_message
Fixed bug #73154
FIx bug #70213
Fix dom class can't be inherited by the internal class
Another try at making concat_003 more reliable
Fix flaky openssl_pkey_new test
Make Opcache tests using the cli server more reliable
Revert "Fix #73530: Unsetting result set may reset other result set"
define php_ap_map_http_request_error function for older httpd only
add old versions of httpd support
Disable AppVeyor fast_finish
Makes the sapi web server and curl tests more reliable
Fixes the curl tests to be more reliable in Travis CI
Interpretation of curl_setopt values for boolean parameters
Fixes #65689. PDO_Firebrid / exec() does not free allocated statement.
Fix alpn_ctx leaking in openssl
Fixed bug #73373 (deflate_add does not verify that output was not truncated)
Fix IS_UNDEF comparisons in opcache
Fixed bug #73704 (phpdbg shows the wrong line in files with shebang)
Increase timing quota for small string concat test
...
168 files changed, 6015 insertions, 4532 deletions
diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 0000000000..ba0d1c132d --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,46 @@ + +version: "{branch}.build.{build}" + +image: Visual Studio 2015 + +clone_depth: 64 + +cache: + - c:\build-cache + - c:\build-cache\sdk -> .appveyor.yml + +environment: + PHP_BUILD_CACHE_BASE_DIR: c:\build-cache + PHP_BUILD_OBJ_DIR: c:\obj + PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk + PHP_BUILD_SDK_BRANCH: php-sdk-2.0.0alpha6 + # ext and env setup for tests + #MYSQL_TEST_PASSWD: Password12! + #MYSQL_TEST_USER: root + #PDO_MYSQL_TEST_DSN: "pgsql:host=127.0.0.1 port=5432 dbname=test user=root password=Password12!" + #PDO_MYSQL_TEST_USER: root + #PDO_MYSQL_TEST_PASS: Password12! + #PGSQL_TEST_CONNSTR: "host=127.0.0.1 dbname=test port=5432 user=postgres password=Password12!" + #PDO_PGSQL_TEST_DSN: "pgsql:host=127.0.0.1 port=5432 dbname=test user=postgres password=Password12!" + #build permutations + matrix: + - THREAD_SAFE: 0 + OPCACHE: 0 + - THREAD_SAFE: 1 + OPCACHE: 1 + +services: + # the setup scripts have to be touched, once some other db version is used + - mysql + - postgresql95 + +platform: + - x64 + # - x86 + +build_script: + - appveyor\build.bat + +test_script: + - appveyor\test.bat + @@ -1,14 +1,68 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -?? ??? 2016 PHP 7.0.14 +?? ??? 2016 PHP 7.0.15 -- Calendar: - . Fix integer overflows (Joshua Rogers) +- Core: + . Fixed bug #73792 (invalid foreach loop hangs script). (Dmitry) + . Fixed bug #73663 ("Invalid opcode 65/16/8" occurs with a variable created + with list()). (Laruence) + . Fixed bug #73585 (Logging of "Internal Zend error - Missing class + information" missing class name). (Laruence) + . Fixed bug #73753 (unserialized array pointer not advancing). (David Walker) + +- COM: + . Fixed bug #73679 (DOTNET read access violation using invalid codepage). + (Anatol) + +- Mysqlnd: + . Fixed issue with decoding BIT columns when having more than one rows in the + result set. 7.0+ problem. (Andrey) + +- PCRE: + . Fixed bug #73612 (preg_*() may leak memory). (cmb) + +- PDO_Firebird: + . Fixed bug #72931 (PDO_FIREBIRD with Firebird 3.0 not work on returning + statement). (Dorin Marcoci) + +- Streams: + . Fixed bug #73586 (php_user_filter::$stream is not set to the stream the + filter is working on). (Dmitry) + +- Phpdbg: + . Fixed bug #73615 (phpdbg without option never load .phpdbginit at startup). + (Bob) + . Fixed issue getting executable lines from custom wrappers. (Bob) + . Fixed bug #73704 (phpdbg shows the wrong line in files with shebang). (Bob) + +- Reflection: + . Fixed bug #46103 (ReflectionObject memory leak). (Nikita) + +- SQLite3: + . Reverted fix for bug #73530 (Unsetting result set may reset other result + set). (cmb) + +- Standard: + . Fixed bug #73594 (dns_get_record does not populate $additional out + parameter). (Bruce Weirdan) + . Fixed bug #70213 (Unserialize context shared on double class lookup). + (Taoguang Chen) + . Fixed bug #73154 (serialize object with __sleep function crash). (Nikita) + +- Zlib: + . Fixed bug #73373 (deflate_add does not verify that output was not truncated). + (Matt Bonneau) + +08 Dec 2016 PHP 7.0.14 - Core: + . Fixed memory leak(null coalescing operator with Spl hash). (Tyson Andre) . Fixded bug #72736 (Slow performance when fetching large dataset with mysqli / PDO). (Dmitry) +- Calendar: + . Fix integer overflows (Joshua Rogers) + - Date: . Fixed bug #69587 (DateInterval properties and isset). (jhdxr) @@ -17,9 +71,12 @@ PHP NEWS This may be enabled again using envirionment variable USE_ZEND_DTRACE=1. (Dmitry) -- Mysqlnd:
- . Fixed bug #64526 (Add missing mysqlnd.* parameters to php.ini-*). (cmb)
-
+- JSON: + . Fixed bug #73526 (php_json_encode depth issue). (Jakub Zelenka) + +- Mysqlnd: + . Fixed bug #64526 (Add missing mysqlnd.* parameters to php.ini-*). (cmb) + - ODBC: . Fixed bug #73448 (odbc_errormsg returns trash, always 513 bytes). (Anatol) @@ -29,6 +86,7 @@ PHP NEWS . Fixed bug #73546 (Logging for opcache has an empty file name). (mhagstrand) - PCRE: + . Fixed bug #73483 (Segmentation fault on pcre_replace_callback). (Laruence) . Fixed bug #73392 (A use-after-free in zend allocator management). (Laruence) @@ -36,6 +94,17 @@ PHP NEWS . Fixed bug #73087, #61183, #71494 (Memory corruption in bindParam). (Dorin Marcoci) +- Postgres: + . Fixed bug #73498 (Incorrect SQL generated for pg_copy_to()). (Craig Duncan) + +- Phar: + . Fixed bug #73580 (Phar::isValidPharFilename illegal memory access). (Stas) + +- Soap: + . Fixed bug #73538 (SoapClient::__setSoapHeaders doesn't overwrite SOAP + headers). (duncan3dc) + . Fixed bug #73452 (Segfault (Regression for #69152)). (Dmitry) + - SPL: . Fixed bug #73423 (Reproducible crash with GDB backtrace). (Laruence) @@ -43,8 +112,13 @@ PHP NEWS . Fixed bug #73530 (Unsetting result set may reset other result set). (cmb) - Standard: - . Fixed bug #73297 (HTTP stream wrapper should ignore HTTP 100 Continue). - (rowan dot collins at gmail dot com) + . Fixed bug #73297 (HTTP stream wrapper should ignore HTTP 100 Continue). + (rowan dot collins at gmail dot com) + . Fixed bug #73645 (version_compare illegal write access). (Stas) + +- Wddx: + . Fixed bug #73631 (Invalid read when wddx decodes empty boolean element). + (Stas) - XML: . Fixed bug #72135 (malformed XML causes fault) (edgarsandi) @@ -5,6 +5,7 @@ This is the github mirror of the official PHP repository located at http://git.php.net. [](http://travis-ci.org/php/php-src) +[](https://ci.appveyor.com/project/php/php-src) Pull Requests ============= @@ -484,6 +484,7 @@ Other is defined in the interface. . session.lazy_write(default=On) INI setting enables only write session data when session data is updated. + . session_regenerate_id() saves current $_SESSION before creating new session ID. - Opcache . Removed opcache.load_comments configuration directive. Now doc comments diff --git a/Zend/tests/assign_to_obj_002.phpt b/Zend/tests/assign_to_obj_002.phpt new file mode 100644 index 0000000000..0ab2e84163 --- /dev/null +++ b/Zend/tests/assign_to_obj_002.phpt @@ -0,0 +1,12 @@ +--TEST-- +Assign to $this leaks when $this not defined +--FILE-- +<?php + +try { + $this->a = new stdClass; +} catch (Error $e) { echo $e->getMessage(), "\n"; } + +?> +--EXPECT-- +Using $this when not in object context diff --git a/Zend/tests/bug73663.phpt b/Zend/tests/bug73663.phpt new file mode 100644 index 0000000000..66b9a0565d --- /dev/null +++ b/Zend/tests/bug73663.phpt @@ -0,0 +1,73 @@ +--TEST-- +Bug #73663 ("Invalid opcode 65/16/8" occurs with a variable created with list()) +--FILE-- +<?php +function change(&$ref) { + $ref = range(1, 10); + return; +} + +$func = function (&$ref) { + return change($ref); +}; + +$array = [1]; +var_dump(list($val) = $array); // NG: Invalid opcode + +change(list($val) = $array); +var_dump($array); + +$array = [1]; + +$func(list($val) = $array); +var_dump($array); +?> +--EXPECT-- +array(1) { + [0]=> + int(1) +} +array(10) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + [3]=> + int(4) + [4]=> + int(5) + [5]=> + int(6) + [6]=> + int(7) + [7]=> + int(8) + [8]=> + int(9) + [9]=> + int(10) +} +array(10) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + [3]=> + int(4) + [4]=> + int(5) + [5]=> + int(6) + [6]=> + int(7) + [7]=> + int(8) + [8]=> + int(9) + [9]=> + int(10) +} diff --git a/Zend/tests/bug73753.phpt b/Zend/tests/bug73753.phpt new file mode 100644 index 0000000000..9a77f62f56 --- /dev/null +++ b/Zend/tests/bug73753.phpt @@ -0,0 +1,29 @@ +--TEST-- +Bug #73753 Non packed arrays and duplication +--FILE-- +<?php +function iterate($current, $a, $result = null) { + if (!$current) { + return $result; + } + + return iterate(getNext($a), $a, $current); +} + +function getNext(&$a) { + return next($a); +} + +function getCurrent($a) { + return current($a); +} + +function traverse($a) { + return iterate(getCurrent($a), $a); +} + +$arr = array(1 => 'foo', 'b' => 'bar', 'baz'); +var_dump(traverse($arr)); +?> +--EXPECTF-- +string(3) "baz" diff --git a/Zend/tests/bug73792.phpt b/Zend/tests/bug73792.phpt new file mode 100644 index 0000000000..ac4f265aaf --- /dev/null +++ b/Zend/tests/bug73792.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #73792 (invalid foreach loop hangs script) +--FILE-- +<?php +$a = 'aaa'; + +foreach ($a['bbb'] as &$value) { + echo 'loop'; +} + +unset($value); +echo 'done'; +?> +--EXPECTF-- +Warning: Illegal string offset 'bbb' in %sbug73792.php on line 4 + +Fatal error: Uncaught Error: Cannot iterate on string offsets by reference in %sbug73792.php:4 +Stack trace: +#0 {main} + thrown in %sbug73792.php on line 4 diff --git a/Zend/tests/compound_assign_failure.phpt b/Zend/tests/compound_assign_failure.phpt new file mode 100644 index 0000000000..2e35ab4fff --- /dev/null +++ b/Zend/tests/compound_assign_failure.phpt @@ -0,0 +1,184 @@ +--TEST-- +Behavior of failing compound assignment +--INI-- +opcache.optimization_level=0 +--FILE-- +<?php + +try { + $a = 1; + $a %= 0; +} catch (Error $e) { var_dump($a); } + +try { + $a = 1; + $a >>= -1; +} catch (Error $e) { var_dump($a); } + +try { + $a = 1; + $a <<= -1; +} catch (Error $e) { var_dump($a); } + +set_error_handler(function($type, $msg) { throw new Exception($msg); }); + +try { + $a = []; + $a .= "foo"; +} catch (Throwable $e) { var_dump($a); } + +try { + $a = "foo"; + $a .= []; +} catch (Throwable $e) { var_dump($a); } + +$x = new stdClass; +try { $x += 1; } +catch (Exception $e) {} +var_dump($x); + +$x = 1; +try { $x += new stdClass; } +catch (Exception $e) {} +var_dump($x); + +$x = new stdClass; +try { $x -= 1; } +catch (Exception $e) {} +var_dump($x); + +$x = 1; +try { $x -= new stdClass; } +catch (Exception $e) {} +var_dump($x); + +$x = new stdClass; +try { $x *= 1; } +catch (Exception $e) {} +var_dump($x); + +$x = 1; +try { $x *= new stdClass; } +catch (Exception $e) {} +var_dump($x); + +$x = new stdClass; +try { $x /= 1; } +catch (Exception $e) {} +var_dump($x); + +$x = 1; +try { $x /= new stdClass; } +catch (Exception $e) {} +var_dump($x); + +$x = new stdClass; +try { $x %= 1; } +catch (Exception $e) {} +var_dump($x); + +$x = 1; +try { $x %= new stdClass; } +catch (Exception $e) {} +var_dump($x); + +$x = new stdClass; +try { $x **= 1; } +catch (Exception $e) {} +var_dump($x); + +$x = 1; +try { $x **= new stdClass; } +catch (Exception $e) {} +var_dump($x); + +$x = new stdClass; +try { $x ^= 1; } +catch (Exception $e) {} +var_dump($x); + +$x = 1; +try { $x ^= new stdClass; } +catch (Exception $e) {} +var_dump($x); + +$x = new stdClass; +try { $x &= 1; } +catch (Exception $e) {} +var_dump($x); + +$x = 1; +try { $x &= new stdClass; } +catch (Exception $e) {} +var_dump($x); + +$x = new stdClass; +try { $x |= 1; } +catch (Exception $e) {} +var_dump($x); + +$x = 1; +try { $x |= new stdClass; } +catch (Exception $e) {} +var_dump($x); + +$x = new stdClass; +try { $x <<= 1; } +catch (Exception $e) {} +var_dump($x); + +$x = 1; +try { $x <<= new stdClass; } +catch (Exception $e) {} +var_dump($x); + +$x = new stdClass; +try { $x >>= 1; } +catch (Exception $e) {} +var_dump($x); + +$x = 1; +try { $x >>= new stdClass; } +catch (Exception $e) {} +var_dump($x); +?> +--EXPECTF-- +int(1) +int(1) +int(1) +array(0) { +} +string(3) "foo" +object(stdClass)#%d (0) { +} +int(1) +object(stdClass)#%d (0) { +} +int(1) +object(stdClass)#%d (0) { +} +int(1) +object(stdClass)#%d (0) { +} +int(1) +object(stdClass)#%d (0) { +} +int(1) +object(stdClass)#%d (0) { +} +int(1) +object(stdClass)#%d (0) { +} +int(1) +object(stdClass)#%d (0) { +} +int(1) +object(stdClass)#%d (0) { +} +int(1) +object(stdClass)#%d (0) { +} +int(1) +object(stdClass)#%d (0) { +} +int(1) diff --git a/Zend/tests/concat_003.phpt b/Zend/tests/concat_003.phpt index 07fabd1113..13c6fdc087 100644 --- a/Zend/tests/concat_003.phpt +++ b/Zend/tests/concat_003.phpt @@ -2,51 +2,37 @@ Concatenating many small strings should not slowdown allocations --SKIPIF-- <?php if (PHP_DEBUG) { die ("skip debug version is slow"); } ?> ---INI-- -memory_limit=256m --FILE-- <?php -/* To note is that memory usage can vary depending on whether opcache is on. The actual - measuring that matters is timing here. */ - $time = microtime(TRUE); /* This might vary on Linux/Windows, so the worst case and also count in slow machines. */ -$t0_max = 0.1; -$t1_max = 0.4; - -$datas = []; -for ($i = 0; $i < 220000; $i++) -{ - $datas[] = [ - '000.000.000.000', - '000.255.255.255', - 'ä¿ç•™åœ°å€', - 'ä¿ç•™åœ°å€', - 'ä¿ç•™åœ°å€', - 'ä¿ç•™åœ°å€', - 'ä¿ç•™åœ°å€', - 'ä¿ç•™åœ°å€', - ]; -} - -$t0 = microtime(TRUE) - $time; -var_dump($t0 < $t0_max); - +$t_max = 1.0; + +$datas = array_fill(0, 220000, [ + '000.000.000.000', + '000.255.255.255', + 'ä¿ç•™åœ°å€', + 'ä¿ç•™åœ°å€', + 'ä¿ç•™åœ°å€', + 'ä¿ç•™åœ°å€', + 'ä¿ç•™åœ°å€', + 'ä¿ç•™åœ°å€', +]); +$time = microtime(TRUE); $texts = ''; foreach ($datas AS $data) { $texts .= implode("\t", $data) . "\r\n"; } -$t1 = microtime(TRUE) - $time; -var_dump($t1 < $t1_max); +$t = microtime(TRUE) - $time; +var_dump($t < $t_max); ?> +++DONE+++ --EXPECT-- bool(true) -bool(true) +++DONE+++ diff --git a/Zend/tests/generators/generator_trampoline.phpt b/Zend/tests/generators/generator_trampoline.phpt new file mode 100644 index 0000000000..a98dc9ee49 --- /dev/null +++ b/Zend/tests/generators/generator_trampoline.phpt @@ -0,0 +1,24 @@ +--TEST-- +Calling generator through magic __call() +--FILE-- +<?php +class A { + public function __call($name, $args) { + for ($i = 0; $i < 5; $i++) { + yield $i; + } + } +} + +$a = new A(); +foreach ($a->gen() as $n) { + var_dump($n); +} +$a->gen(); +?> +--EXPECT-- +int(0) +int(1) +int(2) +int(3) +int(4) diff --git a/Zend/tests/self_and.phpt b/Zend/tests/self_and.phpt index cdcde77992..e9ddc849eb 100644 --- a/Zend/tests/self_and.phpt +++ b/Zend/tests/self_and.phpt @@ -6,6 +6,8 @@ ANDing strings $s = "123"; $s1 = "test"; $s2 = "45345some"; +$s3 = str_repeat("f", 1); +$s4 = str_repeat("f", 2); $s &= 22; var_dump($s); @@ -16,10 +18,18 @@ var_dump($s1); $s2 &= 33; var_dump($s2); +$s3 &= " "; +var_dump($s3); + +$s4 &= " "; +var_dump($s4); + echo "Done\n"; ?> --EXPECTF-- int(18) int(0) int(33) +string(1) " " +string(2) " " Done diff --git a/Zend/tests/self_or.phpt b/Zend/tests/self_or.phpt index ae667bff16..991aafa980 100644 --- a/Zend/tests/self_or.phpt +++ b/Zend/tests/self_or.phpt @@ -6,6 +6,8 @@ ORing strings $s = "123"; $s1 = "test"; $s2 = "45345some"; +$s3 = str_repeat("f", 1); +$s4 = str_repeat("f", 2); $s |= 22; var_dump($s); @@ -16,10 +18,18 @@ var_dump($s1); $s2 |= 33; var_dump($s2); +$s3 |= " "; +var_dump($s3); + +$s4 |= " "; +var_dump($s4); + echo "Done\n"; ?> --EXPECTF-- int(127) int(11) int(45345) +string(1) "f" +string(2) "ff" Done diff --git a/Zend/tests/self_xor.phpt b/Zend/tests/self_xor.phpt index a7e43f539d..f306a9cd69 100644 --- a/Zend/tests/self_xor.phpt +++ b/Zend/tests/self_xor.phpt @@ -6,6 +6,8 @@ XORing strings $s = "123"; $s1 = "test"; $s2 = "45345some"; +$s3 = str_repeat("f", 1); +$s4 = str_repeat("f", 2); $s ^= 22; var_dump($s); @@ -16,10 +18,18 @@ var_dump($s1); $s2 ^= 33; var_dump($s2); +$s3 ^= " "; +var_dump($s3); + +$s4 ^= " "; +var_dump($s4); + echo "Done\n"; ?> --EXPECTF-- int(109) int(11) int(45312) +string(1) "F" +string(2) "FF" Done diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index 937340d9c9..be82854e70 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -2343,7 +2343,7 @@ ZEND_API int is_zend_mm(void) #endif } -#if !ZEND_DEBUG && (!defined(_WIN32) || defined(__clang__)) +#if !ZEND_DEBUG && defined(HAVE_BUILTIN_CONSTANT_P) #undef _emalloc #if ZEND_MM_CUSTOM diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index eb373906eb..4b7b9979a5 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1002,10 +1002,8 @@ ZEND_API zend_class_entry *do_bind_class(const zend_op_array* op_array, const ze op1 = RT_CONSTANT(op_array, opline->op1); op2 = RT_CONSTANT(op_array, opline->op2); } - if ((ce = zend_hash_find_ptr(class_table, Z_STR_P(op1))) == NULL) { - zend_error_noreturn(E_COMPILE_ERROR, "Internal Zend error - Missing class information for %s", Z_STRVAL_P(op1)); - return NULL; - } + ce = zend_hash_find_ptr(class_table, Z_STR_P(op1)); + ZEND_ASSERT(ce); ce->refcount++; if (zend_hash_add_ptr(class_table, Z_STR_P(op2), ce) == NULL) { ce->refcount--; @@ -2783,12 +2781,21 @@ uint32_t zend_compile_args(zend_ast *ast, zend_function *fbc) /* {{{ */ } } else { zend_compile_expr(&arg_node, arg); - ZEND_ASSERT(arg_node.op_type != IS_CV); if (arg_node.op_type == IS_VAR) { opcode = ZEND_SEND_VAR_NO_REF; if (fbc && ARG_MUST_BE_SENT_BY_REF(fbc, arg_num)) { flags |= ZEND_ARG_SEND_BY_REF; } + } else if (arg_node.op_type == IS_CV) { + if (fbc) { + if (ARG_SHOULD_BE_SENT_BY_REF(fbc, arg_num)) { + opcode = ZEND_SEND_REF; + } else { + opcode = ZEND_SEND_VAR; + } + } else { + opcode = ZEND_SEND_VAR_EX; + } } else { if (fbc) { opcode = ZEND_SEND_VAL; diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index e0aa370bfe..bac9d34b05 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -186,7 +186,9 @@ ZEND_API void zend_clear_exception(void) /* {{{ */ } OBJ_RELEASE(EG(exception)); EG(exception) = NULL; - EG(current_execute_data)->opline = EG(opline_before_exception); + if (EG(current_execute_data)) { + EG(current_execute_data)->opline = EG(opline_before_exception); + } #if ZEND_DEBUG EG(opline_before_exception) = NULL; #endif diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 326c719c65..dc3db0f9fe 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -1412,11 +1412,11 @@ static zend_never_inline void zend_pre_incdec_overloaded_property(zval *object, zval rv; if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z, obj; + zval *z, *zptr, obj; ZVAL_OBJ(&obj, Z_OBJ_P(object)); Z_ADDREF(obj); - z = Z_OBJ_HT(obj)->read_property(&obj, property, BP_VAR_R, cache_slot, &rv); + zptr = z = Z_OBJ_HT(obj)->read_property(&obj, property, BP_VAR_R, cache_slot, &rv); if (UNEXPECTED(EG(exception))) { OBJ_RELEASE(Z_OBJ(obj)); return; @@ -1443,7 +1443,7 @@ static zend_never_inline void zend_pre_incdec_overloaded_property(zval *object, } Z_OBJ_HT(obj)->write_property(&obj, property, z, cache_slot); OBJ_RELEASE(Z_OBJ(obj)); - zval_ptr_dtor(z); + zval_ptr_dtor(zptr); } else { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); if (UNEXPECTED(result)) { diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c index 6055e76e96..8dc9484eb0 100644 --- a/Zend/zend_generators.c +++ b/Zend/zend_generators.c @@ -519,6 +519,7 @@ ZEND_API zend_generator *zend_generator_update_current(zend_generator *generator generator->execute_fake.prev_execute_data = original_execute_data; } + root->execute_data->opline--; /* ZEND_YIELD(_FROM) already advance, so decrement opline to throw from correct place */ zend_throw_exception(zend_ce_ClosedGeneratorException, "Generator yielded from aborted, no return value available", 0); EG(current_execute_data) = original_execute_data; diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c index aecdac6379..322422da15 100644 --- a/Zend/zend_hash.c +++ b/Zend/zend_hash.c @@ -1757,7 +1757,7 @@ static zend_always_inline void zend_array_dup_packed_elements(HashTable *source, static zend_always_inline uint32_t zend_array_dup_elements(HashTable *source, HashTable *target, int static_keys, int with_holes) { - uint32_t idx = 0; + uint32_t idx = 0; Bucket *p = source->arData; Bucket *q = target->arData; Bucket *end = p + source->nNumUsed; @@ -1785,7 +1785,7 @@ static zend_always_inline uint32_t zend_array_dup_elements(HashTable *source, Ha ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source) { - uint32_t idx; + uint32_t idx; HashTable *target; IS_CONSISTENT(source); @@ -1849,7 +1849,8 @@ ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source) target->u.flags = (source->u.flags & ~(HASH_FLAG_PERSISTENT|ZEND_HASH_APPLY_COUNT_MASK)) | HASH_FLAG_APPLY_PROTECTION; target->nTableMask = source->nTableMask; target->nNextFreeElement = source->nNextFreeElement; - target->nInternalPointer = HT_INVALID_IDX; + target->nInternalPointer = source->nInternalPointer; + HT_SET_DATA_ADDR(target, emalloc(HT_SIZE(target))); HT_HASH_RESET(target); diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h index f4c2c30fbc..1be68c7d63 100644 --- a/Zend/zend_hash.h +++ b/Zend/zend_hash.h @@ -301,6 +301,16 @@ static zend_always_inline zval *zend_hash_str_find_ind(const HashTable *ht, cons } +static zend_always_inline int zend_hash_str_exists_ind(const HashTable *ht, const char *str, size_t len) +{ + zval *zv; + + zv = zend_hash_str_find(ht, str, len); + return zv && (Z_TYPE_P(zv) != IS_INDIRECT || + Z_TYPE_P(Z_INDIRECT_P(zv)) != IS_UNDEF); +} + + static zend_always_inline zval *zend_symtable_update(HashTable *ht, zend_string *key, zval *pData) { zend_ulong idx; diff --git a/Zend/zend_ini_parser.y b/Zend/zend_ini_parser.y index 5e38defb15..2e3ca9003d 100644 --- a/Zend/zend_ini_parser.y +++ b/Zend/zend_ini_parser.y @@ -115,10 +115,10 @@ static void zend_ini_add_string(zval *result, zval *op1, zval *op2) /* ZEND_ASSERT(!Z_REFCOUNTED_P(op1)); */ if (ZEND_SYSTEM_INI) { ZVAL_PSTRINGL(op1, ZSTR_VAL(str), ZSTR_LEN(str)); + zend_string_release(str); } else { ZVAL_STR(op1, str); } - zend_string_release(str); } op1_len = (int)Z_STRLEN_P(op1); diff --git a/Zend/zend_ini_scanner.c b/Zend/zend_ini_scanner.c index 08749751eb..8cc5b4db55 100644 --- a/Zend/zend_ini_scanner.c +++ b/Zend/zend_ini_scanner.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.14.3 */ +/* Generated by re2c 0.16 */ #line 1 "Zend/zend_ini_scanner.l" /* +----------------------------------------------------------------------+ @@ -456,12 +456,14 @@ yyc_INITIAL: YYDEBUG(1, *YYCURSOR); YYFILL(5); yych = *YYCURSOR; - YYDEBUG(-1, yych); + if (yybm[0+yych] & 64) { + goto yy12; + } switch (yych) { - case '\t': goto yy5; - case '\n': goto yy7; - case '\r': goto yy9; - case ' ': goto yy10; + case '\t': goto yy6; + case '\n': goto yy9; + case '\r': goto yy11; + case ' ': case '!': case '"': case '$': @@ -472,43 +474,36 @@ yyc_INITIAL: case '{': case '|': case '}': - case '~': goto yy11; - case '%': - case '\'': - case '*': - case '+': - case ',': - case '-': - case '.': - case '/': - case ':': - case '<': - case '>': - case '?': - case '@': - case ']': goto yy13; - case ';': goto yy14; - case '=': goto yy16; + case '~': goto yy14; + case ';': goto yy16; + case '=': goto yy18; case 'F': - case 'f': goto yy18; + case 'f': goto yy21; case 'N': - case 'n': goto yy19; + case 'n': goto yy22; case 'O': - case 'o': goto yy20; + case 'o': goto yy23; case 'T': - case 't': goto yy21; + case 't': goto yy24; case 'Y': - case 'y': goto yy22; - case '[': goto yy23; + case 'y': goto yy25; + case '[': goto yy26; default: goto yy3; } yy3: YYDEBUG(3, *YYCURSOR); ++YYCURSOR; + YYFILL(1); yych = *YYCURSOR; - goto yy26; yy4: YYDEBUG(4, *YYCURSOR); + if (yybm[0+yych] & 16) { + goto yy3; + } + if (yych <= '=') goto yy5; + if (yych <= '[') goto yy28; +yy5: + YYDEBUG(5, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 483 "Zend/zend_ini_scanner.l" { /* Get option name */ @@ -520,199 +515,219 @@ yy4: RETURN_TOKEN(TC_LABEL, yytext, yyleng); } -#line 524 "Zend/zend_ini_scanner.c" -yy5: - YYDEBUG(5, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - goto yy64; +#line 519 "Zend/zend_ini_scanner.c" yy6: YYDEBUG(6, *YYCURSOR); + ++YYCURSOR; + YYFILL(2); + yych = *YYCURSOR; + YYDEBUG(7, *YYCURSOR); + if (yybm[0+yych] & 32) { + goto yy6; + } + if (yych <= '\r') { + if (yych <= 0x08) goto yy8; + if (yych <= '\n') goto yy9; + if (yych >= '\r') goto yy11; + } else { + if (yych <= ';') { + if (yych >= ';') goto yy31; + } else { + if (yych == '=') goto yy18; + } + } +yy8: + YYDEBUG(8, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 629 "Zend/zend_ini_scanner.l" { /* eat whitespace */ goto restart; } -#line 538 "Zend/zend_ini_scanner.c" -yy7: - YYDEBUG(7, *YYCURSOR); +#line 548 "Zend/zend_ini_scanner.c" +yy9: + YYDEBUG(9, *YYCURSOR); ++YYCURSOR; -yy8: - YYDEBUG(8, *YYCURSOR); +yy10: + YYDEBUG(10, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 634 "Zend/zend_ini_scanner.l" { SCNG(lineno)++; return END_OF_LINE; } -#line 550 "Zend/zend_ini_scanner.c" -yy9: - YYDEBUG(9, *YYCURSOR); +#line 560 "Zend/zend_ini_scanner.c" +yy11: + YYDEBUG(11, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '\n') goto yy67; - goto yy8; -yy10: - YYDEBUG(10, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 0x1F) { - if (yych <= '\n') { - if (yych <= 0x08) goto yy26; - if (yych <= '\t') goto yy63; - goto yy67; + if (yych == '\n') goto yy9; + goto yy10; +yy12: + YYDEBUG(12, *YYCURSOR); + ++YYCURSOR; + YYFILL(2); + yych = *YYCURSOR; + YYDEBUG(13, *YYCURSOR); + if (yybm[0+yych] & 64) { + goto yy12; + } + if (yych <= '\'') { + if (yych <= 0x1F) { + if (yych <= '\n') { + if (yych <= 0x08) goto yy3; + if (yych <= '\t') goto yy6; + goto yy9; + } else { + if (yych == '\r') goto yy11; + goto yy3; + } } else { - if (yych == '\r') goto yy68; - goto yy26; + if (yych <= '$') { + if (yych == '#') goto yy3; + goto yy5; + } else { + if (yych == '&') goto yy5; + goto yy3; + } } } else { - if (yych <= ';') { - if (yych <= ' ') goto yy65; - if (yych <= ':') goto yy26; - goto yy58; + if (yych <= 'Z') { + if (yych <= ';') { + if (yych <= ')') goto yy5; + if (yych <= ':') goto yy3; + goto yy31; + } else { + if (yych == '=') goto yy18; + goto yy3; + } } else { - if (yych == '=') goto yy56; - goto yy26; + if (yych <= '^') { + if (yych <= '[') goto yy28; + if (yych <= ']') goto yy3; + goto yy5; + } else { + if (yych <= 'z') goto yy3; + if (yych <= '~') goto yy5; + goto yy3; + } } } -yy11: - YYDEBUG(11, *YYCURSOR); +yy14: + YYDEBUG(14, *YYCURSOR); ++YYCURSOR; - YYDEBUG(12, *YYCURSOR); + YYDEBUG(15, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 557 "Zend/zend_ini_scanner.l" { /* Disallow these chars outside option values */ return yytext[0]; } -#line 588 "Zend/zend_ini_scanner.c" -yy13: - YYDEBUG(13, *YYCURSOR); - yych = *++YYCURSOR; - goto yy26; -yy14: - YYDEBUG(14, *YYCURSOR); - yyaccept = 2; - yych = *(YYMARKER = ++YYCURSOR); - goto yy59; - YYDEBUG(15, *YYCURSOR); +#line 625 "Zend/zend_ini_scanner.c" +yy16: + YYDEBUG(16, *YYCURSOR); + ++YYCURSOR; + yych = *YYCURSOR; + goto yy32; + YYDEBUG(17, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 650 "Zend/zend_ini_scanner.l" { return 0; } -#line 604 "Zend/zend_ini_scanner.c" -yy16: - YYDEBUG(16, *YYCURSOR); +#line 637 "Zend/zend_ini_scanner.c" +yy18: + YYDEBUG(18, *YYCURSOR); ++YYCURSOR; + YYFILL(1); yych = *YYCURSOR; - goto yy57; -yy17: - YYDEBUG(17, *YYCURSOR); + YYDEBUG(19, *YYCURSOR); + if (yych == '\t') goto yy18; + if (yych == ' ') goto yy18; + YYDEBUG(20, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 493 "Zend/zend_ini_scanner.l" { /* Start option value */ if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) { - yy_push_state(ST_RAW); + BEGIN(ST_RAW); } else { - yy_push_state(ST_VALUE); + BEGIN(ST_VALUE); } return '='; } -#line 622 "Zend/zend_ini_scanner.c" -yy18: - YYDEBUG(18, *YYCURSOR); +#line 657 "Zend/zend_ini_scanner.c" +yy21: + YYDEBUG(21, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy53; - if (yych == 'a') goto yy53; - goto yy26; -yy19: - YYDEBUG(19, *YYCURSOR); + if (yych == 'A') goto yy36; + if (yych == 'a') goto yy36; + goto yy4; +yy22: + YYDEBUG(22, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { - if (yych == 'O') goto yy44; - if (yych <= 'T') goto yy26; - goto yy45; + if (yych == 'O') goto yy37; + if (yych <= 'T') goto yy4; + goto yy39; } else { if (yych <= 'o') { - if (yych <= 'n') goto yy26; - goto yy44; + if (yych <= 'n') goto yy4; + goto yy37; } else { - if (yych == 'u') goto yy45; - goto yy26; + if (yych == 'u') goto yy39; + goto yy4; } } -yy20: - YYDEBUG(20, *YYCURSOR); +yy23: + YYDEBUG(23, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'N') { - if (yych == 'F') goto yy38; - if (yych <= 'M') goto yy26; - goto yy31; + if (yych == 'F') goto yy40; + if (yych <= 'M') goto yy4; + goto yy41; } else { if (yych <= 'f') { - if (yych <= 'e') goto yy26; - goto yy38; + if (yych <= 'e') goto yy4; + goto yy40; } else { - if (yych == 'n') goto yy31; - goto yy26; + if (yych == 'n') goto yy41; + goto yy4; } } -yy21: - YYDEBUG(21, *YYCURSOR); +yy24: + YYDEBUG(24, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy36; - if (yych == 'r') goto yy36; - goto yy26; -yy22: - YYDEBUG(22, *YYCURSOR); + if (yych == 'R') goto yy44; + if (yych == 'r') goto yy44; + goto yy4; +yy25: + YYDEBUG(25, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy27; - if (yych == 'e') goto yy27; - goto yy26; -yy23: - YYDEBUG(23, *YYCURSOR); + if (yych == 'E') goto yy45; + if (yych == 'e') goto yy45; + goto yy4; +yy26: + YYDEBUG(26, *YYCURSOR); ++YYCURSOR; - YYDEBUG(24, *YYCURSOR); + YYDEBUG(27, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 408 "Zend/zend_ini_scanner.l" { /* Section start */ /* Enter section data lookup state */ if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) { - yy_push_state(ST_SECTION_RAW); + BEGIN(ST_SECTION_RAW); } else { - yy_push_state(ST_SECTION_VALUE); + BEGIN(ST_SECTION_VALUE); } return TC_SECTION; } -#line 688 "Zend/zend_ini_scanner.c" -yy25: - YYDEBUG(25, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; -yy26: - YYDEBUG(26, *YYCURSOR); - if (yybm[0+yych] & 16) { - goto yy25; - } - if (yych <= '=') goto yy4; - if (yych <= '[') goto yy28; - goto yy4; -yy27: - YYDEBUG(27, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'S') goto yy31; - if (yych == 's') goto yy31; - goto yy26; +#line 723 "Zend/zend_ini_scanner.c" yy28: YYDEBUG(28, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(29, *YYCURSOR); - if (yybm[0+yych] & 32) { - goto yy28; - } + if (yych == '\t') goto yy28; + if (yych == ' ') goto yy28; YYDEBUG(30, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 433 "Zend/zend_ini_scanner.l" @@ -724,405 +739,315 @@ yy28: EAT_TRAILING_WHITESPACE_EX('['); /* Enter offset lookup state */ - yy_push_state(ST_OFFSET); + BEGIN(ST_OFFSET); RETURN_TOKEN(TC_OFFSET, yytext, yyleng); } -#line 732 "Zend/zend_ini_scanner.c" +#line 747 "Zend/zend_ini_scanner.c" yy31: YYDEBUG(31, *YYCURSOR); ++YYCURSOR; - YYFILL(1); + YYFILL(2); yych = *YYCURSOR; +yy32: YYDEBUG(32, *YYCURSOR); - if (yybm[0+yych] & 64) { + if (yybm[0+yych] & 128) { goto yy31; } - if (yych <= '\'') { - if (yych <= 0x1F) { - if (yych <= '\n') { - if (yych <= 0x08) goto yy25; - if (yych <= '\t') goto yy34; - } else { - if (yych != '\r') goto yy25; - } - } else { - if (yych <= '$') { - if (yych == '#') goto yy25; - } else { - if (yych != '&') goto yy25; - } - } - } else { - if (yych <= 'Z') { - if (yych <= ';') { - if (yych <= ')') goto yy33; - if (yych <= ':') goto yy25; - } else { - if (yych != '=') goto yy25; - } - } else { - if (yych <= '^') { - if (yych <= '[') goto yy28; - if (yych <= ']') goto yy25; - } else { - if (yych <= 'z') goto yy25; - if (yych >= 0x7F) goto yy25; - } - } - } + if (yych >= '\v') goto yy35; yy33: YYDEBUG(33, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 471 "Zend/zend_ini_scanner.l" - { /* TRUE value (when used outside option value/offset this causes parse error!) */ - RETURN_TOKEN(BOOL_TRUE, "1", 1); -} -#line 782 "Zend/zend_ini_scanner.c" + ++YYCURSOR; yy34: YYDEBUG(34, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; + yyleng = YYCURSOR - SCNG(yy_text); +#line 639 "Zend/zend_ini_scanner.l" + { /* Comment */ + BEGIN(INITIAL); + SCNG(lineno)++; + return END_OF_LINE; +} +#line 771 "Zend/zend_ini_scanner.c" +yy35: YYDEBUG(35, *YYCURSOR); - if (yych == '\t') goto yy34; - if (yych == ' ') goto yy34; - goto yy33; + yych = *++YYCURSOR; + if (yych == '\n') goto yy33; + goto yy34; yy36: YYDEBUG(36, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'U') goto yy37; - if (yych != 'u') goto yy26; + if (yych == 'L') goto yy46; + if (yych == 'l') goto yy46; + goto yy4; yy37: YYDEBUG(37, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy31; - if (yych == 'e') goto yy31; - goto yy26; -yy38: - YYDEBUG(38, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'F') goto yy39; - if (yych != 'f') goto yy26; -yy39: - YYDEBUG(39, *YYCURSOR); ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(40, *YYCURSOR); - if (yych <= '&') { + if ((yych = *YYCURSOR) <= '\'') { if (yych <= 0x1F) { if (yych <= '\n') { - if (yych <= 0x08) goto yy25; - if (yych <= '\t') goto yy42; + if (yych <= 0x08) goto yy4; + if (yych <= '\t') goto yy47; } else { - if (yych != '\r') goto yy25; + if (yych != '\r') goto yy4; } } else { if (yych <= '#') { - if (yych <= ' ') goto yy39; - if (yych >= '#') goto yy25; + if (yych <= ' ') goto yy49; + if (yych >= '#') goto yy4; } else { - if (yych == '%') goto yy25; + if (yych == '%') goto yy4; + if (yych >= '\'') goto yy4; } } } else { - if (yych <= '=') { - if (yych <= ':') { - if (yych <= '\'') goto yy25; - if (yych >= '*') goto yy25; + if (yych <= 'N') { + if (yych <= ';') { + if (yych <= ')') goto yy38; + if (yych <= ':') goto yy4; } else { - if (yych == '<') goto yy25; + if (yych == '=') goto yy38; + if (yych <= 'M') goto yy4; + goto yy51; } } else { - if (yych <= ']') { - if (yych == '[') goto yy28; - goto yy25; + if (yych <= 'm') { + if (yych != '^') goto yy4; } else { - if (yych <= '^') goto yy41; - if (yych <= 'z') goto yy25; - if (yych >= 0x7F) goto yy25; + if (yych <= 'n') goto yy51; + if (yych <= 'z') goto yy4; + if (yych >= 0x7F) goto yy4; } } } -yy41: - YYDEBUG(41, *YYCURSOR); +yy38: + YYDEBUG(38, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 475 "Zend/zend_ini_scanner.l" { /* FALSE value (when used outside option value/offset this causes parse error!)*/ RETURN_TOKEN(BOOL_FALSE, "", 0); } -#line 856 "Zend/zend_ini_scanner.c" -yy42: - YYDEBUG(42, *YYCURSOR); +#line 830 "Zend/zend_ini_scanner.c" +yy39: + YYDEBUG(39, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'L') goto yy52; + if (yych == 'l') goto yy52; + goto yy4; +yy40: + YYDEBUG(40, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'F') goto yy49; + if (yych == 'f') goto yy49; + goto yy4; +yy41: + YYDEBUG(41, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(43, *YYCURSOR); - if (yych == '\t') goto yy42; - if (yych == ' ') goto yy42; - goto yy41; -yy44: - YYDEBUG(44, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '\'') { + YYDEBUG(42, *YYCURSOR); + if (yych <= '&') { if (yych <= 0x1F) { if (yych <= '\n') { - if (yych <= 0x08) goto yy26; - if (yych <= '\t') goto yy42; - goto yy41; + if (yych <= 0x08) goto yy3; + if (yych <= '\t') goto yy53; } else { - if (yych == '\r') goto yy41; - goto yy26; + if (yych != '\r') goto yy3; } } else { if (yych <= '#') { - if (yych <= ' ') goto yy39; - if (yych <= '"') goto yy41; - goto yy26; + if (yych <= ' ') goto yy41; + if (yych >= '#') goto yy3; } else { - if (yych == '%') goto yy26; - if (yych <= '&') goto yy41; - goto yy26; + if (yych == '%') goto yy3; } } } else { - if (yych <= 'N') { - if (yych <= ';') { - if (yych <= ')') goto yy41; - if (yych <= ':') goto yy26; - goto yy41; + if (yych <= '=') { + if (yych <= ':') { + if (yych <= '\'') goto yy3; + if (yych >= '*') goto yy3; } else { - if (yych == '=') goto yy41; - if (yych <= 'M') goto yy26; - goto yy52; + if (yych == '<') goto yy3; } } else { - if (yych <= 'm') { - if (yych == '^') goto yy41; - goto yy26; + if (yych <= ']') { + if (yych == '[') goto yy28; + goto yy3; } else { - if (yych <= 'n') goto yy52; - if (yych <= 'z') goto yy26; - if (yych <= '~') goto yy41; - goto yy26; + if (yych <= '^') goto yy43; + if (yych <= 'z') goto yy3; + if (yych >= 0x7F) goto yy3; } } } +yy43: + YYDEBUG(43, *YYCURSOR); + yyleng = YYCURSOR - SCNG(yy_text); +#line 471 "Zend/zend_ini_scanner.l" + { /* TRUE value (when used outside option value/offset this causes parse error!) */ + RETURN_TOKEN(BOOL_TRUE, "1", 1); +} +#line 891 "Zend/zend_ini_scanner.c" +yy44: + YYDEBUG(44, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'U') goto yy55; + if (yych == 'u') goto yy55; + goto yy4; yy45: YYDEBUG(45, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy46; - if (yych != 'l') goto yy26; + if (yych == 'S') goto yy41; + if (yych == 's') goto yy41; + goto yy4; yy46: YYDEBUG(46, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy47; - if (yych != 'l') goto yy26; + if (yych == 'S') goto yy51; + if (yych == 's') goto yy51; + goto yy4; yy47: YYDEBUG(47, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(48, *YYCURSOR); + if (yych == '\t') goto yy47; + if (yych == ' ') goto yy47; + goto yy38; +yy49: + YYDEBUG(49, *YYCURSOR); + ++YYCURSOR; + YYFILL(1); + yych = *YYCURSOR; + YYDEBUG(50, *YYCURSOR); if (yych <= '&') { if (yych <= 0x1F) { if (yych <= '\n') { - if (yych <= 0x08) goto yy25; - if (yych <= '\t') goto yy50; + if (yych <= 0x08) goto yy3; + if (yych <= '\t') goto yy47; + goto yy38; } else { - if (yych != '\r') goto yy25; + if (yych == '\r') goto yy38; + goto yy3; } } else { if (yych <= '#') { - if (yych <= ' ') goto yy47; - if (yych >= '#') goto yy25; + if (yych <= ' ') goto yy49; + if (yych <= '"') goto yy38; + goto yy3; } else { - if (yych == '%') goto yy25; + if (yych == '%') goto yy3; + goto yy38; } } } else { if (yych <= '=') { if (yych <= ':') { - if (yych <= '\'') goto yy25; - if (yych >= '*') goto yy25; + if (yych <= '\'') goto yy3; + if (yych <= ')') goto yy38; + goto yy3; } else { - if (yych == '<') goto yy25; + if (yych == '<') goto yy3; + goto yy38; } } else { if (yych <= ']') { if (yych == '[') goto yy28; - goto yy25; + goto yy3; } else { - if (yych <= '^') goto yy49; - if (yych <= 'z') goto yy25; - if (yych >= 0x7F) goto yy25; + if (yych <= '^') goto yy38; + if (yych <= 'z') goto yy3; + if (yych <= '~') goto yy38; + goto yy3; } } } -yy49: - YYDEBUG(49, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 479 "Zend/zend_ini_scanner.l" - { - RETURN_TOKEN(NULL_NULL, "", 0); -} -#line 971 "Zend/zend_ini_scanner.c" -yy50: - YYDEBUG(50, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; +yy51: YYDEBUG(51, *YYCURSOR); - if (yych == '\t') goto yy50; - if (yych == ' ') goto yy50; - goto yy49; + yych = *++YYCURSOR; + if (yych == 'E') goto yy49; + if (yych == 'e') goto yy49; + goto yy4; yy52: YYDEBUG(52, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy39; - if (yych == 'e') goto yy39; - goto yy26; + if (yych == 'L') goto yy56; + if (yych == 'l') goto yy56; + goto yy4; yy53: YYDEBUG(53, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'L') goto yy54; - if (yych != 'l') goto yy26; -yy54: + ++YYCURSOR; + YYFILL(1); + yych = *YYCURSOR; YYDEBUG(54, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'S') goto yy55; - if (yych != 's') goto yy26; + if (yych == '\t') goto yy53; + if (yych == ' ') goto yy53; + goto yy43; yy55: YYDEBUG(55, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy39; - if (yych == 'e') goto yy39; - goto yy26; + if (yych == 'E') goto yy41; + if (yych == 'e') goto yy41; + goto yy4; yy56: YYDEBUG(56, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy57: YYDEBUG(57, *YYCURSOR); - if (yych == '\t') goto yy56; - if (yych == ' ') goto yy56; - goto yy17; -yy58: - YYDEBUG(58, *YYCURSOR); - ++YYCURSOR; - YYFILL(2); - yych = *YYCURSOR; -yy59: - YYDEBUG(59, *YYCURSOR); - if (yybm[0+yych] & 128) { - goto yy58; - } - if (yych >= '\v') goto yy62; -yy60: - YYDEBUG(60, *YYCURSOR); - ++YYCURSOR; -yy61: - YYDEBUG(61, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 639 "Zend/zend_ini_scanner.l" - { /* Comment */ - BEGIN(INITIAL); - SCNG(lineno)++; - return END_OF_LINE; -} -#line 1036 "Zend/zend_ini_scanner.c" -yy62: - YYDEBUG(62, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '\n') goto yy60; - goto yy61; -yy63: - YYDEBUG(63, *YYCURSOR); - yyaccept = 0; - YYMARKER = ++YYCURSOR; - YYFILL(2); - yych = *YYCURSOR; -yy64: - YYDEBUG(64, *YYCURSOR); - if (yych <= 0x1F) { - if (yych <= '\n') { - if (yych <= 0x08) goto yy6; - if (yych <= '\t') goto yy63; - goto yy67; - } else { - if (yych == '\r') goto yy68; - goto yy6; - } - } else { - if (yych <= ';') { - if (yych <= ' ') goto yy63; - if (yych <= ':') goto yy6; - goto yy58; - } else { - if (yych == '=') goto yy56; - goto yy6; - } - } -yy65: - YYDEBUG(65, *YYCURSOR); - yyaccept = 1; - YYMARKER = ++YYCURSOR; - YYFILL(2); - yych = *YYCURSOR; - YYDEBUG(66, *YYCURSOR); if (yych <= '&') { if (yych <= 0x1F) { if (yych <= '\n') { - if (yych <= 0x08) goto yy25; - if (yych <= '\t') goto yy63; + if (yych <= 0x08) goto yy3; + if (yych <= '\t') goto yy59; } else { - if (yych == '\r') goto yy68; - goto yy25; + if (yych != '\r') goto yy3; } } else { if (yych <= '#') { - if (yych <= ' ') goto yy65; - if (yych <= '"') goto yy4; - goto yy25; + if (yych <= ' ') goto yy56; + if (yych >= '#') goto yy3; } else { - if (yych == '%') goto yy25; - goto yy4; + if (yych == '%') goto yy3; } } } else { if (yych <= '=') { if (yych <= ':') { - if (yych <= '\'') goto yy25; - if (yych <= ')') goto yy4; - goto yy25; + if (yych <= '\'') goto yy3; + if (yych >= '*') goto yy3; } else { - if (yych <= ';') goto yy58; - if (yych <= '<') goto yy25; - goto yy56; + if (yych == '<') goto yy3; } } else { if (yych <= ']') { if (yych == '[') goto yy28; - goto yy25; + goto yy3; } else { - if (yych <= '^') goto yy4; - if (yych <= 'z') goto yy25; - if (yych <= '~') goto yy4; - goto yy25; + if (yych <= '^') goto yy58; + if (yych <= 'z') goto yy3; + if (yych >= 0x7F) goto yy3; } } } -yy67: - YYDEBUG(67, *YYCURSOR); - yych = *++YYCURSOR; - goto yy8; -yy68: - YYDEBUG(68, *YYCURSOR); +yy58: + YYDEBUG(58, *YYCURSOR); + yyleng = YYCURSOR - SCNG(yy_text); +#line 479 "Zend/zend_ini_scanner.l" + { + RETURN_TOKEN(NULL_NULL, "", 0); +} +#line 1042 "Zend/zend_ini_scanner.c" +yy59: + YYDEBUG(59, *YYCURSOR); ++YYCURSOR; - if ((yych = *YYCURSOR) == '\n') goto yy67; - goto yy8; + YYFILL(1); + yych = *YYCURSOR; + YYDEBUG(60, *YYCURSOR); + if (yych == '\t') goto yy59; + if (yych == ' ') goto yy59; + goto yy58; } /* *********************************** */ yyc_ST_DOUBLE_QUOTES: @@ -1161,15 +1086,15 @@ yyc_ST_DOUBLE_QUOTES: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; - YYDEBUG(69, *YYCURSOR); + YYDEBUG(61, *YYCURSOR); YYFILL(2); yych = *YYCURSOR; - if (yych == '"') goto yy73; - if (yych == '$') goto yy75; - YYDEBUG(71, *YYCURSOR); + if (yych == '"') goto yy65; + if (yych == '$') goto yy68; + YYDEBUG(63, *YYCURSOR); ++YYCURSOR; -yy72: - YYDEBUG(72, *YYCURSOR); +yy64: + YYDEBUG(64, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 589 "Zend/zend_ini_scanner.l" { /* Escape double quoted string contents */ @@ -1207,574 +1132,426 @@ yy72: zend_ini_escape_string(ini_lval, yytext, yyleng, '"'); return TC_QUOTED_STRING; } -#line 1211 "Zend/zend_ini_scanner.c" -yy73: - YYDEBUG(73, *YYCURSOR); +#line 1136 "Zend/zend_ini_scanner.c" +yy65: + YYDEBUG(65, *YYCURSOR); ++YYCURSOR; + YYFILL(1); yych = *YYCURSOR; - goto yy79; -yy74: - YYDEBUG(74, *YYCURSOR); + YYDEBUG(66, *YYCURSOR); + if (yybm[0+yych] & 128) { + goto yy65; + } + YYDEBUG(67, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 584 "Zend/zend_ini_scanner.l" { /* Double quoted '"' string ends */ yy_pop_state(); return '"'; } -#line 1225 "Zend/zend_ini_scanner.c" -yy75: - YYDEBUG(75, *YYCURSOR); +#line 1153 "Zend/zend_ini_scanner.c" +yy68: + YYDEBUG(68, *YYCURSOR); yych = *++YYCURSOR; - if (yych != '{') goto yy72; - YYDEBUG(76, *YYCURSOR); + if (yych != '{') goto yy64; + YYDEBUG(69, *YYCURSOR); ++YYCURSOR; - YYDEBUG(77, *YYCURSOR); + YYDEBUG(70, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 451 "Zend/zend_ini_scanner.l" { /* Variable start */ yy_push_state(ST_VARNAME); return TC_DOLLAR_CURLY; } -#line 1239 "Zend/zend_ini_scanner.c" -yy78: - YYDEBUG(78, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; -yy79: - YYDEBUG(79, *YYCURSOR); - if (yybm[0+yych] & 128) { - goto yy78; - } - goto yy74; +#line 1167 "Zend/zend_ini_scanner.c" } /* *********************************** */ yyc_ST_OFFSET: { static const unsigned char yybm[] = { - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 194, 64, 66, 66, 64, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 194, 66, 64, 66, 68, 66, 66, 0, - 66, 66, 66, 66, 66, 66, 66, 66, - 114, 114, 114, 114, 114, 114, 114, 114, - 114, 114, 66, 64, 66, 66, 66, 66, - 66, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 66, 72, 64, 66, 82, - 66, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, + 132, 132, 132, 132, 132, 132, 132, 132, + 132, 140, 128, 132, 132, 128, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, + 140, 132, 128, 132, 192, 132, 132, 0, + 132, 132, 132, 132, 132, 132, 132, 132, + 180, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 132, 128, 132, 132, 132, 132, + 132, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 132, 192, 128, 132, 164, + 132, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, + 132, 132, 132, 132, 132, 132, 132, 132, }; - YYDEBUG(80, *YYCURSOR); + YYDEBUG(71, *YYCURSOR); YYFILL(2); yych = *YYCURSOR; - if (yych <= '-') { - if (yych <= ' ') { - if (yych <= '\n') { - if (yych <= 0x08) goto yy82; - if (yych <= '\t') goto yy84; - goto yy85; + if (yybm[0+yych] & 8) { + goto yy76; + } + if (yych <= '/') { + if (yych <= '"') { + if (yych <= '\f') { + if (yych <= 0x08) goto yy73; + if (yych <= '\n') goto yy78; } else { - if (yych == '\r') goto yy85; - if (yych >= ' ') goto yy84; + if (yych <= '\r') goto yy78; + if (yych >= '"') goto yy80; } } else { - if (yych <= '$') { - if (yych == '"') goto yy87; - if (yych >= '$') goto yy89; + if (yych <= '&') { + if (yych == '$') goto yy82; } else { - if (yych == '\'') goto yy90; - if (yych >= '-') goto yy91; + if (yych <= '\'') goto yy83; + if (yych <= ',') goto yy73; + if (yych <= '.') goto yy84; } } } else { - if (yych <= 'Z') { - if (yych <= '9') { - if (yych <= '.') goto yy92; - if (yych >= '0') goto yy93; + if (yych <= '[') { + if (yych <= ';') { + if (yych <= '9') goto yy85; + if (yych >= ';') goto yy78; } else { - if (yych == ';') goto yy85; - if (yych >= 'A') goto yy95; + if (yych <= '@') goto yy73; + if (yych <= 'Z') goto yy88; } } else { if (yych <= '^') { - if (yych <= '[') goto yy82; - if (yych <= '\\') goto yy97; - if (yych <= ']') goto yy98; + if (yych <= '\\') goto yy91; + if (yych <= ']') goto yy92; } else { - if (yych == '`') goto yy82; - if (yych <= 'z') goto yy95; + if (yych == '`') goto yy73; + if (yych <= 'z') goto yy88; } } } -yy82: - YYDEBUG(82, *YYCURSOR); +yy73: + YYDEBUG(73, *YYCURSOR); yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - goto yy101; -yy83: - YYDEBUG(83, *YYCURSOR); + YYMARKER = ++YYCURSOR; + YYFILL(1); + yych = *YYCURSOR; +yy74: + YYDEBUG(74, *YYCURSOR); + if (yybm[0+yych] & 4) { + goto yy73; + } + if (yych <= '"') goto yy75; + if (yych <= '$') goto yy94; + if (yych <= ';') goto yy75; + if (yych <= '\\') goto yy96; +yy75: + YYDEBUG(75, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 575 "Zend/zend_ini_scanner.l" { /* Get rest as section/offset value */ RETURN_TOKEN(TC_STRING, yytext, yyleng); } -#line 1343 "Zend/zend_ini_scanner.c" -yy84: - YYDEBUG(84, *YYCURSOR); +#line 1271 "Zend/zend_ini_scanner.c" +yy76: + YYDEBUG(76, *YYCURSOR); yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yybm[0+yych] & 128) { - goto yy127; + YYMARKER = ++YYCURSOR; + YYFILL(1); + yych = *YYCURSOR; + YYDEBUG(77, *YYCURSOR); + if (yybm[0+yych] & 8) { + goto yy76; } - if (yych == '"') goto yy129; - if (yych == ']') goto yy130; - goto yy101; -yy85: - YYDEBUG(85, *YYCURSOR); + if (yych <= '$') { + if (yych <= '\r') { + if (yych <= 0x08) goto yy73; + if (yych <= '\n') goto yy75; + if (yych <= '\f') goto yy73; + goto yy75; + } else { + if (yych == '"') goto yy80; + if (yych <= '#') goto yy73; + goto yy94; + } + } else { + if (yych <= ';') { + if (yych == '\'') goto yy75; + if (yych <= ':') goto yy73; + goto yy75; + } else { + if (yych <= '[') goto yy73; + if (yych <= '\\') goto yy96; + if (yych <= ']') goto yy92; + goto yy73; + } + } +yy78: + YYDEBUG(78, *YYCURSOR); ++YYCURSOR; -yy86: - YYDEBUG(86, *YYCURSOR); +yy79: + YYDEBUG(79, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 650 "Zend/zend_ini_scanner.l" { return 0; } -#line 1364 "Zend/zend_ini_scanner.c" -yy87: - YYDEBUG(87, *YYCURSOR); +#line 1315 "Zend/zend_ini_scanner.c" +yy80: + YYDEBUG(80, *YYCURSOR); ++YYCURSOR; -yy88: - YYDEBUG(88, *YYCURSOR); + YYDEBUG(81, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 579 "Zend/zend_ini_scanner.l" { /* Double quoted '"' string start */ yy_push_state(ST_DOUBLE_QUOTES); return '"'; } -#line 1376 "Zend/zend_ini_scanner.c" -yy89: - YYDEBUG(89, *YYCURSOR); +#line 1326 "Zend/zend_ini_scanner.c" +yy82: + YYDEBUG(82, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '\\') { - if (yych <= 0x00) goto yy86; - if (yych <= '[') goto yy100; - goto yy105; + if (yych <= 0x00) goto yy79; + if (yych <= '[') goto yy73; + goto yy97; } else { - if (yych == '{') goto yy125; - goto yy100; + if (yych == '{') goto yy99; + goto yy73; } -yy90: - YYDEBUG(90, *YYCURSOR); +yy83: + YYDEBUG(83, *YYCURSOR); yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); - if (yybm[0+yych] & 64) { - goto yy121; + if (yybm[0+yych] & 128) { + goto yy101; } - goto yy86; -yy91: - YYDEBUG(91, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy101; - if (yych <= '9') goto yy119; - goto yy101; -yy92: - YYDEBUG(92, *YYCURSOR); + goto yy79; +yy84: + YYDEBUG(84, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy101; - if (yych <= '9') goto yy117; - goto yy101; -yy93: - YYDEBUG(93, *YYCURSOR); + if (yych <= '/') goto yy74; + if (yych <= '9') goto yy103; + goto yy74; +yy85: + YYDEBUG(85, *YYCURSOR); yyaccept = 2; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '\'') { + YYMARKER = ++YYCURSOR; + YYFILL(1); + yych = *YYCURSOR; + YYDEBUG(86, *YYCURSOR); + if (yybm[0+yych] & 16) { + goto yy85; + } + if (yych <= '&') { if (yych <= '\r') { - if (yych == '\n') goto yy94; - if (yych <= '\f') goto yy101; + if (yych == '\n') goto yy87; + if (yych <= '\f') goto yy73; } else { - if (yych == '"') goto yy94; - if (yych <= '&') goto yy101; + if (yych <= '"') { + if (yych <= '!') goto yy73; + } else { + if (yych == '$') goto yy94; + goto yy73; + } } } else { - if (yych <= '9') { - if (yych == '.') goto yy113; - if (yych <= '/') goto yy101; - goto yy115; + if (yych <= ':') { + if (yych <= '\'') goto yy87; + if (yych == '.') goto yy103; + goto yy73; } else { - if (yych <= ';') { - if (yych <= ':') goto yy101; + if (yych <= '[') { + if (yych >= '<') goto yy73; } else { - if (yych != ']') goto yy101; + if (yych <= '\\') goto yy96; + if (yych >= '^') goto yy73; } } } -yy94: - YYDEBUG(94, *YYCURSOR); +yy87: + YYDEBUG(87, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 553 "Zend/zend_ini_scanner.l" { /* Get number option value as string */ RETURN_TOKEN(TC_NUMBER, yytext, yyleng); } -#line 1442 "Zend/zend_ini_scanner.c" -yy95: - YYDEBUG(95, *YYCURSOR); +#line 1396 "Zend/zend_ini_scanner.c" +yy88: + YYDEBUG(88, *YYCURSOR); yyaccept = 3; - yych = *(YYMARKER = ++YYCURSOR); - if (yybm[0+yych] & 16) { - goto yy111; + YYMARKER = ++YYCURSOR; + YYFILL(1); + yych = *YYCURSOR; + YYDEBUG(89, *YYCURSOR); + if (yybm[0+yych] & 32) { + goto yy88; } - if (yych <= '"') { - if (yych <= '\f') { - if (yych != '\n') goto yy101; + if (yych <= '$') { + if (yych <= '\r') { + if (yych == '\n') goto yy90; + if (yych <= '\f') goto yy73; } else { - if (yych <= '\r') goto yy96; - if (yych <= '!') goto yy101; + if (yych == '"') goto yy90; + if (yych <= '#') goto yy73; + goto yy94; } } else { - if (yych <= ':') { - if (yych != '\'') goto yy101; + if (yych <= ';') { + if (yych == '\'') goto yy90; + if (yych <= ':') goto yy73; } else { - if (yych <= ';') goto yy96; - if (yych != ']') goto yy101; + if (yych <= '[') goto yy73; + if (yych <= '\\') goto yy96; + if (yych >= '^') goto yy73; } } -yy96: - YYDEBUG(96, *YYCURSOR); +yy90: + YYDEBUG(90, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 549 "Zend/zend_ini_scanner.l" { /* Get constant option value */ RETURN_TOKEN(TC_CONSTANT, yytext, yyleng); } -#line 1472 "Zend/zend_ini_scanner.c" -yy97: - YYDEBUG(97, *YYCURSOR); +#line 1433 "Zend/zend_ini_scanner.c" +yy91: + YYDEBUG(91, *YYCURSOR); yych = *++YYCURSOR; - goto yy100; -yy98: - YYDEBUG(98, *YYCURSOR); + goto yy73; +yy92: + YYDEBUG(92, *YYCURSOR); ++YYCURSOR; -yy99: - YYDEBUG(99, *YYCURSOR); + YYDEBUG(93, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 446 "Zend/zend_ini_scanner.l" { /* End of section or an option offset */ BEGIN(INITIAL); return ']'; } -#line 1488 "Zend/zend_ini_scanner.c" -yy100: - YYDEBUG(100, *YYCURSOR); - yyaccept = 0; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; -yy101: - YYDEBUG(101, *YYCURSOR); - if (yybm[0+yych] & 2) { - goto yy100; - } - if (yych <= '"') goto yy83; - if (yych <= '$') goto yy103; - if (yych <= ';') goto yy83; - if (yych >= ']') goto yy83; -yy102: - YYDEBUG(102, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - goto yy100; -yy103: - YYDEBUG(103, *YYCURSOR); +#line 1448 "Zend/zend_ini_scanner.c" +yy94: + YYDEBUG(94, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; if (yych <= '\\') { - if (yych <= 0x00) goto yy104; - if (yych <= '[') goto yy100; - goto yy105; + if (yych <= 0x00) goto yy95; + if (yych <= '[') goto yy73; + goto yy97; } else { - if (yych != '{') goto yy100; + if (yych != '{') goto yy73; } -yy104: - YYDEBUG(104, *YYCURSOR); +yy95: + YYDEBUG(95, *YYCURSOR); YYCURSOR = YYMARKER; if (yyaccept <= 1) { if (yyaccept == 0) { - goto yy83; + goto yy75; } else { - goto yy86; + goto yy79; } } else { if (yyaccept == 2) { - goto yy94; + goto yy87; } else { - goto yy96; + goto yy90; } } -yy105: - YYDEBUG(105, *YYCURSOR); +yy96: + YYDEBUG(96, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - if (yybm[0+yych] & 4) { - goto yy106; - } - if (yych == '\\') goto yy108; - goto yy100; -yy106: - YYDEBUG(106, *YYCURSOR); + goto yy73; +yy97: + YYDEBUG(97, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(107, *YYCURSOR); - if (yybm[0+yych] & 4) { - goto yy106; + YYDEBUG(98, *YYCURSOR); + if (yybm[0+yych] & 64) { + goto yy97; } - if (yych == '\\') goto yy110; - goto yy100; -yy108: - YYDEBUG(108, *YYCURSOR); + goto yy73; +yy99: + YYDEBUG(99, *YYCURSOR); ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(109, *YYCURSOR); - if (yybm[0+yych] & 4) { - goto yy106; - } - if (yych == '\\') goto yy108; - goto yy100; -yy110: - YYDEBUG(110, *YYCURSOR); + YYDEBUG(100, *YYCURSOR); + yyleng = YYCURSOR - SCNG(yy_text); +#line 451 "Zend/zend_ini_scanner.l" + { /* Variable start */ + yy_push_state(ST_VARNAME); + return TC_DOLLAR_CURLY; +} +#line 1503 "Zend/zend_ini_scanner.c" +yy101: + YYDEBUG(101, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - if (yybm[0+yych] & 4) { - goto yy106; - } - if (yych == '\\') goto yy108; - goto yy100; -yy111: - YYDEBUG(111, *YYCURSOR); - yyaccept = 3; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(112, *YYCURSOR); - if (yybm[0+yych] & 16) { - goto yy111; - } - if (yych <= '$') { - if (yych <= '\r') { - if (yych == '\n') goto yy96; - if (yych <= '\f') goto yy100; - goto yy96; - } else { - if (yych == '"') goto yy96; - if (yych <= '#') goto yy100; - goto yy103; - } - } else { - if (yych <= ';') { - if (yych == '\'') goto yy96; - if (yych <= ':') goto yy100; - goto yy96; - } else { - if (yych <= '[') goto yy100; - if (yych <= '\\') goto yy102; - if (yych <= ']') goto yy96; - goto yy100; - } - } -yy113: - YYDEBUG(113, *YYCURSOR); - yyaccept = 2; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(114, *YYCURSOR); - if (yybm[0+yych] & 32) { - goto yy113; - } - if (yych <= '$') { - if (yych <= '\r') { - if (yych == '\n') goto yy94; - if (yych <= '\f') goto yy100; - goto yy94; - } else { - if (yych == '"') goto yy94; - if (yych <= '#') goto yy100; - goto yy103; - } - } else { - if (yych <= ';') { - if (yych == '\'') goto yy94; - if (yych <= ':') goto yy100; - goto yy94; - } else { - if (yych <= '[') goto yy100; - if (yych <= '\\') goto yy102; - if (yych <= ']') goto yy94; - goto yy100; - } - } -yy115: - YYDEBUG(115, *YYCURSOR); - yyaccept = 2; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(116, *YYCURSOR); - if (yych <= '\'') { - if (yych <= '!') { - if (yych <= '\n') { - if (yych <= '\t') goto yy100; - goto yy94; - } else { - if (yych == '\r') goto yy94; - goto yy100; - } - } else { - if (yych <= '#') { - if (yych <= '"') goto yy94; - goto yy100; - } else { - if (yych <= '$') goto yy103; - if (yych <= '&') goto yy100; - goto yy94; - } - } - } else { - if (yych <= ':') { - if (yych <= '.') { - if (yych <= '-') goto yy100; - goto yy113; - } else { - if (yych <= '/') goto yy100; - if (yych <= '9') goto yy115; - goto yy100; - } - } else { - if (yych <= '[') { - if (yych <= ';') goto yy94; - goto yy100; - } else { - if (yych <= '\\') goto yy102; - if (yych <= ']') goto yy94; - goto yy100; - } - } - } -yy117: - YYDEBUG(117, *YYCURSOR); - yyaccept = 2; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(118, *YYCURSOR); - if (yych <= '&') { - if (yych <= '\r') { - if (yych == '\n') goto yy94; - if (yych <= '\f') goto yy100; - goto yy94; - } else { - if (yych <= '"') { - if (yych <= '!') goto yy100; - goto yy94; - } else { - if (yych == '$') goto yy103; - goto yy100; - } - } - } else { - if (yych <= ':') { - if (yych <= '\'') goto yy94; - if (yych <= '/') goto yy100; - if (yych <= '9') goto yy117; - goto yy100; - } else { - if (yych <= '[') { - if (yych <= ';') goto yy94; - goto yy100; - } else { - if (yych <= '\\') goto yy102; - if (yych <= ']') goto yy94; - goto yy100; - } - } + YYDEBUG(102, *YYCURSOR); + if (yybm[0+yych] & 128) { + goto yy101; } -yy119: - YYDEBUG(119, *YYCURSOR); + goto yy105; +yy103: + YYDEBUG(103, *YYCURSOR); yyaccept = 2; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(120, *YYCURSOR); + YYDEBUG(104, *YYCURSOR); if (yych <= '&') { if (yych <= '\r') { - if (yych == '\n') goto yy94; - if (yych <= '\f') goto yy100; - goto yy94; + if (yych == '\n') goto yy87; + if (yych <= '\f') goto yy73; + goto yy87; } else { if (yych <= '"') { - if (yych <= '!') goto yy100; - goto yy94; + if (yych <= '!') goto yy73; + goto yy87; } else { - if (yych == '$') goto yy103; - goto yy100; + if (yych == '$') goto yy94; + goto yy73; } } } else { if (yych <= ':') { - if (yych <= '\'') goto yy94; - if (yych <= '/') goto yy100; - if (yych <= '9') goto yy119; - goto yy100; + if (yych <= '\'') goto yy87; + if (yych <= '/') goto yy73; + if (yych <= '9') goto yy103; + goto yy73; } else { if (yych <= '[') { - if (yych <= ';') goto yy94; - goto yy100; + if (yych <= ';') goto yy87; + goto yy73; } else { - if (yych <= '\\') goto yy102; - if (yych <= ']') goto yy94; - goto yy100; + if (yych <= '\\') goto yy96; + if (yych <= ']') goto yy87; + goto yy73; } } } -yy121: - YYDEBUG(121, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(122, *YYCURSOR); - if (yybm[0+yych] & 64) { - goto yy121; - } - YYDEBUG(123, *YYCURSOR); +yy105: + YYDEBUG(105, *YYCURSOR); ++YYCURSOR; - YYDEBUG(124, *YYCURSOR); + YYDEBUG(106, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 418 "Zend/zend_ini_scanner.l" { /* Raw string */ @@ -1785,134 +1562,81 @@ yy121: } RETURN_TOKEN(TC_RAW, yytext, yyleng); } -#line 1789 "Zend/zend_ini_scanner.c" -yy125: - YYDEBUG(125, *YYCURSOR); - ++YYCURSOR; - YYDEBUG(126, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 451 "Zend/zend_ini_scanner.l" - { /* Variable start */ - yy_push_state(ST_VARNAME); - return TC_DOLLAR_CURLY; -} -#line 1800 "Zend/zend_ini_scanner.c" -yy127: - YYDEBUG(127, *YYCURSOR); - yyaccept = 0; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(128, *YYCURSOR); - if (yybm[0+yych] & 128) { - goto yy127; - } - if (yych <= '$') { - if (yych <= '\r') { - if (yych <= 0x08) goto yy100; - if (yych <= '\n') goto yy83; - if (yych <= '\f') goto yy100; - goto yy83; - } else { - if (yych == '"') goto yy129; - if (yych <= '#') goto yy100; - goto yy103; - } - } else { - if (yych <= ';') { - if (yych == '\'') goto yy83; - if (yych <= ':') goto yy100; - goto yy83; - } else { - if (yych <= '[') goto yy100; - if (yych <= '\\') goto yy102; - if (yych <= ']') goto yy130; - goto yy100; - } - } -yy129: - YYDEBUG(129, *YYCURSOR); - yych = *++YYCURSOR; - goto yy88; -yy130: - YYDEBUG(130, *YYCURSOR); - ++YYCURSOR; - yych = *YYCURSOR; - goto yy99; +#line 1566 "Zend/zend_ini_scanner.c" } /* *********************************** */ yyc_ST_RAW: { static const unsigned char yybm[] = { - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 192, 0, 64, 64, 0, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 192, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 192, 0, 128, 128, 0, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 192, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, }; - YYDEBUG(131, *YYCURSOR); + YYDEBUG(107, *YYCURSOR); YYFILL(3); yych = *YYCURSOR; if (yych <= '\f') { if (yych <= 0x08) { - if (yych >= 0x01) goto yy135; + if (yych >= 0x01) goto yy111; } else { - if (yych <= '\t') goto yy137; - if (yych <= '\n') goto yy138; - goto yy135; + if (yych <= '\t') goto yy113; + if (yych <= '\n') goto yy114; + goto yy111; } } else { if (yych <= ' ') { - if (yych <= '\r') goto yy140; - if (yych <= 0x1F) goto yy135; - goto yy137; + if (yych <= '\r') goto yy116; + if (yych <= 0x1F) goto yy111; + goto yy113; } else { - if (yych == ';') goto yy141; - goto yy135; + if (yych == ';') goto yy117; + goto yy111; } } - YYDEBUG(133, *YYCURSOR); + YYDEBUG(109, *YYCURSOR); ++YYCURSOR; - YYDEBUG(134, *YYCURSOR); + YYDEBUG(110, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 645 "Zend/zend_ini_scanner.l" { /* End of option value (if EOF is reached before EOL */ BEGIN(INITIAL); return END_OF_LINE; } -#line 1911 "Zend/zend_ini_scanner.c" -yy135: - YYDEBUG(135, *YYCURSOR); +#line 1635 "Zend/zend_ini_scanner.c" +yy111: + YYDEBUG(111, *YYCURSOR); ++YYCURSOR; -yy136: - YYDEBUG(136, *YYCURSOR); +yy112: + YYDEBUG(112, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 502 "Zend/zend_ini_scanner.l" { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */ @@ -1951,30 +1675,29 @@ end_raw_value_chars: } RETURN_TOKEN(TC_RAW, yytext, yyleng); } -#line 1955 "Zend/zend_ini_scanner.c" -yy137: - YYDEBUG(137, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); +#line 1679 "Zend/zend_ini_scanner.c" +yy113: + YYDEBUG(113, *YYCURSOR); + yych = *++YYCURSOR; if (yych <= '\r') { - if (yych <= 0x08) goto yy136; - if (yych <= '\n') goto yy149; - if (yych <= '\f') goto yy136; - goto yy149; + if (yych <= 0x08) goto yy112; + if (yych <= '\n') goto yy119; + if (yych <= '\f') goto yy112; + goto yy119; } else { if (yych <= ' ') { - if (yych <= 0x1F) goto yy136; - goto yy149; + if (yych <= 0x1F) goto yy112; + goto yy119; } else { - if (yych == ';') goto yy149; - goto yy136; + if (yych == ';') goto yy119; + goto yy112; } } -yy138: - YYDEBUG(138, *YYCURSOR); +yy114: + YYDEBUG(114, *YYCURSOR); ++YYCURSOR; -yy139: - YYDEBUG(139, *YYCURSOR); +yy115: + YYDEBUG(115, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 543 "Zend/zend_ini_scanner.l" { /* End of option value */ @@ -1982,158 +1705,157 @@ yy139: SCNG(lineno)++; return END_OF_LINE; } -#line 1986 "Zend/zend_ini_scanner.c" -yy140: - YYDEBUG(140, *YYCURSOR); +#line 1709 "Zend/zend_ini_scanner.c" +yy116: + YYDEBUG(116, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '\n') goto yy147; - goto yy139; -yy141: - YYDEBUG(141, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - goto yy143; -yy142: - YYDEBUG(142, *YYCURSOR); + if (yych == '\n') goto yy114; + goto yy115; +yy117: + YYDEBUG(117, *YYCURSOR); + yych = *++YYCURSOR; + goto yy122; +yy118: + YYDEBUG(118, *YYCURSOR); ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; -yy143: - YYDEBUG(143, *YYCURSOR); +yy119: + YYDEBUG(119, *YYCURSOR); if (yybm[0+yych] & 64) { - goto yy142; - } - if (yych >= '\v') goto yy146; -yy144: - YYDEBUG(144, *YYCURSOR); - ++YYCURSOR; -yy145: - YYDEBUG(145, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 639 "Zend/zend_ini_scanner.l" - { /* Comment */ - BEGIN(INITIAL); - SCNG(lineno)++; - return END_OF_LINE; -} -#line 2020 "Zend/zend_ini_scanner.c" -yy146: - YYDEBUG(146, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '\n') goto yy144; - goto yy145; -yy147: - YYDEBUG(147, *YYCURSOR); - yych = *++YYCURSOR; - goto yy139; -yy148: - YYDEBUG(148, *YYCURSOR); - yyaccept = 2; - YYMARKER = ++YYCURSOR; - YYFILL(2); - yych = *YYCURSOR; -yy149: - YYDEBUG(149, *YYCURSOR); - if (yybm[0+yych] & 128) { - goto yy148; + goto yy118; } if (yych <= '\f') { - if (yych <= 0x08) goto yy150; - if (yych <= '\n') goto yy147; + if (yych <= 0x08) goto yy120; + if (yych <= '\n') goto yy114; } else { - if (yych <= '\r') goto yy151; - if (yych == ';') goto yy142; + if (yych <= '\r') goto yy116; + if (yych == ';') goto yy121; } -yy150: - YYDEBUG(150, *YYCURSOR); +yy120: + YYDEBUG(120, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 629 "Zend/zend_ini_scanner.l" { /* eat whitespace */ goto restart; } -#line 2056 "Zend/zend_ini_scanner.c" -yy151: - YYDEBUG(151, *YYCURSOR); +#line 1744 "Zend/zend_ini_scanner.c" +yy121: + YYDEBUG(121, *YYCURSOR); ++YYCURSOR; - if ((yych = *YYCURSOR) == '\n') goto yy147; - goto yy139; + YYFILL(2); + yych = *YYCURSOR; +yy122: + YYDEBUG(122, *YYCURSOR); + if (yybm[0+yych] & 128) { + goto yy121; + } + if (yych >= '\v') goto yy125; +yy123: + YYDEBUG(123, *YYCURSOR); + ++YYCURSOR; +yy124: + YYDEBUG(124, *YYCURSOR); + yyleng = YYCURSOR - SCNG(yy_text); +#line 639 "Zend/zend_ini_scanner.l" + { /* Comment */ + BEGIN(INITIAL); + SCNG(lineno)++; + return END_OF_LINE; +} +#line 1768 "Zend/zend_ini_scanner.c" +yy125: + YYDEBUG(125, *YYCURSOR); + ++YYCURSOR; + if ((yych = *YYCURSOR) == '\n') goto yy123; + goto yy124; } /* *********************************** */ yyc_ST_SECTION_RAW: { static const unsigned char yybm[] = { - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 192, 0, 128, 128, 0, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 192, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 0, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 192, 0, 64, 64, 0, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 192, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 0, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, }; - YYDEBUG(152, *YYCURSOR); - YYFILL(3); + YYDEBUG(126, *YYCURSOR); + YYFILL(1); yych = *YYCURSOR; - if (yych <= '\f') { - if (yych == '\n') goto yy156; - } else { - if (yych <= '\r') goto yy156; - if (yych == ']') goto yy158; + if (yybm[0+yych] & 64) { + goto yy128; } - YYDEBUG(154, *YYCURSOR); + if (yych <= '\r') goto yy131; + goto yy133; +yy128: + YYDEBUG(128, *YYCURSOR); ++YYCURSOR; + YYFILL(1); yych = *YYCURSOR; - goto yy165; -yy155: - YYDEBUG(155, *YYCURSOR); + YYDEBUG(129, *YYCURSOR); + if (yybm[0+yych] & 64) { + goto yy128; + } + YYDEBUG(130, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 539 "Zend/zend_ini_scanner.l" { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */ RETURN_TOKEN(TC_RAW, yytext, yyleng); } -#line 2120 "Zend/zend_ini_scanner.c" -yy156: - YYDEBUG(156, *YYCURSOR); +#line 1835 "Zend/zend_ini_scanner.c" +yy131: + YYDEBUG(131, *YYCURSOR); ++YYCURSOR; - YYDEBUG(157, *YYCURSOR); + YYDEBUG(132, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 650 "Zend/zend_ini_scanner.l" { return 0; } -#line 2130 "Zend/zend_ini_scanner.c" -yy158: - YYDEBUG(158, *YYCURSOR); +#line 1845 "Zend/zend_ini_scanner.c" +yy133: + YYDEBUG(133, *YYCURSOR); ++YYCURSOR; + YYFILL(2); yych = *YYCURSOR; - goto yy161; -yy159: - YYDEBUG(159, *YYCURSOR); + YYDEBUG(134, *YYCURSOR); + if (yybm[0+yych] & 128) { + goto yy133; + } + if (yych <= 0x08) goto yy135; + if (yych <= '\n') goto yy136; + if (yych == '\r') goto yy137; +yy135: + YYDEBUG(135, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 427 "Zend/zend_ini_scanner.l" { /* End of section */ @@ -2141,58 +1863,33 @@ yy159: SCNG(lineno)++; return ']'; } -#line 2145 "Zend/zend_ini_scanner.c" -yy160: - YYDEBUG(160, *YYCURSOR); - ++YYCURSOR; - YYFILL(2); - yych = *YYCURSOR; -yy161: - YYDEBUG(161, *YYCURSOR); - if (yybm[0+yych] & 64) { - goto yy160; - } - if (yych <= 0x08) goto yy159; - if (yych <= '\n') goto yy162; - if (yych == '\r') goto yy163; - goto yy159; -yy162: - YYDEBUG(162, *YYCURSOR); - yych = *++YYCURSOR; - goto yy159; -yy163: - YYDEBUG(163, *YYCURSOR); +#line 1867 "Zend/zend_ini_scanner.c" +yy136: + YYDEBUG(136, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '\n') goto yy162; - goto yy159; -yy164: - YYDEBUG(164, *YYCURSOR); + goto yy135; +yy137: + YYDEBUG(137, *YYCURSOR); ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; -yy165: - YYDEBUG(165, *YYCURSOR); - if (yybm[0+yych] & 128) { - goto yy164; - } - goto yy155; + if ((yych = *YYCURSOR) == '\n') goto yy136; + goto yy135; } /* *********************************** */ yyc_ST_SECTION_VALUE: { static const unsigned char yybm[] = { 132, 132, 132, 132, 132, 132, 132, 132, - 132, 134, 128, 132, 132, 128, 132, 132, + 132, 140, 128, 132, 132, 128, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, - 134, 132, 128, 132, 136, 132, 132, 0, + 140, 132, 128, 132, 192, 132, 132, 0, 132, 132, 132, 132, 132, 132, 132, 132, - 228, 228, 228, 228, 228, 228, 228, 228, - 228, 228, 132, 128, 132, 132, 132, 132, + 180, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 132, 128, 132, 132, 132, 132, 132, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, - 164, 164, 164, 132, 144, 128, 132, 164, + 164, 164, 164, 132, 192, 128, 132, 164, 132, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, @@ -2214,203 +1911,254 @@ yyc_ST_SECTION_VALUE: 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, }; - YYDEBUG(166, *YYCURSOR); - YYFILL(3); + YYDEBUG(138, *YYCURSOR); + YYFILL(2); yych = *YYCURSOR; - if (yych <= '-') { - if (yych <= ' ') { - if (yych <= '\n') { - if (yych <= 0x08) goto yy168; - if (yych <= '\t') goto yy170; - goto yy171; + if (yybm[0+yych] & 8) { + goto yy143; + } + if (yych <= '/') { + if (yych <= '"') { + if (yych <= '\f') { + if (yych <= 0x08) goto yy140; + if (yych <= '\n') goto yy145; } else { - if (yych == '\r') goto yy171; - if (yych >= ' ') goto yy170; + if (yych <= '\r') goto yy145; + if (yych >= '"') goto yy147; } } else { - if (yych <= '$') { - if (yych == '"') goto yy173; - if (yych >= '$') goto yy175; + if (yych <= '&') { + if (yych == '$') goto yy149; } else { - if (yych == '\'') goto yy176; - if (yych >= '-') goto yy177; + if (yych <= '\'') goto yy150; + if (yych <= ',') goto yy140; + if (yych <= '.') goto yy151; } } } else { - if (yych <= 'Z') { - if (yych <= '9') { - if (yych <= '.') goto yy178; - if (yych >= '0') goto yy179; + if (yych <= '[') { + if (yych <= ';') { + if (yych <= '9') goto yy152; + if (yych >= ';') goto yy145; } else { - if (yych == ';') goto yy171; - if (yych >= 'A') goto yy181; + if (yych <= '@') goto yy140; + if (yych <= 'Z') goto yy155; } } else { if (yych <= '^') { - if (yych <= '[') goto yy168; - if (yych <= '\\') goto yy183; - if (yych <= ']') goto yy184; + if (yych <= '\\') goto yy158; + if (yych <= ']') goto yy159; } else { - if (yych == '`') goto yy168; - if (yych <= 'z') goto yy181; + if (yych == '`') goto yy140; + if (yych <= 'z') goto yy155; } } } -yy168: - YYDEBUG(168, *YYCURSOR); +yy140: + YYDEBUG(140, *YYCURSOR); yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - goto yy191; -yy169: - YYDEBUG(169, *YYCURSOR); + YYMARKER = ++YYCURSOR; + YYFILL(1); + yych = *YYCURSOR; +yy141: + YYDEBUG(141, *YYCURSOR); + if (yybm[0+yych] & 4) { + goto yy140; + } + if (yych <= '"') goto yy142; + if (yych <= '$') goto yy162; + if (yych <= ';') goto yy142; + if (yych <= '\\') goto yy164; +yy142: + YYDEBUG(142, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 575 "Zend/zend_ini_scanner.l" { /* Get rest as section/offset value */ RETURN_TOKEN(TC_STRING, yytext, yyleng); } -#line 2272 "Zend/zend_ini_scanner.c" -yy170: - YYDEBUG(170, *YYCURSOR); +#line 1980 "Zend/zend_ini_scanner.c" +yy143: + YYDEBUG(143, *YYCURSOR); yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 0x1F) { - if (yych == '\t') goto yy217; - goto yy191; + YYMARKER = ++YYCURSOR; + YYFILL(1); + yych = *YYCURSOR; + YYDEBUG(144, *YYCURSOR); + if (yybm[0+yych] & 8) { + goto yy143; + } + if (yych <= '$') { + if (yych <= '\r') { + if (yych <= 0x08) goto yy140; + if (yych <= '\n') goto yy142; + if (yych <= '\f') goto yy140; + goto yy142; + } else { + if (yych == '"') goto yy147; + if (yych <= '#') goto yy140; + goto yy162; + } } else { - if (yych <= ' ') goto yy217; - if (yych == '"') goto yy219; - goto yy191; + if (yych <= ';') { + if (yych == '\'') goto yy142; + if (yych <= ':') goto yy140; + goto yy142; + } else { + if (yych <= '[') goto yy140; + if (yych <= '\\') goto yy164; + if (yych <= ']') goto yy142; + goto yy140; + } } -yy171: - YYDEBUG(171, *YYCURSOR); +yy145: + YYDEBUG(145, *YYCURSOR); ++YYCURSOR; -yy172: - YYDEBUG(172, *YYCURSOR); +yy146: + YYDEBUG(146, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 650 "Zend/zend_ini_scanner.l" { return 0; } -#line 2295 "Zend/zend_ini_scanner.c" -yy173: - YYDEBUG(173, *YYCURSOR); +#line 2024 "Zend/zend_ini_scanner.c" +yy147: + YYDEBUG(147, *YYCURSOR); ++YYCURSOR; -yy174: - YYDEBUG(174, *YYCURSOR); + YYDEBUG(148, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 579 "Zend/zend_ini_scanner.l" { /* Double quoted '"' string start */ yy_push_state(ST_DOUBLE_QUOTES); return '"'; } -#line 2307 "Zend/zend_ini_scanner.c" -yy175: - YYDEBUG(175, *YYCURSOR); +#line 2035 "Zend/zend_ini_scanner.c" +yy149: + YYDEBUG(149, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '\\') { - if (yych <= 0x00) goto yy172; - if (yych <= '[') goto yy190; - goto yy195; + if (yych <= 0x00) goto yy146; + if (yych <= '[') goto yy140; + goto yy165; } else { - if (yych == '{') goto yy215; - goto yy190; + if (yych == '{') goto yy167; + goto yy140; } -yy176: - YYDEBUG(176, *YYCURSOR); +yy150: + YYDEBUG(150, *YYCURSOR); yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 128) { - goto yy211; + goto yy169; } - goto yy172; -yy177: - YYDEBUG(177, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy191; - if (yych <= '9') goto yy209; - goto yy191; -yy178: - YYDEBUG(178, *YYCURSOR); + goto yy146; +yy151: + YYDEBUG(151, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy191; - if (yych <= '9') goto yy207; - goto yy191; -yy179: - YYDEBUG(179, *YYCURSOR); + if (yych <= '/') goto yy141; + if (yych <= '9') goto yy171; + goto yy141; +yy152: + YYDEBUG(152, *YYCURSOR); yyaccept = 2; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '\'') { + YYMARKER = ++YYCURSOR; + YYFILL(1); + yych = *YYCURSOR; + YYDEBUG(153, *YYCURSOR); + if (yybm[0+yych] & 16) { + goto yy152; + } + if (yych <= '&') { if (yych <= '\r') { - if (yych == '\n') goto yy180; - if (yych <= '\f') goto yy191; + if (yych == '\n') goto yy154; + if (yych <= '\f') goto yy140; } else { - if (yych == '"') goto yy180; - if (yych <= '&') goto yy191; + if (yych <= '"') { + if (yych <= '!') goto yy140; + } else { + if (yych == '$') goto yy162; + goto yy140; + } } } else { - if (yych <= '9') { - if (yych == '.') goto yy203; - if (yych <= '/') goto yy191; - goto yy205; + if (yych <= ':') { + if (yych <= '\'') goto yy154; + if (yych == '.') goto yy171; + goto yy140; } else { - if (yych <= ';') { - if (yych <= ':') goto yy191; + if (yych <= '[') { + if (yych >= '<') goto yy140; } else { - if (yych != ']') goto yy191; + if (yych <= '\\') goto yy164; + if (yych >= '^') goto yy140; } } } -yy180: - YYDEBUG(180, *YYCURSOR); +yy154: + YYDEBUG(154, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 553 "Zend/zend_ini_scanner.l" { /* Get number option value as string */ RETURN_TOKEN(TC_NUMBER, yytext, yyleng); } -#line 2373 "Zend/zend_ini_scanner.c" -yy181: - YYDEBUG(181, *YYCURSOR); +#line 2105 "Zend/zend_ini_scanner.c" +yy155: + YYDEBUG(155, *YYCURSOR); yyaccept = 3; - yych = *(YYMARKER = ++YYCURSOR); + YYMARKER = ++YYCURSOR; + YYFILL(1); + yych = *YYCURSOR; + YYDEBUG(156, *YYCURSOR); if (yybm[0+yych] & 32) { - goto yy201; + goto yy155; } - if (yych <= '"') { - if (yych <= '\f') { - if (yych != '\n') goto yy191; + if (yych <= '$') { + if (yych <= '\r') { + if (yych == '\n') goto yy157; + if (yych <= '\f') goto yy140; } else { - if (yych <= '\r') goto yy182; - if (yych <= '!') goto yy191; + if (yych == '"') goto yy157; + if (yych <= '#') goto yy140; + goto yy162; } } else { - if (yych <= ':') { - if (yych != '\'') goto yy191; + if (yych <= ';') { + if (yych == '\'') goto yy157; + if (yych <= ':') goto yy140; } else { - if (yych <= ';') goto yy182; - if (yych != ']') goto yy191; + if (yych <= '[') goto yy140; + if (yych <= '\\') goto yy164; + if (yych >= '^') goto yy140; } } -yy182: - YYDEBUG(182, *YYCURSOR); +yy157: + YYDEBUG(157, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 549 "Zend/zend_ini_scanner.l" { /* Get constant option value */ RETURN_TOKEN(TC_CONSTANT, yytext, yyleng); } -#line 2403 "Zend/zend_ini_scanner.c" -yy183: - YYDEBUG(183, *YYCURSOR); +#line 2142 "Zend/zend_ini_scanner.c" +yy158: + YYDEBUG(158, *YYCURSOR); yych = *++YYCURSOR; - goto yy190; -yy184: - YYDEBUG(184, *YYCURSOR); + goto yy140; +yy159: + YYDEBUG(159, *YYCURSOR); ++YYCURSOR; + YYFILL(2); yych = *YYCURSOR; - goto yy187; -yy185: - YYDEBUG(185, *YYCURSOR); + YYDEBUG(160, *YYCURSOR); + if (yych <= '\f') { + if (yych <= 0x08) goto yy161; + if (yych <= '\t') goto yy159; + if (yych <= '\n') goto yy173; + } else { + if (yych <= '\r') goto yy174; + if (yych == ' ') goto yy159; + } +yy161: + YYDEBUG(161, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 427 "Zend/zend_ini_scanner.l" { /* End of section */ @@ -2418,320 +2166,123 @@ yy185: SCNG(lineno)++; return ']'; } -#line 2422 "Zend/zend_ini_scanner.c" -yy186: - YYDEBUG(186, *YYCURSOR); - ++YYCURSOR; - YYFILL(2); - yych = *YYCURSOR; -yy187: - YYDEBUG(187, *YYCURSOR); - if (yybm[0+yych] & 2) { - goto yy186; - } - if (yych <= 0x08) goto yy185; - if (yych <= '\n') goto yy188; - if (yych == '\r') goto yy189; - goto yy185; -yy188: - YYDEBUG(188, *YYCURSOR); - yych = *++YYCURSOR; - goto yy185; -yy189: - YYDEBUG(189, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '\n') goto yy188; - goto yy185; -yy190: - YYDEBUG(190, *YYCURSOR); - yyaccept = 0; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; -yy191: - YYDEBUG(191, *YYCURSOR); - if (yybm[0+yych] & 4) { - goto yy190; - } - if (yych <= '"') goto yy169; - if (yych <= '$') goto yy193; - if (yych <= ';') goto yy169; - if (yych >= ']') goto yy169; -yy192: - YYDEBUG(192, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - goto yy190; -yy193: - YYDEBUG(193, *YYCURSOR); +#line 2170 "Zend/zend_ini_scanner.c" +yy162: + YYDEBUG(162, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; if (yych <= '\\') { - if (yych <= 0x00) goto yy194; - if (yych <= '[') goto yy190; - goto yy195; + if (yych <= 0x00) goto yy163; + if (yych <= '[') goto yy140; + goto yy165; } else { - if (yych != '{') goto yy190; + if (yych != '{') goto yy140; } -yy194: - YYDEBUG(194, *YYCURSOR); +yy163: + YYDEBUG(163, *YYCURSOR); YYCURSOR = YYMARKER; if (yyaccept <= 1) { if (yyaccept == 0) { - goto yy169; + goto yy142; } else { - goto yy172; + goto yy146; } } else { if (yyaccept == 2) { - goto yy180; + goto yy154; } else { - goto yy182; + goto yy157; } } -yy195: - YYDEBUG(195, *YYCURSOR); +yy164: + YYDEBUG(164, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - if (yybm[0+yych] & 8) { - goto yy196; - } - if (yych == '\\') goto yy198; - goto yy190; -yy196: - YYDEBUG(196, *YYCURSOR); + goto yy140; +yy165: + YYDEBUG(165, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(197, *YYCURSOR); - if (yybm[0+yych] & 8) { - goto yy196; + YYDEBUG(166, *YYCURSOR); + if (yybm[0+yych] & 64) { + goto yy165; } - if (yych == '\\') goto yy200; - goto yy190; -yy198: - YYDEBUG(198, *YYCURSOR); + goto yy140; +yy167: + YYDEBUG(167, *YYCURSOR); ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(199, *YYCURSOR); - if (yybm[0+yych] & 8) { - goto yy196; - } - if (yych == '\\') goto yy198; - goto yy190; -yy200: - YYDEBUG(200, *YYCURSOR); + YYDEBUG(168, *YYCURSOR); + yyleng = YYCURSOR - SCNG(yy_text); +#line 451 "Zend/zend_ini_scanner.l" + { /* Variable start */ + yy_push_state(ST_VARNAME); + return TC_DOLLAR_CURLY; +} +#line 2225 "Zend/zend_ini_scanner.c" +yy169: + YYDEBUG(169, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - if (yybm[0+yych] & 8) { - goto yy196; - } - if (yych == '\\') goto yy198; - goto yy190; -yy201: - YYDEBUG(201, *YYCURSOR); - yyaccept = 3; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(202, *YYCURSOR); - if (yybm[0+yych] & 32) { - goto yy201; - } - if (yych <= '$') { - if (yych <= '\r') { - if (yych == '\n') goto yy182; - if (yych <= '\f') goto yy190; - goto yy182; - } else { - if (yych == '"') goto yy182; - if (yych <= '#') goto yy190; - goto yy193; - } - } else { - if (yych <= ';') { - if (yych == '\'') goto yy182; - if (yych <= ':') goto yy190; - goto yy182; - } else { - if (yych <= '[') goto yy190; - if (yych <= '\\') goto yy192; - if (yych <= ']') goto yy182; - goto yy190; - } - } -yy203: - YYDEBUG(203, *YYCURSOR); - yyaccept = 2; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(204, *YYCURSOR); - if (yybm[0+yych] & 64) { - goto yy203; - } - if (yych <= '$') { - if (yych <= '\r') { - if (yych == '\n') goto yy180; - if (yych <= '\f') goto yy190; - goto yy180; - } else { - if (yych == '"') goto yy180; - if (yych <= '#') goto yy190; - goto yy193; - } - } else { - if (yych <= ';') { - if (yych == '\'') goto yy180; - if (yych <= ':') goto yy190; - goto yy180; - } else { - if (yych <= '[') goto yy190; - if (yych <= '\\') goto yy192; - if (yych <= ']') goto yy180; - goto yy190; - } - } -yy205: - YYDEBUG(205, *YYCURSOR); - yyaccept = 2; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(206, *YYCURSOR); - if (yych <= '\'') { - if (yych <= '!') { - if (yych <= '\n') { - if (yych <= '\t') goto yy190; - goto yy180; - } else { - if (yych == '\r') goto yy180; - goto yy190; - } - } else { - if (yych <= '#') { - if (yych <= '"') goto yy180; - goto yy190; - } else { - if (yych <= '$') goto yy193; - if (yych <= '&') goto yy190; - goto yy180; - } - } - } else { - if (yych <= ':') { - if (yych <= '.') { - if (yych <= '-') goto yy190; - goto yy203; - } else { - if (yych <= '/') goto yy190; - if (yych <= '9') goto yy205; - goto yy190; - } - } else { - if (yych <= '[') { - if (yych <= ';') goto yy180; - goto yy190; - } else { - if (yych <= '\\') goto yy192; - if (yych <= ']') goto yy180; - goto yy190; - } - } - } -yy207: - YYDEBUG(207, *YYCURSOR); - yyaccept = 2; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(208, *YYCURSOR); - if (yych <= '&') { - if (yych <= '\r') { - if (yych == '\n') goto yy180; - if (yych <= '\f') goto yy190; - goto yy180; - } else { - if (yych <= '"') { - if (yych <= '!') goto yy190; - goto yy180; - } else { - if (yych == '$') goto yy193; - goto yy190; - } - } - } else { - if (yych <= ':') { - if (yych <= '\'') goto yy180; - if (yych <= '/') goto yy190; - if (yych <= '9') goto yy207; - goto yy190; - } else { - if (yych <= '[') { - if (yych <= ';') goto yy180; - goto yy190; - } else { - if (yych <= '\\') goto yy192; - if (yych <= ']') goto yy180; - goto yy190; - } - } + YYDEBUG(170, *YYCURSOR); + if (yybm[0+yych] & 128) { + goto yy169; } -yy209: - YYDEBUG(209, *YYCURSOR); + goto yy175; +yy171: + YYDEBUG(171, *YYCURSOR); yyaccept = 2; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(210, *YYCURSOR); + YYDEBUG(172, *YYCURSOR); if (yych <= '&') { if (yych <= '\r') { - if (yych == '\n') goto yy180; - if (yych <= '\f') goto yy190; - goto yy180; + if (yych == '\n') goto yy154; + if (yych <= '\f') goto yy140; + goto yy154; } else { if (yych <= '"') { - if (yych <= '!') goto yy190; - goto yy180; + if (yych <= '!') goto yy140; + goto yy154; } else { - if (yych == '$') goto yy193; - goto yy190; + if (yych == '$') goto yy162; + goto yy140; } } } else { if (yych <= ':') { - if (yych <= '\'') goto yy180; - if (yych <= '/') goto yy190; - if (yych <= '9') goto yy209; - goto yy190; + if (yych <= '\'') goto yy154; + if (yych <= '/') goto yy140; + if (yych <= '9') goto yy171; + goto yy140; } else { if (yych <= '[') { - if (yych <= ';') goto yy180; - goto yy190; + if (yych <= ';') goto yy154; + goto yy140; } else { - if (yych <= '\\') goto yy192; - if (yych <= ']') goto yy180; - goto yy190; + if (yych <= '\\') goto yy164; + if (yych <= ']') goto yy154; + goto yy140; } } } -yy211: - YYDEBUG(211, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(212, *YYCURSOR); - if (yybm[0+yych] & 128) { - goto yy211; - } - YYDEBUG(213, *YYCURSOR); +yy173: + YYDEBUG(173, *YYCURSOR); + yych = *++YYCURSOR; + goto yy161; +yy174: + YYDEBUG(174, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == '\n') goto yy173; + goto yy161; +yy175: + YYDEBUG(175, *YYCURSOR); ++YYCURSOR; - YYDEBUG(214, *YYCURSOR); + YYDEBUG(176, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 418 "Zend/zend_ini_scanner.l" { /* Raw string */ @@ -2742,125 +2293,69 @@ yy211: } RETURN_TOKEN(TC_RAW, yytext, yyleng); } -#line 2746 "Zend/zend_ini_scanner.c" -yy215: - YYDEBUG(215, *YYCURSOR); - ++YYCURSOR; - YYDEBUG(216, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 451 "Zend/zend_ini_scanner.l" - { /* Variable start */ - yy_push_state(ST_VARNAME); - return TC_DOLLAR_CURLY; -} -#line 2757 "Zend/zend_ini_scanner.c" -yy217: - YYDEBUG(217, *YYCURSOR); - yyaccept = 0; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(218, *YYCURSOR); - if (yych <= '"') { - if (yych <= '\f') { - if (yych <= 0x08) goto yy190; - if (yych <= '\t') goto yy217; - if (yych <= '\n') goto yy169; - goto yy190; - } else { - if (yych <= 0x1F) { - if (yych <= '\r') goto yy169; - goto yy190; - } else { - if (yych <= ' ') goto yy217; - if (yych <= '!') goto yy190; - } - } - } else { - if (yych <= ':') { - if (yych <= '$') { - if (yych <= '#') goto yy190; - goto yy193; - } else { - if (yych == '\'') goto yy169; - goto yy190; - } - } else { - if (yych <= '[') { - if (yych <= ';') goto yy169; - goto yy190; - } else { - if (yych <= '\\') goto yy192; - if (yych <= ']') goto yy169; - goto yy190; - } - } - } -yy219: - YYDEBUG(219, *YYCURSOR); - ++YYCURSOR; - yych = *YYCURSOR; - goto yy174; +#line 2297 "Zend/zend_ini_scanner.c" } /* *********************************** */ yyc_ST_VALUE: { static const unsigned char yybm[] = { - 160, 162, 162, 162, 162, 162, 162, 162, - 162, 176, 128, 162, 162, 128, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 176, 160, 160, 162, 168, 162, 160, 32, - 160, 160, 162, 162, 162, 162, 162, 162, - 230, 230, 230, 230, 230, 230, 230, 230, - 230, 230, 162, 160, 162, 160, 162, 162, - 162, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 162, 162, 162, 160, 166, - 162, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 162, 160, 162, 160, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, + 96, 98, 98, 98, 98, 98, 98, 98, + 98, 100, 64, 98, 98, 64, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 100, 96, 96, 98, 224, 98, 96, 32, + 96, 96, 98, 98, 98, 98, 98, 98, + 122, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 98, 96, 98, 96, 98, 98, + 98, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 98, 98, 98, 96, 114, + 98, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 114, 114, 114, 114, 114, + 114, 114, 114, 98, 96, 98, 96, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 98, }; - YYDEBUG(220, *YYCURSOR); + YYDEBUG(177, *YYCURSOR); YYFILL(6); yych = *YYCURSOR; - YYDEBUG(-1, yych); + if (yybm[0+yych] & 4) { + goto yy184; + } switch (yych) { - case 0x00: goto yy222; + case 0x00: goto yy179; case '\t': - case ' ': goto yy226; - case '\n': goto yy228; - case '\r': goto yy230; + case '\n': goto yy187; + case '\r': goto yy189; + case ' ': case '!': case '&': case '(': case ')': case '^': case '|': - case '~': goto yy231; - case '"': goto yy233; - case '$': goto yy235; - case '\'': goto yy236; - case '-': goto yy237; - case '.': goto yy238; + case '~': goto yy190; + case '"': goto yy193; + case '$': goto yy195; + case '\'': goto yy196; + case '-': + case '.': goto yy197; case '0': case '1': case '2': @@ -2870,9 +2365,9 @@ yyc_ST_VALUE: case '6': case '7': case '8': - case '9': goto yy239; - case ';': goto yy241; - case '=': goto yy242; + case '9': goto yy198; + case ';': goto yy201; + case '=': goto yy202; case 'A': case 'B': case 'C': @@ -2915,62 +2410,86 @@ yyc_ST_VALUE: case 'v': case 'w': case 'x': - case 'z': goto yy244; + case 'z': goto yy204; case 'F': - case 'f': goto yy246; + case 'f': goto yy207; case 'N': - case 'n': goto yy247; + case 'n': goto yy208; case 'O': - case 'o': goto yy248; + case 'o': goto yy209; case 'T': - case 't': goto yy249; + case 't': goto yy210; case 'Y': - case 'y': goto yy250; - default: goto yy224; + case 'y': goto yy211; + default: goto yy181; } -yy222: - YYDEBUG(222, *YYCURSOR); +yy179: + YYDEBUG(179, *YYCURSOR); ++YYCURSOR; -yy223: - YYDEBUG(223, *YYCURSOR); +yy180: + YYDEBUG(180, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 645 "Zend/zend_ini_scanner.l" { /* End of option value (if EOF is reached before EOL */ BEGIN(INITIAL); return END_OF_LINE; } -#line 2943 "Zend/zend_ini_scanner.c" -yy224: - YYDEBUG(224, *YYCURSOR); +#line 2438 "Zend/zend_ini_scanner.c" +yy181: + YYDEBUG(181, *YYCURSOR); yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - goto yy252; -yy225: - YYDEBUG(225, *YYCURSOR); + YYMARKER = ++YYCURSOR; + YYFILL(1); + yych = *YYCURSOR; +yy182: + YYDEBUG(182, *YYCURSOR); + if (yybm[0+yych] & 2) { + goto yy181; + } + if (yych <= '"') goto yy183; + if (yych <= '$') goto yy212; +yy183: + YYDEBUG(183, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 571 "Zend/zend_ini_scanner.l" { /* Get everything else as option/offset value */ RETURN_TOKEN(TC_STRING, yytext, yyleng); } -#line 2956 "Zend/zend_ini_scanner.c" -yy226: - YYDEBUG(226, *YYCURSOR); +#line 2459 "Zend/zend_ini_scanner.c" +yy184: + YYDEBUG(184, *YYCURSOR); yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - goto yy306; -yy227: - YYDEBUG(227, *YYCURSOR); + YYMARKER = ++YYCURSOR; + YYFILL(2); + yych = *YYCURSOR; + YYDEBUG(185, *YYCURSOR); + if (yybm[0+yych] & 4) { + goto yy184; + } + if (yych <= '\r') { + if (yych <= 0x08) goto yy186; + if (yych <= '\n') goto yy187; + if (yych >= '\r') goto yy189; + } else { + if (yych <= '"') { + if (yych >= '"') goto yy193; + } else { + if (yych == ';') goto yy214; + } + } +yy186: + YYDEBUG(186, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 625 "Zend/zend_ini_scanner.l" { RETURN_TOKEN(TC_WHITESPACE, yytext, yyleng); } -#line 2969 "Zend/zend_ini_scanner.c" -yy228: - YYDEBUG(228, *YYCURSOR); +#line 2488 "Zend/zend_ini_scanner.c" +yy187: + YYDEBUG(187, *YYCURSOR); ++YYCURSOR; -yy229: - YYDEBUG(229, *YYCURSOR); +yy188: + YYDEBUG(188, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 543 "Zend/zend_ini_scanner.l" { /* End of option value */ @@ -2978,125 +2497,126 @@ yy229: SCNG(lineno)++; return END_OF_LINE; } -#line 2982 "Zend/zend_ini_scanner.c" -yy230: - YYDEBUG(230, *YYCURSOR); +#line 2501 "Zend/zend_ini_scanner.c" +yy189: + YYDEBUG(189, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '\n') goto yy304; - goto yy229; -yy231: - YYDEBUG(231, *YYCURSOR); + if (yych == '\n') goto yy187; + goto yy188; +yy190: + YYDEBUG(190, *YYCURSOR); ++YYCURSOR; + YYFILL(1); yych = *YYCURSOR; - goto yy303; -yy232: - YYDEBUG(232, *YYCURSOR); + YYDEBUG(191, *YYCURSOR); + if (yych == '\t') goto yy190; + if (yych == ' ') goto yy190; + YYDEBUG(192, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 561 "Zend/zend_ini_scanner.l" { /* Boolean operators */ return yytext[0]; } -#line 3000 "Zend/zend_ini_scanner.c" -yy233: - YYDEBUG(233, *YYCURSOR); +#line 2521 "Zend/zend_ini_scanner.c" +yy193: + YYDEBUG(193, *YYCURSOR); ++YYCURSOR; -yy234: - YYDEBUG(234, *YYCURSOR); + YYDEBUG(194, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 579 "Zend/zend_ini_scanner.l" { /* Double quoted '"' string start */ yy_push_state(ST_DOUBLE_QUOTES); return '"'; } -#line 3012 "Zend/zend_ini_scanner.c" -yy235: - YYDEBUG(235, *YYCURSOR); +#line 2532 "Zend/zend_ini_scanner.c" +yy195: + YYDEBUG(195, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '\\') { - if (yych <= 0x00) goto yy223; - if (yych <= '[') goto yy251; - goto yy258; + if (yych <= 0x00) goto yy180; + if (yych <= '[') goto yy181; + goto yy216; } else { - if (yych == '{') goto yy300; - goto yy251; + if (yych == '{') goto yy217; + goto yy181; } -yy236: - YYDEBUG(236, *YYCURSOR); +yy196: + YYDEBUG(196, *YYCURSOR); yyaccept = 2; yych = *(YYMARKER = ++YYCURSOR); - if (yybm[0+yych] & 128) { - goto yy296; + if (yybm[0+yych] & 64) { + goto yy219; } - goto yy223; -yy237: - YYDEBUG(237, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy252; - if (yych <= '9') goto yy294; - goto yy252; -yy238: - YYDEBUG(238, *YYCURSOR); + goto yy180; +yy197: + YYDEBUG(197, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy252; - if (yych <= '9') goto yy292; - goto yy252; -yy239: - YYDEBUG(239, *YYCURSOR); + if (yych <= '/') goto yy182; + if (yych <= '9') goto yy221; + goto yy182; +yy198: + YYDEBUG(198, *YYCURSOR); yyaccept = 3; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { + YYMARKER = ++YYCURSOR; + YYFILL(1); + yych = *YYCURSOR; + YYDEBUG(199, *YYCURSOR); + if (yybm[0+yych] & 8) { + goto yy198; + } + if (yych <= '-') { if (yych <= 0x1F) { if (yych <= '\n') { - if (yych <= 0x00) goto yy240; - if (yych <= 0x08) goto yy252; + if (yych <= 0x00) goto yy200; + if (yych <= 0x08) goto yy181; } else { - if (yych != '\r') goto yy252; + if (yych != '\r') goto yy181; } } else { - if (yych <= ')') { - if (yych <= '"') goto yy240; - if (yych <= '%') goto yy252; + if (yych <= '$') { + if (yych <= '"') goto yy200; + if (yych <= '#') goto yy181; + goto yy212; } else { - if (yych == '.') goto yy288; - goto yy252; + if (yych <= '%') goto yy181; + if (yych >= '*') goto yy181; } } } else { if (yych <= ']') { if (yych <= ';') { - if (yych <= '9') goto yy290; - if (yych <= ':') goto yy252; + if (yych <= '.') goto yy221; + if (yych <= ':') goto yy181; } else { - if (yych != '=') goto yy252; + if (yych != '=') goto yy181; } } else { if (yych <= '|') { - if (yych <= '^') goto yy240; - if (yych <= '{') goto yy252; + if (yych <= '^') goto yy200; + if (yych <= '{') goto yy181; } else { - if (yych != '~') goto yy252; + if (yych != '~') goto yy181; } } } -yy240: - YYDEBUG(240, *YYCURSOR); +yy200: + YYDEBUG(200, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 553 "Zend/zend_ini_scanner.l" { /* Get number option value as string */ RETURN_TOKEN(TC_NUMBER, yytext, yyleng); } -#line 3091 "Zend/zend_ini_scanner.c" -yy241: - YYDEBUG(241, *YYCURSOR); +#line 2611 "Zend/zend_ini_scanner.c" +yy201: + YYDEBUG(201, *YYCURSOR); yyaccept = 2; yych = *(YYMARKER = ++YYCURSOR); - goto yy284; -yy242: - YYDEBUG(242, *YYCURSOR); + goto yy215; +yy202: + YYDEBUG(202, *YYCURSOR); ++YYCURSOR; - YYDEBUG(243, *YYCURSOR); + YYDEBUG(203, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 565 "Zend/zend_ini_scanner.l" { /* Make = used in option value to trigger error */ @@ -3104,1517 +2624,1212 @@ yy242: BEGIN(INITIAL); return END_OF_LINE; } -#line 3108 "Zend/zend_ini_scanner.c" -yy244: - YYDEBUG(244, *YYCURSOR); +#line 2628 "Zend/zend_ini_scanner.c" +yy204: + YYDEBUG(204, *YYCURSOR); yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if (yybm[0+yych] & 4) { - goto yy253; + YYMARKER = ++YYCURSOR; + YYFILL(1); + yych = *YYCURSOR; + YYDEBUG(205, *YYCURSOR); + if (yybm[0+yych] & 16) { + goto yy204; } - if (yych <= ':') { + if (yych <= ')') { if (yych <= '\r') { if (yych <= 0x08) { - if (yych >= 0x01) goto yy252; + if (yych >= 0x01) goto yy181; } else { - if (yych <= '\n') goto yy245; - if (yych <= '\f') goto yy252; + if (yych <= '\n') goto yy206; + if (yych <= '\f') goto yy181; } } else { - if (yych <= '"') { - if (yych <= 0x1F) goto yy252; + if (yych <= '#') { + if (yych <= 0x1F) goto yy181; + if (yych >= '#') goto yy181; } else { - if (yych <= '%') goto yy252; - if (yych >= '*') goto yy252; + if (yych <= '$') goto yy212; + if (yych <= '%') goto yy181; } } } else { - if (yych <= '^') { - if (yych <= '<') { - if (yych >= '<') goto yy252; + if (yych <= ']') { + if (yych <= ';') { + if (yych <= ':') goto yy181; } else { - if (yych <= '=') goto yy245; - if (yych <= ']') goto yy252; + if (yych != '=') goto yy181; } } else { if (yych <= '|') { - if (yych <= '{') goto yy252; + if (yych <= '^') goto yy206; + if (yych <= '{') goto yy181; } else { - if (yych != '~') goto yy252; + if (yych != '~') goto yy181; } } } -yy245: - YYDEBUG(245, *YYCURSOR); +yy206: + YYDEBUG(206, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 549 "Zend/zend_ini_scanner.l" { /* Get constant option value */ RETURN_TOKEN(TC_CONSTANT, yytext, yyleng); } -#line 3155 "Zend/zend_ini_scanner.c" -yy246: - YYDEBUG(246, *YYCURSOR); +#line 2679 "Zend/zend_ini_scanner.c" +yy207: + YYDEBUG(207, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '<') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy245; - if (yych <= 0x08) goto yy252; - goto yy245; + if (yych <= 0x00) goto yy206; + if (yych <= 0x08) goto yy182; + goto yy206; } else { - if (yych == '\r') goto yy245; - if (yych <= 0x1F) goto yy252; - goto yy245; + if (yych == '\r') goto yy206; + if (yych <= 0x1F) goto yy182; + goto yy206; } } else { if (yych <= '/') { - if (yych <= '%') goto yy252; - if (yych <= ')') goto yy245; - goto yy252; + if (yych <= '%') goto yy182; + if (yych <= ')') goto yy206; + goto yy182; } else { - if (yych <= '9') goto yy253; - if (yych == ';') goto yy245; - goto yy252; + if (yych <= '9') goto yy204; + if (yych == ';') goto yy206; + goto yy182; } } } else { if (yych <= '_') { if (yych <= 'A') { - if (yych <= '=') goto yy245; - if (yych <= '@') goto yy252; - goto yy280; + if (yych <= '=') goto yy206; + if (yych <= '@') goto yy182; + goto yy226; } else { - if (yych <= 'Z') goto yy253; - if (yych <= ']') goto yy252; - if (yych <= '^') goto yy245; - goto yy253; + if (yych <= 'Z') goto yy204; + if (yych <= ']') goto yy182; + if (yych <= '^') goto yy206; + goto yy204; } } else { if (yych <= '{') { - if (yych <= '`') goto yy252; - if (yych <= 'a') goto yy280; - if (yych <= 'z') goto yy253; - goto yy252; + if (yych <= '`') goto yy182; + if (yych <= 'a') goto yy226; + if (yych <= 'z') goto yy204; + goto yy182; } else { - if (yych == '}') goto yy252; - if (yych <= '~') goto yy245; - goto yy252; + if (yych == '}') goto yy182; + if (yych <= '~') goto yy206; + goto yy182; } } } -yy247: - YYDEBUG(247, *YYCURSOR); +yy208: + YYDEBUG(208, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'N') { if (yych <= '%') { if (yych <= '\f') { - if (yych <= 0x00) goto yy245; - if (yych <= 0x08) goto yy252; - if (yych <= '\n') goto yy245; - goto yy252; + if (yych <= 0x00) goto yy206; + if (yych <= 0x08) goto yy182; + if (yych <= '\n') goto yy206; + goto yy182; } else { - if (yych <= '\r') goto yy245; - if (yych <= 0x1F) goto yy252; - if (yych <= '"') goto yy245; - goto yy252; + if (yych <= '\r') goto yy206; + if (yych <= 0x1F) goto yy182; + if (yych <= '"') goto yy206; + goto yy182; } } else { if (yych <= ':') { - if (yych <= ')') goto yy245; - if (yych <= '/') goto yy252; - if (yych <= '9') goto yy253; - goto yy252; + if (yych <= ')') goto yy206; + if (yych <= '/') goto yy182; + if (yych <= '9') goto yy204; + goto yy182; } else { if (yych <= '<') { - if (yych <= ';') goto yy245; - goto yy252; + if (yych <= ';') goto yy206; + goto yy182; } else { - if (yych <= '=') goto yy245; - if (yych <= '@') goto yy252; - goto yy253; + if (yych <= '=') goto yy206; + if (yych <= '@') goto yy182; + goto yy204; } } } } else { if (yych <= 'n') { if (yych <= 'Z') { - if (yych <= 'O') goto yy272; - if (yych == 'U') goto yy273; - goto yy253; + if (yych <= 'O') goto yy227; + if (yych == 'U') goto yy229; + goto yy204; } else { if (yych <= '^') { - if (yych <= ']') goto yy252; - goto yy245; + if (yych <= ']') goto yy182; + goto yy206; } else { - if (yych == '`') goto yy252; - goto yy253; + if (yych == '`') goto yy182; + goto yy204; } } } else { if (yych <= 'z') { - if (yych <= 'o') goto yy272; - if (yych == 'u') goto yy273; - goto yy253; + if (yych <= 'o') goto yy227; + if (yych == 'u') goto yy229; + goto yy204; } else { if (yych <= '|') { - if (yych <= '{') goto yy252; - goto yy245; + if (yych <= '{') goto yy182; + goto yy206; } else { - if (yych == '~') goto yy245; - goto yy252; + if (yych == '~') goto yy206; + goto yy182; } } } } -yy248: - YYDEBUG(248, *YYCURSOR); +yy209: + YYDEBUG(209, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'E') { if (yych <= '%') { if (yych <= '\f') { - if (yych <= 0x00) goto yy245; - if (yych <= 0x08) goto yy252; - if (yych <= '\n') goto yy245; - goto yy252; + if (yych <= 0x00) goto yy206; + if (yych <= 0x08) goto yy182; + if (yych <= '\n') goto yy206; + goto yy182; } else { - if (yych <= '\r') goto yy245; - if (yych <= 0x1F) goto yy252; - if (yych <= '"') goto yy245; - goto yy252; + if (yych <= '\r') goto yy206; + if (yych <= 0x1F) goto yy182; + if (yych <= '"') goto yy206; + goto yy182; } } else { if (yych <= ':') { - if (yych <= ')') goto yy245; - if (yych <= '/') goto yy252; - if (yych <= '9') goto yy253; - goto yy252; + if (yych <= ')') goto yy206; + if (yych <= '/') goto yy182; + if (yych <= '9') goto yy204; + goto yy182; } else { if (yych <= '<') { - if (yych <= ';') goto yy245; - goto yy252; + if (yych <= ';') goto yy206; + goto yy182; } else { - if (yych <= '=') goto yy245; - if (yych <= '@') goto yy252; - goto yy253; + if (yych <= '=') goto yy206; + if (yych <= '@') goto yy182; + goto yy204; } } } } else { if (yych <= 'e') { if (yych <= 'Z') { - if (yych <= 'F') goto yy267; - if (yych == 'N') goto yy261; - goto yy253; + if (yych <= 'F') goto yy230; + if (yych == 'N') goto yy231; + goto yy204; } else { if (yych <= '^') { - if (yych <= ']') goto yy252; - goto yy245; + if (yych <= ']') goto yy182; + goto yy206; } else { - if (yych == '`') goto yy252; - goto yy253; + if (yych == '`') goto yy182; + goto yy204; } } } else { if (yych <= 'z') { - if (yych <= 'f') goto yy267; - if (yych == 'n') goto yy261; - goto yy253; + if (yych <= 'f') goto yy230; + if (yych == 'n') goto yy231; + goto yy204; } else { if (yych <= '|') { - if (yych <= '{') goto yy252; - goto yy245; + if (yych <= '{') goto yy182; + goto yy206; } else { - if (yych == '~') goto yy245; - goto yy252; + if (yych == '~') goto yy206; + goto yy182; } } } } -yy249: - YYDEBUG(249, *YYCURSOR); - yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '=') { - if (yych <= '"') { - if (yych <= '\n') { - if (yych <= 0x00) goto yy245; - if (yych <= 0x08) goto yy252; - goto yy245; - } else { - if (yych == '\r') goto yy245; - if (yych <= 0x1F) goto yy252; - goto yy245; - } - } else { - if (yych <= '9') { - if (yych <= '%') goto yy252; - if (yych <= ')') goto yy245; - if (yych <= '/') goto yy252; - goto yy253; - } else { - if (yych == ';') goto yy245; - if (yych <= '<') goto yy252; - goto yy245; - } - } - } else { - if (yych <= '`') { - if (yych <= 'Z') { - if (yych <= '@') goto yy252; - if (yych == 'R') goto yy265; - goto yy253; - } else { - if (yych <= ']') goto yy252; - if (yych <= '^') goto yy245; - if (yych <= '_') goto yy253; - goto yy252; - } - } else { - if (yych <= '{') { - if (yych == 'r') goto yy265; - if (yych <= 'z') goto yy253; - goto yy252; - } else { - if (yych == '}') goto yy252; - if (yych <= '~') goto yy245; - goto yy252; - } - } - } -yy250: - YYDEBUG(250, *YYCURSOR); +yy210: + YYDEBUG(210, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy245; - if (yych <= 0x08) goto yy252; - goto yy245; + if (yych <= 0x00) goto yy206; + if (yych <= 0x08) goto yy182; + goto yy206; } else { - if (yych == '\r') goto yy245; - if (yych <= 0x1F) goto yy252; - goto yy245; + if (yych == '\r') goto yy206; + if (yych <= 0x1F) goto yy182; + goto yy206; } } else { if (yych <= '9') { - if (yych <= '%') goto yy252; - if (yych <= ')') goto yy245; - if (yych <= '/') goto yy252; - goto yy253; + if (yych <= '%') goto yy182; + if (yych <= ')') goto yy206; + if (yych <= '/') goto yy182; + goto yy204; } else { - if (yych == ';') goto yy245; - if (yych <= '<') goto yy252; - goto yy245; + if (yych == ';') goto yy206; + if (yych <= '<') goto yy182; + goto yy206; } } } else { if (yych <= '`') { if (yych <= 'Z') { - if (yych <= '@') goto yy252; - if (yych == 'E') goto yy255; - goto yy253; + if (yych <= '@') goto yy182; + if (yych == 'R') goto yy233; + goto yy204; } else { - if (yych <= ']') goto yy252; - if (yych <= '^') goto yy245; - if (yych <= '_') goto yy253; - goto yy252; + if (yych <= ']') goto yy182; + if (yych <= '^') goto yy206; + if (yych <= '_') goto yy204; + goto yy182; } } else { if (yych <= '{') { - if (yych == 'e') goto yy255; - if (yych <= 'z') goto yy253; - goto yy252; + if (yych == 'r') goto yy233; + if (yych <= 'z') goto yy204; + goto yy182; } else { - if (yych == '}') goto yy252; - if (yych <= '~') goto yy245; - goto yy252; + if (yych == '}') goto yy182; + if (yych <= '~') goto yy206; + goto yy182; } } } -yy251: - YYDEBUG(251, *YYCURSOR); - yyaccept = 0; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; -yy252: - YYDEBUG(252, *YYCURSOR); - if (yybm[0+yych] & 2) { - goto yy251; - } - if (yych <= '"') goto yy225; - if (yych <= '$') goto yy256; - goto yy225; -yy253: - YYDEBUG(253, *YYCURSOR); - yyaccept = 4; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(254, *YYCURSOR); - if (yybm[0+yych] & 4) { - goto yy253; - } - if (yych <= ')') { - if (yych <= '\r') { - if (yych <= 0x08) { - if (yych <= 0x00) goto yy245; - goto yy251; - } else { - if (yych <= '\n') goto yy245; - if (yych <= '\f') goto yy251; - goto yy245; - } - } else { - if (yych <= '#') { - if (yych <= 0x1F) goto yy251; - if (yych <= '"') goto yy245; - goto yy251; - } else { - if (yych <= '$') goto yy256; - if (yych <= '%') goto yy251; - goto yy245; - } - } - } else { - if (yych <= ']') { - if (yych <= ';') { - if (yych <= ':') goto yy251; - goto yy245; - } else { - if (yych == '=') goto yy245; - goto yy251; - } - } else { - if (yych <= '|') { - if (yych <= '^') goto yy245; - if (yych <= '{') goto yy251; - goto yy245; - } else { - if (yych == '~') goto yy245; - goto yy251; - } - } - } -yy255: - YYDEBUG(255, *YYCURSOR); +yy211: + YYDEBUG(211, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy245; - if (yych <= 0x08) goto yy252; - goto yy245; + if (yych <= 0x00) goto yy206; + if (yych <= 0x08) goto yy182; + goto yy206; } else { - if (yych == '\r') goto yy245; - if (yych <= 0x1F) goto yy252; - goto yy245; + if (yych == '\r') goto yy206; + if (yych <= 0x1F) goto yy182; + goto yy206; } } else { if (yych <= '9') { - if (yych <= '%') goto yy252; - if (yych <= ')') goto yy245; - if (yych <= '/') goto yy252; - goto yy253; + if (yych <= '%') goto yy182; + if (yych <= ')') goto yy206; + if (yych <= '/') goto yy182; + goto yy204; } else { - if (yych == ';') goto yy245; - if (yych <= '<') goto yy252; - goto yy245; + if (yych == ';') goto yy206; + if (yych <= '<') goto yy182; + goto yy206; } } } else { if (yych <= '`') { if (yych <= 'Z') { - if (yych <= '@') goto yy252; - if (yych == 'S') goto yy261; - goto yy253; + if (yych <= '@') goto yy182; + if (yych == 'E') goto yy234; + goto yy204; } else { - if (yych <= ']') goto yy252; - if (yych <= '^') goto yy245; - if (yych <= '_') goto yy253; - goto yy252; + if (yych <= ']') goto yy182; + if (yych <= '^') goto yy206; + if (yych <= '_') goto yy204; + goto yy182; } } else { if (yych <= '{') { - if (yych == 's') goto yy261; - if (yych <= 'z') goto yy253; - goto yy252; + if (yych == 'e') goto yy234; + if (yych <= 'z') goto yy204; + goto yy182; } else { - if (yych == '}') goto yy252; - if (yych <= '~') goto yy245; - goto yy252; + if (yych == '}') goto yy182; + if (yych <= '~') goto yy206; + goto yy182; } } } -yy256: - YYDEBUG(256, *YYCURSOR); +yy212: + YYDEBUG(212, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; if (yych <= '\\') { - if (yych <= 0x00) goto yy257; - if (yych <= '[') goto yy251; - goto yy258; + if (yych <= 0x00) goto yy213; + if (yych <= '[') goto yy181; + goto yy216; } else { - if (yych != '{') goto yy251; + if (yych != '{') goto yy181; } -yy257: - YYDEBUG(257, *YYCURSOR); +yy213: + YYDEBUG(213, *YYCURSOR); YYCURSOR = YYMARKER; if (yyaccept <= 3) { if (yyaccept <= 1) { if (yyaccept == 0) { - goto yy225; + goto yy183; } else { - goto yy227; + goto yy186; } } else { if (yyaccept == 2) { - goto yy223; + goto yy180; } else { - goto yy240; + goto yy200; } } } else { if (yyaccept <= 5) { if (yyaccept == 4) { - goto yy245; + goto yy206; } else { - goto yy262; + goto yy228; } } else { if (yyaccept == 6) { - goto yy269; + goto yy232; } else { - goto yy276; + goto yy249; } } } -yy258: - YYDEBUG(258, *YYCURSOR); +yy214: + YYDEBUG(214, *YYCURSOR); ++YYCURSOR; - YYFILL(1); + YYFILL(2); yych = *YYCURSOR; - if (yybm[0+yych] & 8) { - goto yy259; +yy215: + YYDEBUG(215, *YYCURSOR); + if (yybm[0+yych] & 32) { + goto yy214; } - goto yy251; -yy259: - YYDEBUG(259, *YYCURSOR); + if (yych <= '\n') goto yy223; + goto yy225; +yy216: + YYDEBUG(216, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(260, *YYCURSOR); - if (yybm[0+yych] & 8) { - goto yy259; - } - if (yych <= 0x00) goto yy225; - if (yych == '\\') goto yy258; - goto yy251; -yy261: - YYDEBUG(261, *YYCURSOR); - yyaccept = 5; - yych = *(YYMARKER = ++YYCURSOR); - if (yybm[0+yych] & 16) { - goto yy263; - } - if (yych <= ';') { - if (yych <= 0x1F) { - if (yych <= '\n') { - if (yych <= 0x00) goto yy262; - if (yych <= 0x08) goto yy252; - } else { - if (yych != '\r') goto yy252; - } - } else { - if (yych <= ')') { - if (yych <= '"') goto yy262; - if (yych <= '%') goto yy252; - } else { - if (yych <= '/') goto yy252; - if (yych <= '9') goto yy253; - if (yych <= ':') goto yy252; - } - } - } else { - if (yych <= '_') { - if (yych <= '@') { - if (yych != '=') goto yy252; - } else { - if (yych <= 'Z') goto yy253; - if (yych <= ']') goto yy252; - if (yych >= '_') goto yy253; - } - } else { - if (yych <= '{') { - if (yych <= '`') goto yy252; - if (yych <= 'z') goto yy253; - goto yy252; - } else { - if (yych == '}') goto yy252; - if (yych >= 0x7F) goto yy252; - } - } + if (yybm[0+yych] & 128) { + goto yy235; } -yy262: - YYDEBUG(262, *YYCURSOR); + goto yy181; +yy217: + YYDEBUG(217, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(218, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 471 "Zend/zend_ini_scanner.l" - { /* TRUE value (when used outside option value/offset this causes parse error!) */ - RETURN_TOKEN(BOOL_TRUE, "1", 1); +#line 451 "Zend/zend_ini_scanner.l" + { /* Variable start */ + yy_push_state(ST_VARNAME); + return TC_DOLLAR_CURLY; } -#line 3672 "Zend/zend_ini_scanner.c" -yy263: - YYDEBUG(263, *YYCURSOR); +#line 3038 "Zend/zend_ini_scanner.c" +yy219: + YYDEBUG(219, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(264, *YYCURSOR); - if (yybm[0+yych] & 16) { - goto yy263; - } - goto yy262; -yy265: - YYDEBUG(265, *YYCURSOR); - yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '=') { - if (yych <= '"') { - if (yych <= '\n') { - if (yych <= 0x00) goto yy245; - if (yych <= 0x08) goto yy252; - goto yy245; - } else { - if (yych == '\r') goto yy245; - if (yych <= 0x1F) goto yy252; - goto yy245; - } - } else { - if (yych <= '9') { - if (yych <= '%') goto yy252; - if (yych <= ')') goto yy245; - if (yych <= '/') goto yy252; - goto yy253; - } else { - if (yych == ';') goto yy245; - if (yych <= '<') goto yy252; - goto yy245; - } - } - } else { - if (yych <= '`') { - if (yych <= 'Z') { - if (yych <= '@') goto yy252; - if (yych != 'U') goto yy253; - } else { - if (yych <= ']') goto yy252; - if (yych <= '^') goto yy245; - if (yych <= '_') goto yy253; - goto yy252; - } - } else { - if (yych <= '{') { - if (yych == 'u') goto yy266; - if (yych <= 'z') goto yy253; - goto yy252; - } else { - if (yych == '}') goto yy252; - if (yych <= '~') goto yy245; - goto yy252; - } - } + YYDEBUG(220, *YYCURSOR); + if (yybm[0+yych] & 64) { + goto yy219; } -yy266: - YYDEBUG(266, *YYCURSOR); - yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '=') { - if (yych <= '"') { + goto yy237; +yy221: + YYDEBUG(221, *YYCURSOR); + yyaccept = 3; + YYMARKER = ++YYCURSOR; + YYFILL(1); + yych = *YYCURSOR; + YYDEBUG(222, *YYCURSOR); + if (yych <= '/') { + if (yych <= 0x1F) { if (yych <= '\n') { - if (yych <= 0x00) goto yy245; - if (yych <= 0x08) goto yy252; - goto yy245; + if (yych <= 0x00) goto yy200; + if (yych <= 0x08) goto yy181; + goto yy200; } else { - if (yych == '\r') goto yy245; - if (yych <= 0x1F) goto yy252; - goto yy245; + if (yych == '\r') goto yy200; + goto yy181; } } else { - if (yych <= '9') { - if (yych <= '%') goto yy252; - if (yych <= ')') goto yy245; - if (yych <= '/') goto yy252; - goto yy253; + if (yych <= '$') { + if (yych <= '"') goto yy200; + if (yych <= '#') goto yy181; + goto yy212; } else { - if (yych == ';') goto yy245; - if (yych <= '<') goto yy252; - goto yy245; + if (yych <= '%') goto yy181; + if (yych <= ')') goto yy200; + goto yy181; } } } else { - if (yych <= '`') { - if (yych <= 'Z') { - if (yych <= '@') goto yy252; - if (yych == 'E') goto yy261; - goto yy253; + if (yych <= ']') { + if (yych <= ';') { + if (yych <= '9') goto yy221; + if (yych <= ':') goto yy181; + goto yy200; } else { - if (yych <= ']') goto yy252; - if (yych <= '^') goto yy245; - if (yych <= '_') goto yy253; - goto yy252; + if (yych == '=') goto yy200; + goto yy181; } } else { - if (yych <= '{') { - if (yych == 'e') goto yy261; - if (yych <= 'z') goto yy253; - goto yy252; + if (yych <= '|') { + if (yych <= '^') goto yy200; + if (yych <= '{') goto yy181; + goto yy200; } else { - if (yych == '}') goto yy252; - if (yych <= '~') goto yy245; - goto yy252; + if (yych == '~') goto yy200; + goto yy181; } } } -yy267: - YYDEBUG(267, *YYCURSOR); +yy223: + YYDEBUG(223, *YYCURSOR); + ++YYCURSOR; +yy224: + YYDEBUG(224, *YYCURSOR); + yyleng = YYCURSOR - SCNG(yy_text); +#line 639 "Zend/zend_ini_scanner.l" + { /* Comment */ + BEGIN(INITIAL); + SCNG(lineno)++; + return END_OF_LINE; +} +#line 3110 "Zend/zend_ini_scanner.c" +yy225: + YYDEBUG(225, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == '\n') goto yy223; + goto yy224; +yy226: + YYDEBUG(226, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy245; - if (yych <= 0x08) goto yy252; - goto yy245; + if (yych <= 0x00) goto yy206; + if (yych <= 0x08) goto yy182; + goto yy206; } else { - if (yych == '\r') goto yy245; - if (yych <= 0x1F) goto yy252; - goto yy245; + if (yych == '\r') goto yy206; + if (yych <= 0x1F) goto yy182; + goto yy206; } } else { if (yych <= '9') { - if (yych <= '%') goto yy252; - if (yych <= ')') goto yy245; - if (yych <= '/') goto yy252; - goto yy253; + if (yych <= '%') goto yy182; + if (yych <= ')') goto yy206; + if (yych <= '/') goto yy182; + goto yy204; } else { - if (yych == ';') goto yy245; - if (yych <= '<') goto yy252; - goto yy245; + if (yych == ';') goto yy206; + if (yych <= '<') goto yy182; + goto yy206; } } } else { if (yych <= '`') { if (yych <= 'Z') { - if (yych <= '@') goto yy252; - if (yych != 'F') goto yy253; + if (yych <= '@') goto yy182; + if (yych == 'L') goto yy239; + goto yy204; } else { - if (yych <= ']') goto yy252; - if (yych <= '^') goto yy245; - if (yych <= '_') goto yy253; - goto yy252; + if (yych <= ']') goto yy182; + if (yych <= '^') goto yy206; + if (yych <= '_') goto yy204; + goto yy182; } } else { if (yych <= '{') { - if (yych == 'f') goto yy268; - if (yych <= 'z') goto yy253; - goto yy252; - } else { - if (yych == '}') goto yy252; - if (yych <= '~') goto yy245; - goto yy252; - } - } - } -yy268: - YYDEBUG(268, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yybm[0+yych] & 4) { - goto yy253; - } - if (yych <= ')') { - if (yych <= '\f') { - if (yych <= 0x08) { - if (yych >= 0x01) goto yy252; - } else { - if (yych <= '\t') goto yy270; - if (yych >= '\v') goto yy252; - } - } else { - if (yych <= ' ') { - if (yych <= '\r') goto yy269; - if (yych <= 0x1F) goto yy252; - goto yy270; - } else { - if (yych <= '"') goto yy269; - if (yych <= '%') goto yy252; - } - } - } else { - if (yych <= ']') { - if (yych <= ';') { - if (yych <= ':') goto yy252; - } else { - if (yych != '=') goto yy252; - } - } else { - if (yych <= '|') { - if (yych <= '^') goto yy269; - if (yych <= '{') goto yy252; + if (yych == 'l') goto yy239; + if (yych <= 'z') goto yy204; + goto yy182; } else { - if (yych != '~') goto yy252; + if (yych == '}') goto yy182; + if (yych <= '~') goto yy206; + goto yy182; } } } -yy269: - YYDEBUG(269, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 475 "Zend/zend_ini_scanner.l" - { /* FALSE value (when used outside option value/offset this causes parse error!)*/ - RETURN_TOKEN(BOOL_FALSE, "", 0); -} -#line 3882 "Zend/zend_ini_scanner.c" -yy270: - YYDEBUG(270, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(271, *YYCURSOR); - if (yych == '\t') goto yy270; - if (yych == ' ') goto yy270; - goto yy269; -yy272: - YYDEBUG(272, *YYCURSOR); - yyaccept = 6; +yy227: + YYDEBUG(227, *YYCURSOR); + yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '<') { if (yych <= ' ') { if (yych <= '\n') { - if (yych <= 0x00) goto yy269; - if (yych <= 0x08) goto yy252; - if (yych <= '\t') goto yy270; - goto yy269; + if (yych <= 0x00) goto yy228; + if (yych <= 0x08) goto yy182; + if (yych <= '\t') goto yy240; } else { - if (yych == '\r') goto yy269; - if (yych <= 0x1F) goto yy252; - goto yy270; + if (yych == '\r') goto yy228; + if (yych <= 0x1F) goto yy182; + goto yy240; } } else { if (yych <= '/') { - if (yych <= '"') goto yy269; - if (yych <= '%') goto yy252; - if (yych <= ')') goto yy269; - goto yy252; + if (yych <= '"') goto yy228; + if (yych <= '%') goto yy182; + if (yych >= '*') goto yy182; } else { - if (yych <= '9') goto yy253; - if (yych == ';') goto yy269; - goto yy252; + if (yych <= '9') goto yy204; + if (yych != ';') goto yy182; } } } else { if (yych <= '_') { if (yych <= 'N') { - if (yych <= '=') goto yy269; - if (yych <= '@') goto yy252; - if (yych <= 'M') goto yy253; - goto yy279; + if (yych <= '=') goto yy228; + if (yych <= '@') goto yy182; + if (yych <= 'M') goto yy204; + goto yy242; } else { - if (yych <= 'Z') goto yy253; - if (yych <= ']') goto yy252; - if (yych <= '^') goto yy269; - goto yy253; + if (yych <= 'Z') goto yy204; + if (yych <= ']') goto yy182; + if (yych >= '_') goto yy204; } } else { if (yych <= 'z') { - if (yych <= '`') goto yy252; - if (yych == 'n') goto yy279; - goto yy253; + if (yych <= '`') goto yy182; + if (yych == 'n') goto yy242; + goto yy204; } else { if (yych <= '|') { - if (yych <= '{') goto yy252; - goto yy269; + if (yych <= '{') goto yy182; } else { - if (yych == '~') goto yy269; - goto yy252; + if (yych != '~') goto yy182; } } } } -yy273: - YYDEBUG(273, *YYCURSOR); +yy228: + YYDEBUG(228, *YYCURSOR); + yyleng = YYCURSOR - SCNG(yy_text); +#line 475 "Zend/zend_ini_scanner.l" + { /* FALSE value (when used outside option value/offset this causes parse error!)*/ + RETURN_TOKEN(BOOL_FALSE, "", 0); +} +#line 3225 "Zend/zend_ini_scanner.c" +yy229: + YYDEBUG(229, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy245; - if (yych <= 0x08) goto yy252; - goto yy245; + if (yych <= 0x00) goto yy206; + if (yych <= 0x08) goto yy182; + goto yy206; } else { - if (yych == '\r') goto yy245; - if (yych <= 0x1F) goto yy252; - goto yy245; + if (yych == '\r') goto yy206; + if (yych <= 0x1F) goto yy182; + goto yy206; } } else { if (yych <= '9') { - if (yych <= '%') goto yy252; - if (yych <= ')') goto yy245; - if (yych <= '/') goto yy252; - goto yy253; + if (yych <= '%') goto yy182; + if (yych <= ')') goto yy206; + if (yych <= '/') goto yy182; + goto yy204; } else { - if (yych == ';') goto yy245; - if (yych <= '<') goto yy252; - goto yy245; + if (yych == ';') goto yy206; + if (yych <= '<') goto yy182; + goto yy206; } } } else { if (yych <= '`') { if (yych <= 'Z') { - if (yych <= '@') goto yy252; - if (yych != 'L') goto yy253; + if (yych <= '@') goto yy182; + if (yych == 'L') goto yy243; + goto yy204; } else { - if (yych <= ']') goto yy252; - if (yych <= '^') goto yy245; - if (yych <= '_') goto yy253; - goto yy252; + if (yych <= ']') goto yy182; + if (yych <= '^') goto yy206; + if (yych <= '_') goto yy204; + goto yy182; } } else { if (yych <= '{') { - if (yych == 'l') goto yy274; - if (yych <= 'z') goto yy253; - goto yy252; + if (yych == 'l') goto yy243; + if (yych <= 'z') goto yy204; + goto yy182; } else { - if (yych == '}') goto yy252; - if (yych <= '~') goto yy245; - goto yy252; + if (yych == '}') goto yy182; + if (yych <= '~') goto yy206; + goto yy182; } } } -yy274: - YYDEBUG(274, *YYCURSOR); +yy230: + YYDEBUG(230, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy245; - if (yych <= 0x08) goto yy252; - goto yy245; + if (yych <= 0x00) goto yy206; + if (yych <= 0x08) goto yy182; + goto yy206; } else { - if (yych == '\r') goto yy245; - if (yych <= 0x1F) goto yy252; - goto yy245; + if (yych == '\r') goto yy206; + if (yych <= 0x1F) goto yy182; + goto yy206; } } else { if (yych <= '9') { - if (yych <= '%') goto yy252; - if (yych <= ')') goto yy245; - if (yych <= '/') goto yy252; - goto yy253; + if (yych <= '%') goto yy182; + if (yych <= ')') goto yy206; + if (yych <= '/') goto yy182; + goto yy204; } else { - if (yych == ';') goto yy245; - if (yych <= '<') goto yy252; - goto yy245; + if (yych == ';') goto yy206; + if (yych <= '<') goto yy182; + goto yy206; } } } else { if (yych <= '`') { if (yych <= 'Z') { - if (yych <= '@') goto yy252; - if (yych != 'L') goto yy253; + if (yych <= '@') goto yy182; + if (yych == 'F') goto yy244; + goto yy204; } else { - if (yych <= ']') goto yy252; - if (yych <= '^') goto yy245; - if (yych <= '_') goto yy253; - goto yy252; + if (yych <= ']') goto yy182; + if (yych <= '^') goto yy206; + if (yych <= '_') goto yy204; + goto yy182; } } else { if (yych <= '{') { - if (yych == 'l') goto yy275; - if (yych <= 'z') goto yy253; - goto yy252; + if (yych == 'f') goto yy244; + if (yych <= 'z') goto yy204; + goto yy182; } else { - if (yych == '}') goto yy252; - if (yych <= '~') goto yy245; - goto yy252; + if (yych == '}') goto yy182; + if (yych <= '~') goto yy206; + goto yy182; } } } -yy275: - YYDEBUG(275, *YYCURSOR); - yyaccept = 7; +yy231: + YYDEBUG(231, *YYCURSOR); + yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); - if (yybm[0+yych] & 4) { - goto yy253; + if (yybm[0+yych] & 16) { + goto yy204; } if (yych <= ')') { if (yych <= '\f') { if (yych <= 0x08) { - if (yych >= 0x01) goto yy252; + if (yych >= 0x01) goto yy182; } else { - if (yych <= '\t') goto yy277; - if (yych >= '\v') goto yy252; + if (yych <= '\t') goto yy245; + if (yych >= '\v') goto yy182; } } else { if (yych <= ' ') { - if (yych <= '\r') goto yy276; - if (yych <= 0x1F) goto yy252; - goto yy277; + if (yych <= '\r') goto yy232; + if (yych <= 0x1F) goto yy182; + goto yy245; } else { - if (yych <= '"') goto yy276; - if (yych <= '%') goto yy252; + if (yych <= '"') goto yy232; + if (yych <= '%') goto yy182; } } } else { if (yych <= ']') { if (yych <= ';') { - if (yych <= ':') goto yy252; + if (yych <= ':') goto yy182; } else { - if (yych != '=') goto yy252; + if (yych != '=') goto yy182; } } else { if (yych <= '|') { - if (yych <= '^') goto yy276; - if (yych <= '{') goto yy252; + if (yych <= '^') goto yy232; + if (yych <= '{') goto yy182; } else { - if (yych != '~') goto yy252; + if (yych != '~') goto yy182; } } } -yy276: - YYDEBUG(276, *YYCURSOR); +yy232: + YYDEBUG(232, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 479 "Zend/zend_ini_scanner.l" - { - RETURN_TOKEN(NULL_NULL, "", 0); +#line 471 "Zend/zend_ini_scanner.l" + { /* TRUE value (when used outside option value/offset this causes parse error!) */ + RETURN_TOKEN(BOOL_TRUE, "1", 1); } -#line 4097 "Zend/zend_ini_scanner.c" -yy277: - YYDEBUG(277, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(278, *YYCURSOR); - if (yych == '\t') goto yy277; - if (yych == ' ') goto yy277; - goto yy276; -yy279: - YYDEBUG(279, *YYCURSOR); +#line 3376 "Zend/zend_ini_scanner.c" +yy233: + YYDEBUG(233, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy245; - if (yych <= 0x08) goto yy252; - goto yy245; + if (yych <= 0x00) goto yy206; + if (yych <= 0x08) goto yy182; + goto yy206; } else { - if (yych == '\r') goto yy245; - if (yych <= 0x1F) goto yy252; - goto yy245; + if (yych == '\r') goto yy206; + if (yych <= 0x1F) goto yy182; + goto yy206; } } else { if (yych <= '9') { - if (yych <= '%') goto yy252; - if (yych <= ')') goto yy245; - if (yych <= '/') goto yy252; - goto yy253; + if (yych <= '%') goto yy182; + if (yych <= ')') goto yy206; + if (yych <= '/') goto yy182; + goto yy204; } else { - if (yych == ';') goto yy245; - if (yych <= '<') goto yy252; - goto yy245; + if (yych == ';') goto yy206; + if (yych <= '<') goto yy182; + goto yy206; } } } else { if (yych <= '`') { if (yych <= 'Z') { - if (yych <= '@') goto yy252; - if (yych == 'E') goto yy268; - goto yy253; + if (yych <= '@') goto yy182; + if (yych == 'U') goto yy247; + goto yy204; } else { - if (yych <= ']') goto yy252; - if (yych <= '^') goto yy245; - if (yych <= '_') goto yy253; - goto yy252; + if (yych <= ']') goto yy182; + if (yych <= '^') goto yy206; + if (yych <= '_') goto yy204; + goto yy182; } } else { if (yych <= '{') { - if (yych == 'e') goto yy268; - if (yych <= 'z') goto yy253; - goto yy252; + if (yych == 'u') goto yy247; + if (yych <= 'z') goto yy204; + goto yy182; } else { - if (yych == '}') goto yy252; - if (yych <= '~') goto yy245; - goto yy252; + if (yych == '}') goto yy182; + if (yych <= '~') goto yy206; + goto yy182; } } } -yy280: - YYDEBUG(280, *YYCURSOR); +yy234: + YYDEBUG(234, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy245; - if (yych <= 0x08) goto yy252; - goto yy245; + if (yych <= 0x00) goto yy206; + if (yych <= 0x08) goto yy182; + goto yy206; } else { - if (yych == '\r') goto yy245; - if (yych <= 0x1F) goto yy252; - goto yy245; + if (yych == '\r') goto yy206; + if (yych <= 0x1F) goto yy182; + goto yy206; } } else { if (yych <= '9') { - if (yych <= '%') goto yy252; - if (yych <= ')') goto yy245; - if (yych <= '/') goto yy252; - goto yy253; + if (yych <= '%') goto yy182; + if (yych <= ')') goto yy206; + if (yych <= '/') goto yy182; + goto yy204; } else { - if (yych == ';') goto yy245; - if (yych <= '<') goto yy252; - goto yy245; + if (yych == ';') goto yy206; + if (yych <= '<') goto yy182; + goto yy206; } } } else { if (yych <= '`') { if (yych <= 'Z') { - if (yych <= '@') goto yy252; - if (yych != 'L') goto yy253; + if (yych <= '@') goto yy182; + if (yych == 'S') goto yy231; + goto yy204; } else { - if (yych <= ']') goto yy252; - if (yych <= '^') goto yy245; - if (yych <= '_') goto yy253; - goto yy252; + if (yych <= ']') goto yy182; + if (yych <= '^') goto yy206; + if (yych <= '_') goto yy204; + goto yy182; } } else { if (yych <= '{') { - if (yych == 'l') goto yy281; - if (yych <= 'z') goto yy253; - goto yy252; + if (yych == 's') goto yy231; + if (yych <= 'z') goto yy204; + goto yy182; } else { - if (yych == '}') goto yy252; - if (yych <= '~') goto yy245; - goto yy252; + if (yych == '}') goto yy182; + if (yych <= '~') goto yy206; + goto yy182; } } } -yy281: - YYDEBUG(281, *YYCURSOR); +yy235: + YYDEBUG(235, *YYCURSOR); + ++YYCURSOR; + YYFILL(1); + yych = *YYCURSOR; + YYDEBUG(236, *YYCURSOR); + if (yybm[0+yych] & 128) { + goto yy235; + } + if (yych <= 0x00) goto yy183; + if (yych == '\\') goto yy216; + goto yy181; +yy237: + YYDEBUG(237, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(238, *YYCURSOR); + yyleng = YYCURSOR - SCNG(yy_text); +#line 418 "Zend/zend_ini_scanner.l" + { /* Raw string */ + /* Eat leading and trailing single quotes */ + if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') { + SCNG(yy_text)++; + yyleng = yyleng - 2; + } + RETURN_TOKEN(TC_RAW, yytext, yyleng); +} +#line 3505 "Zend/zend_ini_scanner.c" +yy239: + YYDEBUG(239, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy245; - if (yych <= 0x08) goto yy252; - goto yy245; + if (yych <= 0x00) goto yy206; + if (yych <= 0x08) goto yy182; + goto yy206; } else { - if (yych == '\r') goto yy245; - if (yych <= 0x1F) goto yy252; - goto yy245; + if (yych == '\r') goto yy206; + if (yych <= 0x1F) goto yy182; + goto yy206; } } else { if (yych <= '9') { - if (yych <= '%') goto yy252; - if (yych <= ')') goto yy245; - if (yych <= '/') goto yy252; - goto yy253; + if (yych <= '%') goto yy182; + if (yych <= ')') goto yy206; + if (yych <= '/') goto yy182; + goto yy204; } else { - if (yych == ';') goto yy245; - if (yych <= '<') goto yy252; - goto yy245; + if (yych == ';') goto yy206; + if (yych <= '<') goto yy182; + goto yy206; } } } else { if (yych <= '`') { if (yych <= 'Z') { - if (yych <= '@') goto yy252; - if (yych != 'S') goto yy253; + if (yych <= '@') goto yy182; + if (yych == 'S') goto yy242; + goto yy204; } else { - if (yych <= ']') goto yy252; - if (yych <= '^') goto yy245; - if (yych <= '_') goto yy253; - goto yy252; + if (yych <= ']') goto yy182; + if (yych <= '^') goto yy206; + if (yych <= '_') goto yy204; + goto yy182; } } else { if (yych <= '{') { - if (yych == 's') goto yy282; - if (yych <= 'z') goto yy253; - goto yy252; + if (yych == 's') goto yy242; + if (yych <= 'z') goto yy204; + goto yy182; } else { - if (yych == '}') goto yy252; - if (yych <= '~') goto yy245; - goto yy252; + if (yych == '}') goto yy182; + if (yych <= '~') goto yy206; + goto yy182; } } } -yy282: - YYDEBUG(282, *YYCURSOR); +yy240: + YYDEBUG(240, *YYCURSOR); + ++YYCURSOR; + YYFILL(1); + yych = *YYCURSOR; + YYDEBUG(241, *YYCURSOR); + if (yych == '\t') goto yy240; + if (yych == ' ') goto yy240; + goto yy228; +yy242: + YYDEBUG(242, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy245; - if (yych <= 0x08) goto yy252; - goto yy245; + if (yych <= 0x00) goto yy206; + if (yych <= 0x08) goto yy182; + goto yy206; } else { - if (yych == '\r') goto yy245; - if (yych <= 0x1F) goto yy252; - goto yy245; + if (yych == '\r') goto yy206; + if (yych <= 0x1F) goto yy182; + goto yy206; } } else { if (yych <= '9') { - if (yych <= '%') goto yy252; - if (yych <= ')') goto yy245; - if (yych <= '/') goto yy252; - goto yy253; + if (yych <= '%') goto yy182; + if (yych <= ')') goto yy206; + if (yych <= '/') goto yy182; + goto yy204; } else { - if (yych == ';') goto yy245; - if (yych <= '<') goto yy252; - goto yy245; + if (yych == ';') goto yy206; + if (yych <= '<') goto yy182; + goto yy206; } } } else { if (yych <= '`') { if (yych <= 'Z') { - if (yych <= '@') goto yy252; - if (yych == 'E') goto yy268; - goto yy253; + if (yych <= '@') goto yy182; + if (yych == 'E') goto yy244; + goto yy204; } else { - if (yych <= ']') goto yy252; - if (yych <= '^') goto yy245; - if (yych <= '_') goto yy253; - goto yy252; + if (yych <= ']') goto yy182; + if (yych <= '^') goto yy206; + if (yych <= '_') goto yy204; + goto yy182; } } else { if (yych <= '{') { - if (yych == 'e') goto yy268; - if (yych <= 'z') goto yy253; - goto yy252; + if (yych == 'e') goto yy244; + if (yych <= 'z') goto yy204; + goto yy182; } else { - if (yych == '}') goto yy252; - if (yych <= '~') goto yy245; - goto yy252; + if (yych == '}') goto yy182; + if (yych <= '~') goto yy206; + goto yy182; } } } -yy283: - YYDEBUG(283, *YYCURSOR); - ++YYCURSOR; - YYFILL(2); - yych = *YYCURSOR; -yy284: - YYDEBUG(284, *YYCURSOR); - if (yybm[0+yych] & 32) { - goto yy283; - } - if (yych >= '\v') goto yy287; -yy285: - YYDEBUG(285, *YYCURSOR); - ++YYCURSOR; -yy286: - YYDEBUG(286, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 639 "Zend/zend_ini_scanner.l" - { /* Comment */ - BEGIN(INITIAL); - SCNG(lineno)++; - return END_OF_LINE; -} -#line 4332 "Zend/zend_ini_scanner.c" -yy287: - YYDEBUG(287, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '\n') goto yy285; - goto yy286; -yy288: - YYDEBUG(288, *YYCURSOR); - yyaccept = 3; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(289, *YYCURSOR); - if (yybm[0+yych] & 64) { - goto yy288; - } - if (yych <= ')') { - if (yych <= '\r') { - if (yych <= 0x08) { - if (yych <= 0x00) goto yy240; - goto yy251; +yy243: + YYDEBUG(243, *YYCURSOR); + yyaccept = 4; + yych = *(YYMARKER = ++YYCURSOR); + if (yych <= '=') { + if (yych <= '"') { + if (yych <= '\n') { + if (yych <= 0x00) goto yy206; + if (yych <= 0x08) goto yy182; + goto yy206; } else { - if (yych <= '\n') goto yy240; - if (yych <= '\f') goto yy251; - goto yy240; + if (yych == '\r') goto yy206; + if (yych <= 0x1F) goto yy182; + goto yy206; } } else { - if (yych <= '#') { - if (yych <= 0x1F) goto yy251; - if (yych <= '"') goto yy240; - goto yy251; + if (yych <= '9') { + if (yych <= '%') goto yy182; + if (yych <= ')') goto yy206; + if (yych <= '/') goto yy182; + goto yy204; } else { - if (yych <= '$') goto yy256; - if (yych <= '%') goto yy251; - goto yy240; + if (yych == ';') goto yy206; + if (yych <= '<') goto yy182; + goto yy206; } } } else { - if (yych <= ']') { - if (yych <= ';') { - if (yych <= ':') goto yy251; - goto yy240; + if (yych <= '`') { + if (yych <= 'Z') { + if (yych <= '@') goto yy182; + if (yych == 'L') goto yy248; + goto yy204; } else { - if (yych == '=') goto yy240; - goto yy251; + if (yych <= ']') goto yy182; + if (yych <= '^') goto yy206; + if (yych <= '_') goto yy204; + goto yy182; } } else { - if (yych <= '|') { - if (yych <= '^') goto yy240; - if (yych <= '{') goto yy251; - goto yy240; + if (yych <= '{') { + if (yych == 'l') goto yy248; + if (yych <= 'z') goto yy204; + goto yy182; } else { - if (yych == '~') goto yy240; - goto yy251; + if (yych == '}') goto yy182; + if (yych <= '~') goto yy206; + goto yy182; } } } -yy290: - YYDEBUG(290, *YYCURSOR); - yyaccept = 3; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(291, *YYCURSOR); - if (yych <= '.') { - if (yych <= 0x1F) { - if (yych <= '\n') { - if (yych <= 0x00) goto yy240; - if (yych <= 0x08) goto yy251; - goto yy240; +yy244: + YYDEBUG(244, *YYCURSOR); + yyaccept = 5; + yych = *(YYMARKER = ++YYCURSOR); + if (yybm[0+yych] & 16) { + goto yy204; + } + if (yych <= ')') { + if (yych <= '\f') { + if (yych <= 0x08) { + if (yych <= 0x00) goto yy228; + goto yy182; } else { - if (yych == '\r') goto yy240; - goto yy251; + if (yych <= '\t') goto yy240; + if (yych <= '\n') goto yy228; + goto yy182; } } else { - if (yych <= '$') { - if (yych <= '"') goto yy240; - if (yych <= '#') goto yy251; - goto yy256; + if (yych <= ' ') { + if (yych <= '\r') goto yy228; + if (yych <= 0x1F) goto yy182; + goto yy240; } else { - if (yych <= '%') goto yy251; - if (yych <= ')') goto yy240; - if (yych <= '-') goto yy251; - goto yy288; + if (yych <= '"') goto yy228; + if (yych <= '%') goto yy182; + goto yy228; } } } else { - if (yych <= '=') { - if (yych <= ':') { - if (yych <= '/') goto yy251; - if (yych <= '9') goto yy290; - goto yy251; + if (yych <= ']') { + if (yych <= ';') { + if (yych <= ':') goto yy182; + goto yy228; } else { - if (yych == '<') goto yy251; - goto yy240; + if (yych == '=') goto yy228; + goto yy182; } } else { - if (yych <= '{') { - if (yych == '^') goto yy240; - goto yy251; + if (yych <= '|') { + if (yych <= '^') goto yy228; + if (yych <= '{') goto yy182; + goto yy228; } else { - if (yych == '}') goto yy251; - if (yych <= '~') goto yy240; - goto yy251; + if (yych == '~') goto yy228; + goto yy182; } } } -yy292: - YYDEBUG(292, *YYCURSOR); - yyaccept = 3; - YYMARKER = ++YYCURSOR; +yy245: + YYDEBUG(245, *YYCURSOR); + ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(293, *YYCURSOR); - if (yych <= '/') { - if (yych <= 0x1F) { + YYDEBUG(246, *YYCURSOR); + if (yych == '\t') goto yy245; + if (yych == ' ') goto yy245; + goto yy232; +yy247: + YYDEBUG(247, *YYCURSOR); + yyaccept = 4; + yych = *(YYMARKER = ++YYCURSOR); + if (yych <= '=') { + if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy240; - if (yych <= 0x08) goto yy251; - goto yy240; + if (yych <= 0x00) goto yy206; + if (yych <= 0x08) goto yy182; + goto yy206; } else { - if (yych == '\r') goto yy240; - goto yy251; + if (yych == '\r') goto yy206; + if (yych <= 0x1F) goto yy182; + goto yy206; } } else { - if (yych <= '$') { - if (yych <= '"') goto yy240; - if (yych <= '#') goto yy251; - goto yy256; + if (yych <= '9') { + if (yych <= '%') goto yy182; + if (yych <= ')') goto yy206; + if (yych <= '/') goto yy182; + goto yy204; } else { - if (yych <= '%') goto yy251; - if (yych <= ')') goto yy240; - goto yy251; + if (yych == ';') goto yy206; + if (yych <= '<') goto yy182; + goto yy206; } } } else { - if (yych <= ']') { - if (yych <= ';') { - if (yych <= '9') goto yy292; - if (yych <= ':') goto yy251; - goto yy240; + if (yych <= '`') { + if (yych <= 'Z') { + if (yych <= '@') goto yy182; + if (yych == 'E') goto yy231; + goto yy204; } else { - if (yych == '=') goto yy240; - goto yy251; + if (yych <= ']') goto yy182; + if (yych <= '^') goto yy206; + if (yych <= '_') goto yy204; + goto yy182; } } else { - if (yych <= '|') { - if (yych <= '^') goto yy240; - if (yych <= '{') goto yy251; - goto yy240; + if (yych <= '{') { + if (yych == 'e') goto yy231; + if (yych <= 'z') goto yy204; + goto yy182; } else { - if (yych == '~') goto yy240; - goto yy251; + if (yych == '}') goto yy182; + if (yych <= '~') goto yy206; + goto yy182; } } } -yy294: - YYDEBUG(294, *YYCURSOR); - yyaccept = 3; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(295, *YYCURSOR); - if (yych <= '/') { - if (yych <= 0x1F) { - if (yych <= '\n') { - if (yych <= 0x00) goto yy240; - if (yych <= 0x08) goto yy251; - goto yy240; +yy248: + YYDEBUG(248, *YYCURSOR); + yyaccept = 7; + yych = *(YYMARKER = ++YYCURSOR); + if (yybm[0+yych] & 16) { + goto yy204; + } + if (yych <= ')') { + if (yych <= '\f') { + if (yych <= 0x08) { + if (yych >= 0x01) goto yy182; } else { - if (yych == '\r') goto yy240; - goto yy251; + if (yych <= '\t') goto yy250; + if (yych >= '\v') goto yy182; } } else { - if (yych <= '$') { - if (yych <= '"') goto yy240; - if (yych <= '#') goto yy251; - goto yy256; + if (yych <= ' ') { + if (yych <= '\r') goto yy249; + if (yych <= 0x1F) goto yy182; + goto yy250; } else { - if (yych <= '%') goto yy251; - if (yych <= ')') goto yy240; - goto yy251; + if (yych <= '"') goto yy249; + if (yych <= '%') goto yy182; } } } else { if (yych <= ']') { if (yych <= ';') { - if (yych <= '9') goto yy294; - if (yych <= ':') goto yy251; - goto yy240; + if (yych <= ':') goto yy182; } else { - if (yych == '=') goto yy240; - goto yy251; + if (yych != '=') goto yy182; } } else { if (yych <= '|') { - if (yych <= '^') goto yy240; - if (yych <= '{') goto yy251; - goto yy240; + if (yych <= '^') goto yy249; + if (yych <= '{') goto yy182; } else { - if (yych == '~') goto yy240; - goto yy251; + if (yych != '~') goto yy182; } } } -yy296: - YYDEBUG(296, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(297, *YYCURSOR); - if (yybm[0+yych] & 128) { - goto yy296; - } - YYDEBUG(298, *YYCURSOR); - ++YYCURSOR; - YYDEBUG(299, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 418 "Zend/zend_ini_scanner.l" - { /* Raw string */ - /* Eat leading and trailing single quotes */ - if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') { - SCNG(yy_text)++; - yyleng = yyleng - 2; - } - RETURN_TOKEN(TC_RAW, yytext, yyleng); -} -#line 4559 "Zend/zend_ini_scanner.c" -yy300: - YYDEBUG(300, *YYCURSOR); - ++YYCURSOR; - YYDEBUG(301, *YYCURSOR); +yy249: + YYDEBUG(249, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 451 "Zend/zend_ini_scanner.l" - { /* Variable start */ - yy_push_state(ST_VARNAME); - return TC_DOLLAR_CURLY; +#line 479 "Zend/zend_ini_scanner.l" + { + RETURN_TOKEN(NULL_NULL, "", 0); } -#line 4570 "Zend/zend_ini_scanner.c" -yy302: - YYDEBUG(302, *YYCURSOR); +#line 3824 "Zend/zend_ini_scanner.c" +yy250: + YYDEBUG(250, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy303: - YYDEBUG(303, *YYCURSOR); - if (yych == '\t') goto yy302; - if (yych == ' ') goto yy302; - goto yy232; -yy304: - YYDEBUG(304, *YYCURSOR); - yych = *++YYCURSOR; - goto yy229; -yy305: - YYDEBUG(305, *YYCURSOR); - yyaccept = 1; - YYMARKER = ++YYCURSOR; - YYFILL(2); - yych = *YYCURSOR; -yy306: - YYDEBUG(306, *YYCURSOR); - if (yych <= 0x1F) { - if (yych <= '\n') { - if (yych <= 0x08) goto yy227; - if (yych <= '\t') goto yy305; - goto yy304; - } else { - if (yych == '\r') goto yy308; - goto yy227; - } - } else { - if (yych <= '"') { - if (yych <= ' ') goto yy305; - if (yych <= '!') goto yy227; - } else { - if (yych == ';') goto yy283; - goto yy227; - } - } - YYDEBUG(307, *YYCURSOR); - yych = *++YYCURSOR; - goto yy234; -yy308: - YYDEBUG(308, *YYCURSOR); - ++YYCURSOR; - if ((yych = *YYCURSOR) == '\n') goto yy304; - goto yy229; + YYDEBUG(251, *YYCURSOR); + if (yych == '\t') goto yy250; + if (yych == ' ') goto yy250; + goto yy249; } /* *********************************** */ yyc_ST_VARNAME: @@ -4653,49 +3868,24 @@ yyc_ST_VARNAME: 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, }; - YYDEBUG(309, *YYCURSOR); - YYFILL(2); + YYDEBUG(252, *YYCURSOR); + YYFILL(1); yych = *YYCURSOR; - if (yych <= ')') { - if (yych <= '"') { - if (yych <= '\f') { - if (yych <= 0x08) goto yy311; - if (yych <= '\n') goto yy313; - } else { - if (yych <= '\r') goto yy313; - if (yych >= '!') goto yy313; - } - } else { - if (yych <= '%') { - if (yych == '$') goto yy313; - } else { - if (yych != '\'') goto yy313; - } - } - } else { - if (yych <= '[') { - if (yych <= '<') { - if (yych == ';') goto yy313; - } else { - if (yych <= '=') goto yy313; - if (yych >= '[') goto yy313; - } - } else { - if (yych <= 'z') { - if (yych == '^') goto yy313; - } else { - if (yych == '}') goto yy315; - if (yych <= '~') goto yy313; - } - } + if (yybm[0+yych] & 128) { + goto yy254; } -yy311: - YYDEBUG(311, *YYCURSOR); + if (yych == '}') goto yy259; + goto yy257; +yy254: + YYDEBUG(254, *YYCURSOR); ++YYCURSOR; + YYFILL(1); yych = *YYCURSOR; - goto yy318; -yy312: - YYDEBUG(312, *YYCURSOR); + YYDEBUG(255, *YYCURSOR); + if (yybm[0+yych] & 128) { + goto yy254; + } + YYDEBUG(256, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 456 "Zend/zend_ini_scanner.l" { /* Variable name */ @@ -4707,39 +3897,28 @@ yy312: RETURN_TOKEN(TC_VARNAME, yytext, yyleng); } -#line 4711 "Zend/zend_ini_scanner.c" -yy313: - YYDEBUG(313, *YYCURSOR); +#line 3901 "Zend/zend_ini_scanner.c" +yy257: + YYDEBUG(257, *YYCURSOR); ++YYCURSOR; - YYDEBUG(314, *YYCURSOR); + YYDEBUG(258, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 650 "Zend/zend_ini_scanner.l" { return 0; } -#line 4721 "Zend/zend_ini_scanner.c" -yy315: - YYDEBUG(315, *YYCURSOR); +#line 3911 "Zend/zend_ini_scanner.c" +yy259: + YYDEBUG(259, *YYCURSOR); ++YYCURSOR; - YYDEBUG(316, *YYCURSOR); + YYDEBUG(260, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 466 "Zend/zend_ini_scanner.l" { /* Variable end */ yy_pop_state(); return '}'; } -#line 4732 "Zend/zend_ini_scanner.c" -yy317: - YYDEBUG(317, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; -yy318: - YYDEBUG(318, *YYCURSOR); - if (yybm[0+yych] & 128) { - goto yy317; - } - goto yy312; +#line 3922 "Zend/zend_ini_scanner.c" } } #line 654 "Zend/zend_ini_scanner.l" diff --git a/Zend/zend_ini_scanner.l b/Zend/zend_ini_scanner.l index 06c58c9c36..2fa7d3ac1a 100644 --- a/Zend/zend_ini_scanner.l +++ b/Zend/zend_ini_scanner.l @@ -408,9 +408,9 @@ SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR}) <INITIAL>"[" { /* Section start */ /* Enter section data lookup state */ if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) { - yy_push_state(ST_SECTION_RAW); + BEGIN(ST_SECTION_RAW); } else { - yy_push_state(ST_SECTION_VALUE); + BEGIN(ST_SECTION_VALUE); } return TC_SECTION; } @@ -438,7 +438,7 @@ SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR}) EAT_TRAILING_WHITESPACE_EX('['); /* Enter offset lookup state */ - yy_push_state(ST_OFFSET); + BEGIN(ST_OFFSET); RETURN_TOKEN(TC_OFFSET, yytext, yyleng); } @@ -492,9 +492,9 @@ SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR}) <INITIAL>{TABS_AND_SPACES}*[=]{TABS_AND_SPACES}* { /* Start option value */ if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) { - yy_push_state(ST_RAW); + BEGIN(ST_RAW); } else { - yy_push_state(ST_VALUE); + BEGIN(ST_VALUE); } return '='; } diff --git a/Zend/zend_ini_scanner_defs.h b/Zend/zend_ini_scanner_defs.h index 017865f9d3..1cbfbf1ce0 100644 --- a/Zend/zend_ini_scanner_defs.h +++ b/Zend/zend_ini_scanner_defs.h @@ -1,4 +1,4 @@ -/* Generated by re2c 0.14.3 */ +/* Generated by re2c 0.16 */ #line 3 "Zend/zend_ini_scanner_defs.h" enum YYCONDTYPE { diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 70dab660b3..af92d67496 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -736,9 +736,11 @@ zval *zend_std_read_dimension(zval *object, zval *offset, int type, zval *rv) /* if (type == BP_VAR_IS) { zend_call_method_with_1_params(object, ce, NULL, "offsetexists", rv, offset); if (UNEXPECTED(Z_ISUNDEF_P(rv))) { + zval_ptr_dtor(offset); return NULL; } if (!i_zend_is_true(rv)) { + zval_ptr_dtor(offset); zval_ptr_dtor(rv); return &EG(uninitialized_zval); } diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index a02551b1bd..4798c7d213 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -188,41 +188,45 @@ try_again: /* {{{ zendi_convert_scalar_to_number */ #define zendi_convert_scalar_to_number(op, holder, result) \ - if (op==result) { \ - if (Z_TYPE_P(op) != IS_LONG) { \ - convert_scalar_to_number(op); \ - } \ - } else { \ - switch (Z_TYPE_P(op)) { \ - case IS_STRING: \ - { \ + if (Z_TYPE_P(op) != IS_LONG) { \ + if (op==result && Z_TYPE_P(op) != IS_OBJECT) { \ + convert_scalar_to_number(op); \ + } else { \ + switch (Z_TYPE_P(op)) { \ + case IS_STRING: \ if ((Z_TYPE_INFO(holder)=is_numeric_string(Z_STRVAL_P(op), Z_STRLEN_P(op), &Z_LVAL(holder), &Z_DVAL(holder), 1)) == 0) { \ - ZVAL_LONG(&(holder), 0); \ - } \ - (op) = &(holder); \ - break; \ - } \ - case IS_NULL: \ - case IS_FALSE: \ - ZVAL_LONG(&(holder), 0); \ - (op) = &(holder); \ - break; \ - case IS_TRUE: \ - ZVAL_LONG(&(holder), 1); \ - (op) = &(holder); \ - break; \ - case IS_RESOURCE: \ - ZVAL_LONG(&(holder), Z_RES_HANDLE_P(op)); \ - (op) = &(holder); \ - break; \ - case IS_OBJECT: \ - ZVAL_COPY(&(holder), op); \ - convert_to_long_base(&(holder), 10); \ - if (Z_TYPE(holder) == IS_LONG) { \ - (op) = &(holder); \ - } \ - break; \ - } \ + ZVAL_LONG(&(holder), 0); \ + } \ + (op) = &(holder); \ + break; \ + case IS_NULL: \ + case IS_FALSE: \ + ZVAL_LONG(&(holder), 0); \ + (op) = &(holder); \ + break; \ + case IS_TRUE: \ + ZVAL_LONG(&(holder), 1); \ + (op) = &(holder); \ + break; \ + case IS_RESOURCE: \ + ZVAL_LONG(&(holder), Z_RES_HANDLE_P(op)); \ + (op) = &(holder); \ + break; \ + case IS_OBJECT: \ + ZVAL_COPY(&(holder), op); \ + convert_to_long_base(&(holder), 10); \ + if (UNEXPECTED(EG(exception))) { \ + return FAILURE; \ + } \ + if (Z_TYPE(holder) == IS_LONG) { \ + if (op == result) { \ + zval_ptr_dtor(op); \ + } \ + (op) = &(holder); \ + } \ + break; \ + } \ + } \ } /* }}} */ @@ -259,6 +263,9 @@ try_again: } \ ZEND_TRY_BINARY_OP1_OBJECT_OPERATION(op, op_func); \ op1_lval = _zval_get_long_func(op1); \ + if (UNEXPECTED(EG(exception))) { \ + return FAILURE; \ + } \ } else { \ op1_lval = Z_LVAL_P(op1); \ } \ @@ -274,6 +281,9 @@ try_again: } \ ZEND_TRY_BINARY_OP2_OBJECT_OPERATION(op); \ op2_lval = _zval_get_long_func(op2); \ + if (UNEXPECTED(EG(exception))) { \ + return FAILURE; \ + } \ } else { \ op2_lval = Z_LVAL_P(op2); \ } \ @@ -1187,10 +1197,6 @@ ZEND_API int ZEND_FASTCALL mod_function(zval *result, zval *op1, zval *op2) /* { convert_op1_op2_long(op1, op1_lval, op2, op2_lval, ZEND_MOD, mod_function); - if (op1 == result) { - zval_dtor(result); - } - if (op2_lval == 0) { /* modulus by zero */ if (EG(current_execute_data) && !CG(in_compilation)) { @@ -1198,10 +1204,16 @@ ZEND_API int ZEND_FASTCALL mod_function(zval *result, zval *op1, zval *op2) /* { } else { zend_error_noreturn(E_ERROR, "Modulo by zero"); } - ZVAL_UNDEF(result); + if (op1 != result) { + ZVAL_UNDEF(result); + } return FAILURE; } + if (op1 == result) { + zval_dtor(result); + } + if (op2_lval == -1) { /* Prevent overflow error/crash if op1==LONG_MIN */ ZVAL_LONG(result, 0); @@ -1349,6 +1361,9 @@ ZEND_API int ZEND_FASTCALL bitwise_or_function(zval *result, zval *op1, zval *op if (EXPECTED(Z_STRLEN_P(op1) >= Z_STRLEN_P(op2))) { if (EXPECTED(Z_STRLEN_P(op1) == Z_STRLEN_P(op2)) && Z_STRLEN_P(op1) == 1) { zend_uchar or = (zend_uchar) (*Z_STRVAL_P(op1) | *Z_STRVAL_P(op2)); + if (result==op1) { + zend_string_release(Z_STR_P(result)); + } if (CG(one_char_string)[or]) { ZVAL_INTERNED_STR(result, CG(one_char_string)[or]); } else { @@ -1378,12 +1393,18 @@ ZEND_API int ZEND_FASTCALL bitwise_or_function(zval *result, zval *op1, zval *op if (UNEXPECTED(Z_TYPE_P(op1) != IS_LONG)) { ZEND_TRY_BINARY_OP1_OBJECT_OPERATION(ZEND_BW_OR, bitwise_or_function); op1_lval = _zval_get_long_func(op1); + if (UNEXPECTED(EG(exception))) { + return FAILURE; + } } else { op1_lval = Z_LVAL_P(op1); } if (UNEXPECTED(Z_TYPE_P(op2) != IS_LONG)) { ZEND_TRY_BINARY_OP2_OBJECT_OPERATION(ZEND_BW_OR); op2_lval = _zval_get_long_func(op2); + if (UNEXPECTED(EG(exception))) { + return FAILURE; + } } else { op2_lval = Z_LVAL_P(op2); } @@ -1416,6 +1437,9 @@ ZEND_API int ZEND_FASTCALL bitwise_and_function(zval *result, zval *op1, zval *o if (EXPECTED(Z_STRLEN_P(op1) >= Z_STRLEN_P(op2))) { if (EXPECTED(Z_STRLEN_P(op1) == Z_STRLEN_P(op2)) && Z_STRLEN_P(op1) == 1) { zend_uchar and = (zend_uchar) (*Z_STRVAL_P(op1) & *Z_STRVAL_P(op2)); + if (result==op1) { + zend_string_release(Z_STR_P(result)); + } if (CG(one_char_string)[and]) { ZVAL_INTERNED_STR(result, CG(one_char_string)[and]); } else { @@ -1445,12 +1469,18 @@ ZEND_API int ZEND_FASTCALL bitwise_and_function(zval *result, zval *op1, zval *o if (UNEXPECTED(Z_TYPE_P(op1) != IS_LONG)) { ZEND_TRY_BINARY_OP1_OBJECT_OPERATION(ZEND_BW_AND, bitwise_and_function); op1_lval = _zval_get_long_func(op1); + if (UNEXPECTED(EG(exception))) { + return FAILURE; + } } else { op1_lval = Z_LVAL_P(op1); } if (UNEXPECTED(Z_TYPE_P(op2) != IS_LONG)) { ZEND_TRY_BINARY_OP2_OBJECT_OPERATION(ZEND_BW_AND); op2_lval = _zval_get_long_func(op2); + if (UNEXPECTED(EG(exception))) { + return FAILURE; + } } else { op2_lval = Z_LVAL_P(op2); } @@ -1483,6 +1513,9 @@ ZEND_API int ZEND_FASTCALL bitwise_xor_function(zval *result, zval *op1, zval *o if (EXPECTED(Z_STRLEN_P(op1) >= Z_STRLEN_P(op2))) { if (EXPECTED(Z_STRLEN_P(op1) == Z_STRLEN_P(op2)) && Z_STRLEN_P(op1) == 1) { zend_uchar xor = (zend_uchar) (*Z_STRVAL_P(op1) ^ *Z_STRVAL_P(op2)); + if (result==op1) { + zend_string_release(Z_STR_P(result)); + } if (CG(one_char_string)[xor]) { ZVAL_INTERNED_STR(result, CG(one_char_string)[xor]); } else { @@ -1512,12 +1545,18 @@ ZEND_API int ZEND_FASTCALL bitwise_xor_function(zval *result, zval *op1, zval *o if (UNEXPECTED(Z_TYPE_P(op1) != IS_LONG)) { ZEND_TRY_BINARY_OP1_OBJECT_OPERATION(ZEND_BW_XOR, bitwise_xor_function); op1_lval = _zval_get_long_func(op1); + if (UNEXPECTED(EG(exception))) { + return FAILURE; + } } else { op1_lval = Z_LVAL_P(op1); } if (UNEXPECTED(Z_TYPE_P(op2) != IS_LONG)) { ZEND_TRY_BINARY_OP2_OBJECT_OPERATION(ZEND_BW_XOR); op2_lval = _zval_get_long_func(op2); + if (UNEXPECTED(EG(exception))) { + return FAILURE; + } } else { op2_lval = Z_LVAL_P(op2); } @@ -1536,13 +1575,12 @@ ZEND_API int ZEND_FASTCALL shift_left_function(zval *result, zval *op1, zval *op convert_op1_op2_long(op1, op1_lval, op2, op2_lval, ZEND_SL, shift_left_function); - if (op1 == result) { - zval_dtor(result); - } - /* prevent wrapping quirkiness on some processors where << 64 + x == << x */ if (UNEXPECTED((zend_ulong)op2_lval >= SIZEOF_ZEND_LONG * 8)) { if (EXPECTED(op2_lval > 0)) { + if (op1 == result) { + zval_dtor(result); + } ZVAL_LONG(result, 0); return SUCCESS; } else { @@ -1551,11 +1589,17 @@ ZEND_API int ZEND_FASTCALL shift_left_function(zval *result, zval *op1, zval *op } else { zend_error_noreturn(E_ERROR, "Bit shift by negative number"); } - ZVAL_UNDEF(result); + if (op1 != result) { + ZVAL_UNDEF(result); + } return FAILURE; } } + if (op1 == result) { + zval_dtor(result); + } + ZVAL_LONG(result, op1_lval << op2_lval); return SUCCESS; } @@ -1567,13 +1611,12 @@ ZEND_API int ZEND_FASTCALL shift_right_function(zval *result, zval *op1, zval *o convert_op1_op2_long(op1, op1_lval, op2, op2_lval, ZEND_SR, shift_right_function); - if (op1 == result) { - zval_dtor(result); - } - /* prevent wrapping quirkiness on some processors where >> 64 + x == >> x */ if (UNEXPECTED((zend_ulong)op2_lval >= SIZEOF_ZEND_LONG * 8)) { if (EXPECTED(op2_lval > 0)) { + if (op1 == result) { + zval_dtor(result); + } ZVAL_LONG(result, (op1_lval < 0) ? -1 : 0); return SUCCESS; } else { @@ -1582,11 +1625,17 @@ ZEND_API int ZEND_FASTCALL shift_right_function(zval *result, zval *op1, zval *o } else { zend_error_noreturn(E_ERROR, "Bit shift by negative number"); } - ZVAL_UNDEF(result); + if (op1 != result) { + ZVAL_UNDEF(result); + } return FAILURE; } } + if (op1 == result) { + zval_dtor(result); + } + ZVAL_LONG(result, op1_lval >> op2_lval); return SUCCESS; } @@ -1594,6 +1643,7 @@ ZEND_API int ZEND_FASTCALL shift_right_function(zval *result, zval *op1, zval *o ZEND_API int ZEND_FASTCALL concat_function(zval *result, zval *op1, zval *op2) /* {{{ */ { + zval *orig_op1 = op1; zval op1_copy, op2_copy; int use_copy1 = 0, use_copy2 = 0; @@ -1606,11 +1656,11 @@ ZEND_API int ZEND_FASTCALL concat_function(zval *result, zval *op1, zval *op2) / ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_CONCAT, concat_function); use_copy1 = zend_make_printable_zval(op1, &op1_copy); if (use_copy1) { - /* We have created a converted copy of op1. Therefore, op1 won't become the result so - * we have to free it. - */ + if (UNEXPECTED(EG(exception))) { + zval_dtor(&op1_copy); + return FAILURE; + } if (result == op1) { - zval_dtor(op1); if (UNEXPECTED(op1 == op2)) { op2 = &op1_copy; } @@ -1628,6 +1678,13 @@ ZEND_API int ZEND_FASTCALL concat_function(zval *result, zval *op1, zval *op2) / ZEND_TRY_BINARY_OP2_OBJECT_OPERATION(ZEND_CONCAT); use_copy2 = zend_make_printable_zval(op2, &op2_copy); if (use_copy2) { + if (UNEXPECTED(EG(exception))) { + if (UNEXPECTED(use_copy1)) { + zval_dtor(op1); + } + zval_dtor(&op2_copy); + return FAILURE; + } op2 = &op2_copy; } } @@ -1641,7 +1698,15 @@ ZEND_API int ZEND_FASTCALL concat_function(zval *result, zval *op1, zval *op2) / if (UNEXPECTED(op1_len > SIZE_MAX - op2_len)) { zend_throw_error(NULL, "String size overflow"); - ZVAL_FALSE(result); + if (UNEXPECTED(use_copy1)) { + zval_dtor(op1); + } + if (UNEXPECTED(use_copy2)) { + zval_dtor(op2); + } + if (orig_op1 != result) { + ZVAL_UNDEF(result); + } return FAILURE; } @@ -1651,6 +1716,9 @@ ZEND_API int ZEND_FASTCALL concat_function(zval *result, zval *op1, zval *op2) / } else { result_str = zend_string_alloc(result_len, 0); memcpy(ZSTR_VAL(result_str), Z_STRVAL_P(op1), op1_len); + if (result == orig_op1) { + zval_dtor(orig_op1); + } } /* This has to happen first to account for the cases where result == op1 == op2 and diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h index f187129416..02f58d9878 100644 --- a/Zend/zend_portability.h +++ b/Zend/zend_portability.h @@ -125,6 +125,8 @@ # define ZEND_IGNORE_VALUE(x) ((void) (x)) #endif +#define zend_quiet_write(...) ZEND_IGNORE_VALUE(write(__VA_ARGS__)) + /* all HAVE_XXX test have to be after the include of zend_config above */ #if defined(HAVE_LIBDL) && !defined(ZEND_WIN32) diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 6693ef316f..89725bd02d 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -2142,6 +2142,7 @@ ZEND_VM_HANDLER(136, ZEND_ASSIGN_OBJ, VAR|UNUSED|CV, CONST|TMPVAR|CV) if (OP1_TYPE == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_throw_error(NULL, "Using $this when not in object context"); FREE_UNFETCHED_OP2(); + FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } @@ -2150,6 +2151,7 @@ ZEND_VM_HANDLER(136, ZEND_ASSIGN_OBJ, VAR|UNUSED|CV, CONST|TMPVAR|CV) if (OP1_TYPE == IS_VAR && UNEXPECTED(object == NULL)) { zend_throw_error(NULL, "Cannot use string offset as an array"); FREE_OP2(); + FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } zend_assign_to_object(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object, OP1_TYPE, property_name, OP2_TYPE, (opline+1)->op1_type, (opline+1)->op1, execute_data, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property_name)) : NULL)); @@ -5876,6 +5878,12 @@ ZEND_VM_HANDLER(125, ZEND_FE_RESET_RW, CONST|TMP|VAR|CV, ANY) if (OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) { array_ref = array_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_R); + if (OP1_TYPE == IS_VAR && UNEXPECTED(array_ref == NULL)) { + zend_throw_error(NULL, "Cannot iterate on string offsets by reference"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; + HANDLE_EXCEPTION(); + } if (Z_ISREF_P(array_ref)) { array_ptr = Z_REFVAL_P(array_ref); } @@ -7846,7 +7854,8 @@ ZEND_VM_HANDLER(151, ZEND_ASSERT_CHECK, ANY, ANY) if (RETURN_VALUE_USED(result)) { ZVAL_TRUE(EX_VAR(result->result.var)); } - ZEND_VM_JMP(target); + ZEND_VM_SET_OPCODE(target); + ZEND_VM_CONTINUE(); } else { ZEND_VM_NEXT_OPCODE(); } @@ -7928,17 +7937,27 @@ ZEND_VM_HANDLER(158, ZEND_CALL_TRAMPOLINE, ANY, ANY) if (EXPECTED(fbc->type == ZEND_USER_FUNCTION)) { - ZEND_ASSERT(!(fbc->common.fn_flags & ZEND_ACC_GENERATOR)); - - call->symbol_table = NULL; - i_init_func_execute_data(call, &fbc->op_array, - ret, (fbc->common.fn_flags & ZEND_ACC_STATIC) == 0); - - if (EXPECTED(zend_execute_ex == execute_ex)) { - ZEND_VM_ENTER(); + if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_GENERATOR) != 0)) { + if (ret) { + zend_generator_create_zval(call, &fbc->op_array, ret); + Z_VAR_FLAGS_P(ret) = 0; + } else { + if (UNEXPECTED(ZEND_CALL_INFO(call) & ZEND_CALL_CLOSURE)) { + OBJ_RELEASE((zend_object*)fbc->op_array.prototype); + } + zend_vm_stack_free_args(call); + } } else { - ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP); - zend_execute_ex(call); + call->symbol_table = NULL; + i_init_func_execute_data(call, &fbc->op_array, + ret, (fbc->common.fn_flags & ZEND_ACC_STATIC) == 0); + + if (EXPECTED(zend_execute_ex == execute_ex)) { + ZEND_VM_ENTER(); + } else { + ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP); + zend_execute_ex(call); + } } } else { zval retval; diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 2c90e0073e..5784ead38d 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -1655,7 +1655,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSERT_CHECK_SPEC_HANDLER(ZEND if (RETURN_VALUE_USED(result)) { ZVAL_TRUE(EX_VAR(result->result.var)); } - ZEND_VM_JMP(target); + ZEND_VM_SET_OPCODE(target); + ZEND_VM_CONTINUE(); } else { ZEND_VM_NEXT_OPCODE(); } @@ -1737,17 +1738,27 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CALL_TRAMPOLINE_SPEC_HANDLER(Z if (EXPECTED(fbc->type == ZEND_USER_FUNCTION)) { - ZEND_ASSERT(!(fbc->common.fn_flags & ZEND_ACC_GENERATOR)); - - call->symbol_table = NULL; - i_init_func_execute_data(call, &fbc->op_array, - ret, (fbc->common.fn_flags & ZEND_ACC_STATIC) == 0); - - if (EXPECTED(zend_execute_ex == execute_ex)) { - ZEND_VM_ENTER(); + if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_GENERATOR) != 0)) { + if (ret) { + zend_generator_create_zval(call, &fbc->op_array, ret); + Z_VAR_FLAGS_P(ret) = 0; + } else { + if (UNEXPECTED(ZEND_CALL_INFO(call) & ZEND_CALL_CLOSURE)) { + OBJ_RELEASE((zend_object*)fbc->op_array.prototype); + } + zend_vm_stack_free_args(call); + } } else { - ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP); - zend_execute_ex(call); + call->symbol_table = NULL; + i_init_func_execute_data(call, &fbc->op_array, + ret, (fbc->common.fn_flags & ZEND_ACC_STATIC) == 0); + + if (EXPECTED(zend_execute_ex == execute_ex)) { + ZEND_VM_ENTER(); + } else { + ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP); + zend_execute_ex(call); + } } } else { zval retval; @@ -3825,6 +3836,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_CONST_HANDLER if (IS_CONST == IS_VAR || IS_CONST == IS_CV) { array_ref = array_ptr = NULL; + if (IS_CONST == IS_VAR && UNEXPECTED(array_ref == NULL)) { + zend_throw_error(NULL, "Cannot iterate on string offsets by reference"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; + HANDLE_EXCEPTION(); + } if (Z_ISREF_P(array_ref)) { array_ptr = Z_REFVAL_P(array_ref); } @@ -12320,6 +12337,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_TMP_HANDLER(Z if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) { array_ref = array_ptr = NULL; + if (IS_TMP_VAR == IS_VAR && UNEXPECTED(array_ref == NULL)) { + zend_throw_error(NULL, "Cannot iterate on string offsets by reference"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; + HANDLE_EXCEPTION(); + } if (Z_ISREF_P(array_ref)) { array_ptr = Z_REFVAL_P(array_ref); } @@ -15788,6 +15811,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_VAR_HANDLER(Z if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { array_ref = array_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); + if (IS_VAR == IS_VAR && UNEXPECTED(array_ref == NULL)) { + zend_throw_error(NULL, "Cannot iterate on string offsets by reference"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; + HANDLE_EXCEPTION(); + } if (Z_ISREF_P(array_ref)) { array_ptr = Z_REFVAL_P(array_ref); } @@ -17519,6 +17548,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_HAND if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_throw_error(NULL, "Using $this when not in object context"); + FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } @@ -17527,6 +17557,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_HAND if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) { zend_throw_error(NULL, "Cannot use string offset as an array"); + FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } zend_assign_to_object(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object, IS_VAR, property_name, IS_CONST, (opline+1)->op1_type, (opline+1)->op1, execute_data, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property_name)) : NULL)); @@ -20743,6 +20774,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CV_HANDLER if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_throw_error(NULL, "Using $this when not in object context"); + FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } @@ -20751,6 +20783,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CV_HANDLER if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) { zend_throw_error(NULL, "Cannot use string offset as an array"); + FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } zend_assign_to_object(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object, IS_VAR, property_name, IS_CV, (opline+1)->op1_type, (opline+1)->op1, execute_data, ((IS_CV == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property_name)) : NULL)); @@ -22423,6 +22456,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_HAN if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_throw_error(NULL, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } @@ -22431,6 +22465,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_HAN if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) { zend_throw_error(NULL, "Cannot use string offset as an array"); zval_ptr_dtor_nogc(free_op2); + FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } zend_assign_to_object(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object, IS_VAR, property_name, (IS_TMP_VAR|IS_VAR), (opline+1)->op1_type, (opline+1)->op1, execute_data, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property_name)) : NULL)); @@ -23907,6 +23942,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_H if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_throw_error(NULL, "Using $this when not in object context"); + FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } @@ -23915,6 +23951,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_H if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { zend_throw_error(NULL, "Cannot use string offset as an array"); + FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } zend_assign_to_object(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object, IS_UNUSED, property_name, IS_CONST, (opline+1)->op1_type, (opline+1)->op1, execute_data, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property_name)) : NULL)); @@ -26338,6 +26375,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_HAND if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_throw_error(NULL, "Using $this when not in object context"); + FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } @@ -26346,6 +26384,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_HAND if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { zend_throw_error(NULL, "Cannot use string offset as an array"); + FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } zend_assign_to_object(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object, IS_UNUSED, property_name, IS_CV, (opline+1)->op1_type, (opline+1)->op1, execute_data, ((IS_CV == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property_name)) : NULL)); @@ -27846,6 +27885,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_ if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_throw_error(NULL, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } @@ -27854,6 +27894,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_ if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { zend_throw_error(NULL, "Cannot use string offset as an array"); zval_ptr_dtor_nogc(free_op2); + FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } zend_assign_to_object(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object, IS_UNUSED, property_name, (IS_TMP_VAR|IS_VAR), (opline+1)->op1_type, (opline+1)->op1, execute_data, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property_name)) : NULL)); @@ -29618,6 +29659,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_CV_HANDLER(ZE if (IS_CV == IS_VAR || IS_CV == IS_CV) { array_ref = array_ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var); + if (IS_CV == IS_VAR && UNEXPECTED(array_ref == NULL)) { + zend_throw_error(NULL, "Cannot iterate on string offsets by reference"); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; + HANDLE_EXCEPTION(); + } if (Z_ISREF_P(array_ref)) { array_ptr = Z_REFVAL_P(array_ref); } @@ -31966,6 +32013,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CONST_HANDL if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_throw_error(NULL, "Using $this when not in object context"); + FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } @@ -31974,6 +32022,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CONST_HANDL if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) { zend_throw_error(NULL, "Cannot use string offset as an array"); + FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } zend_assign_to_object(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object, IS_CV, property_name, IS_CONST, (opline+1)->op1_type, (opline+1)->op1, execute_data, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property_name)) : NULL)); @@ -37015,6 +37064,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CV_HANDLER( if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_throw_error(NULL, "Using $this when not in object context"); + FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } @@ -37023,6 +37073,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CV_HANDLER( if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) { zend_throw_error(NULL, "Cannot use string offset as an array"); + FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } zend_assign_to_object(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object, IS_CV, property_name, IS_CV, (opline+1)->op1_type, (opline+1)->op1, execute_data, ((IS_CV == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property_name)) : NULL)); @@ -39701,6 +39752,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_HAND if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_throw_error(NULL, "Using $this when not in object context"); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); + FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } @@ -39709,6 +39761,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_HAND if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) { zend_throw_error(NULL, "Cannot use string offset as an array"); zval_ptr_dtor_nogc(free_op2); + FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } zend_assign_to_object(UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, object, IS_CV, property_name, (IS_TMP_VAR|IS_VAR), (opline+1)->op1_type, (opline+1)->op1, execute_data, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property_name)) : NULL)); diff --git a/acinclude.m4 b/acinclude.m4 index 4cd1834f25..5fa893f39c 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -2264,7 +2264,7 @@ AC_DEFUN([PHP_SETUP_KERBEROS],[ fi dnl If krb5-config is found try using it - if test "$PHP_KERBEROS" = "yes" && test -x "$KRB5_CONFIG"; then + if test "$PHP_KERBEROS" != "no" && test -x "$KRB5_CONFIG"; then KERBEROS_LIBS=`$KRB5_CONFIG --libs gssapi` KERBEROS_CFLAGS=`$KRB5_CONFIG --cflags gssapi` diff --git a/appveyor/build.bat b/appveyor/build.bat new file mode 100644 index 0000000000..c5ae57a3ce --- /dev/null +++ b/appveyor/build.bat @@ -0,0 +1,33 @@ +@echo off + +set SDK_REMOTE=https://github.com/OSTC/php-sdk-binary-tools.git +set SDK_BRANCH=%PHP_BUILD_SDK_BRANCH% + +if not exist "%PHP_BUILD_CACHE_BASE_DIR%" ( + echo Creating %PHP_BUILD_CACHE_BASE_DIR% + mkdir "%PHP_BUILD_CACHE_BASE_DIR%" +) + +if not exist "%PHP_BUILD_OBJ_DIR%" ( + echo Creating %PHP_BUILD_OBJ_DIR% + mkdir "%PHP_BUILD_OBJ_DIR%" +) + +if not exist "%PHP_BUILD_CACHE_SDK_DIR%" ( + echo Cloning remote SDK repository + git clone --branch %SDK_BRANCH% %SDK_REMOTE% "%PHP_BUILD_CACHE_SDK_DIR%" 2>&1 +) else ( + echo Fetching remote SDK repository + git --git-dir="%PHP_BUILD_CACHE_SDK_DIR%\.git" --work-tree="%PHP_BUILD_CACHE_SDK_DIR%" fetch --prune origin 2>&1 + echo Checkout SDK repository branch + git --git-dir="%PHP_BUILD_CACHE_SDK_DIR%\.git" --work-tree="%PHP_BUILD_CACHE_SDK_DIR%" checkout --force %SDK_BRANCH% +) + +set SDK_RUNNER=%PHP_BUILD_CACHE_SDK_DIR%\phpsdk-vc14-%PLATFORM%.bat +if not exist "%SDK_RUNNER%" ( + echo "%SDK_RUNNER%" doesn't exist + exit /b 3 +) + +call %SDK_RUNNER% -t %APPVEYOR_BUILD_FOLDER%\appveyor\build_task.bat + diff --git a/appveyor/build_task.bat b/appveyor/build_task.bat new file mode 100644 index 0000000000..cf5187738c --- /dev/null +++ b/appveyor/build_task.bat @@ -0,0 +1,50 @@ +@echo off + +if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin >NUL 2>NUL +if %errorlevel% neq 0 exit /b 3 +if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw >NUL 2>NUL +if %errorlevel% neq 0 exit /b 3 +if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw-w64 >NUL 2>NUL +if %errorlevel% neq 0 exit /b 3 + +cd /D %APPVEYOR_BUILD_FOLDER% +if %errorlevel% neq 0 exit /b 3 + +if /i "%APPVEYOR_REPO_BRANCH:~0,4%" equ "php-" ( + set BRANCH=%APPVEYOR_REPO_BRANCH:~4% + set STABILITY=stable +) else ( + set BRANCH=master + set STABILITY=staging +) +set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%PHP_SDK_VC%-%PHP_SDK_ARCH%-%APPVEYOR_REPO_BRANCH% +rem SDK is cached, deps info is cached as well +echo Updating dependencies +call phpsdk_deps --update --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR% +if %errorlevel% neq 0 exit /b 3 + +call buildconf.bat --force +if %errorlevel% neq 0 exit /b 3 + +if "%THREAD_SAFE%" equ "0" set ADD_CONF=--disable-zts + +set EXT_EXCLUDE_FROM_TEST=snmp,oci8_12c,pdo_oci,pdo_odbc,odbc,pdo_firebird,interbase,ldap,imap,dba +if "%OPCACHE%" equ "0" set EXT_EXCLUDE_FROM_TEST=%EXT_EXCLUDE_FROM_TEST%,opcache + +call configure.bat ^ + --enable-snapshot-build ^ + --enable-debug-pack ^ + --with-mcrypt=shared ^ + --enable-com-dotnet=shared ^ + --without-analyzer ^ + --enable-object-out-dir=%PHP_BUILD_OBJ_DIR% ^ + --with-php-build=%DEPS_DIR% ^ + %ADD_CONF% ^ + --with-test-ini-ext-exclude=%EXT_EXCLUDE_FROM_TEST% +if %errorlevel% neq 0 exit /b 3 + +nmake /NOLOGO +if %errorlevel% neq 0 exit /b 3 + +exit /b 0 + diff --git a/appveyor/test.bat b/appveyor/test.bat new file mode 100644 index 0000000000..fbe24ec098 --- /dev/null +++ b/appveyor/test.bat @@ -0,0 +1,10 @@ +@echo off + +set SDK_RUNNER=%PHP_BUILD_CACHE_SDK_DIR%\phpsdk-vc14-%PLATFORM%.bat +if not exist "%SDK_RUNNER%" ( + echo "%SDK_RUNNER%" doesn't exist + exit /b 3 +) + +call %SDK_RUNNER% -t %APPVEYOR_BUILD_FOLDER%\appveyor\test_task.bat + diff --git a/appveyor/test_task.bat b/appveyor/test_task.bat new file mode 100644 index 0000000000..34bc16169d --- /dev/null +++ b/appveyor/test_task.bat @@ -0,0 +1,68 @@ +@echo off + +set NO_INTERACTION=1 +set REPORT_EXIT_STATUS=1 +set SKIP_IO_CAPTURE_TESTS=1 + +set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%PHP_SDK_VC%-%PHP_SDK_ARCH%-%APPVEYOR_REPO_BRANCH% + +rem setup MySQL related exts +set MYSQL_PWD=Password12! +set MYSQL_TEST_PASSWD=%MYSQL_PWD% +set MYSQL_TEST_USER=root +set MYSQL_TEST_HOST=127.0.0.1 +set MYSQL_TEST_PORT=3306 +set PDO_MYSQL_TEST_USER=%MYSQL_TEST_USER% +set PDO_MYSQL_TEST_PASS=%MYSQL_PWD% +set PDO_MYSQL_TEST_HOST=%MYSQL_TEST_HOST% +set PDO_MYSQL_TEST_PORT=%MYSQL_TEST_PORT% +set PDO_MYSQL_TEST_DSN=mysql:host=%PDO_MYSQL_TEST_HOST% port=%PDO_MYSQL_TEST_PORT% dbname=test user=%PDO_MYSQL_TEST_USER% password=%MYSQL_PW% +"C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" --user=%MYSQL_TEST_USER% -e "CREATE DATABASE IF NOT EXISTS test" + +rem setup PostgreSQL related exts +set PGUSER=postgres +set PGPASSWORD=Password12! +rem set PGSQL_TEST_CONNSTR=host=127.0.0.1 dbname=test port=5432 user=postgres password=Password12! +echo ^<?php $conn_str = "host=127.0.0.1 dbname=test port=5432 user=%PGUSER% password=%PGPASSWORD%"; ?^> >> "./ext/pgsql/tests/config.inc" +set PDO_PGSQL_TEST_DSN=pgsql:host=127.0.0.1 port=5432 dbname=test user=%PGUSER% password=%PGPASSWORD% +"C:\Program Files\PostgreSQL\9.5\bin\createdb.exe" test + +rem prepare for ext/openssl +if "%APPVEYOR%" equ "True" rmdir /s /q C:\OpenSSL-Win32 >NUL 2>NUL +if "%APPVEYOR%" equ "True" rmdir /s /q C:\OpenSSL-Win64 >NUL 2>NUL +mkdir c:\usr\local\ssl +copy %DEPS_DIR%\template\ssl\openssl.cnf c:\usr\local\ssl +set OPENSSL_CONF=c:\usr\local\ssl\openssl.cnf +rem set OPENSSL_CONF= +rem set SSLEAY_CONF= + +rem prepare for Opcache +if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enabled=1 -d opcache.enable_cli=1 + +rem prepare for enchant +mkdir c:\enchant_plugins +copy %DEPS_DIR%\bin\libenchant_ispell.dll c:\enchant_plugins +copy %DEPS_DIR%\bin\libenchant_myspell.dll c:\enchant_plugins +reg add HKEY_CURRENT_USER\SOFTWARE\Enchant\Config /v Module_Dir /t REG_SZ /d c:\enchant_plugins +set PHP_BUILD_CACHE_ENCHANT_DICT_DIR=%PHP_BUILD_CACHE_BASE_DIR%\enchant_dict +if not exist "%PHP_BUILD_CACHE_ENCHANT_DICT_DIR%" ( + echo Creating %PHP_BUILD_CACHE_ENCHANT_DICT_DIR% + mkdir "%PHP_BUILD_CACHE_ENCHANT_DICT_DIR%" +) +if not exist "%PHP_BUILD_CACHE_ENCHANT_DICT_DIR%\en_US.aff" ( + echo Fetching enchant dicts + pushd %PHP_BUILD_CACHE_ENCHANT_DICT_DIR% + del /q * + powershell -Command wget http://windows.php.net/downloads/qa/appveyor/ext/enchant/dict.zip -OutFile dict.zip + unzip dict.zip + del /q dict.zip + popd +) +mkdir %USERPROFILE%\enchant\myspell +copy %PHP_BUILD_CACHE_ENCHANT_DICT_DIR%\* %USERPROFILE%\enchant\myspell + +mkdir c:\tests_tmp + +cd "%APPVEYOR_BUILD_FOLDER%" +nmake test TESTS="%OPCACHE_OPTS% -q --offline --show-diff --set-timeout 120 -g FAIL,XFAIL,BORK,WARN,LEAK,SKIP --temp-source c:\tests_tmp --temp-target c:\tests_tmp" + diff --git a/configure.in b/configure.in index d3babd98b6..5aea1ed71f 100644 --- a/configure.in +++ b/configure.in @@ -119,7 +119,7 @@ int zend_sprintf(char *buffer, const char *format, ...); PHP_MAJOR_VERSION=7 PHP_MINOR_VERSION=0 -PHP_RELEASE_VERSION=14 +PHP_RELEASE_VERSION=15 PHP_EXTRA_VERSION="-dev" PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION" PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION` diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c index ec1c72191c..fd6d98306b 100644 --- a/ext/com_dotnet/com_com.c +++ b/ext/com_dotnet/com_com.c @@ -52,6 +52,7 @@ PHP_FUNCTION(com_create_instance) RPC_C_AUTHN_LEVEL_DEFAULT, RPC_C_IMP_LEVEL_IMPERSONATE, &authid, EOAC_NONE }; + zend_long cp = GetACP(); php_com_initialize(); obj = CDNO_FETCH(object); @@ -59,16 +60,22 @@ PHP_FUNCTION(com_create_instance) if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "s|s!ls", &module_name, &module_name_len, &server_name, &server_name_len, - &obj->code_page, &typelib_name, &typelib_name_len) && + &cp, &typelib_name, &typelib_name_len) && FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "sa|ls", - &module_name, &module_name_len, &server_params, &obj->code_page, + &module_name, &module_name_len, &server_params, &cp, &typelib_name, &typelib_name_len)) { php_com_throw_exception(E_INVALIDARG, "Could not create COM object - invalid arguments!"); return; } + if (Z_L(0) > cp || ZEND_LONG_INT_OVFL(cp)) { + php_com_throw_exception(E_INVALIDARG, "Could not create COM object - invalid codepage!"); + return; + } + obj->code_page = (int)cp; + if (server_name) { ctx = CLSCTX_REMOTE_SERVER; } else if (server_params) { diff --git a/ext/com_dotnet/com_dotnet.c b/ext/com_dotnet/com_dotnet.c index c8e2bc105b..195ba63916 100644 --- a/ext/com_dotnet/com_dotnet.c +++ b/ext/com_dotnet/com_dotnet.c @@ -196,6 +196,7 @@ PHP_FUNCTION(com_dotnet_create_instance) int ret = FAILURE; char *where = ""; IUnknown *unk = NULL; + zend_long cp = GetACP(); php_com_initialize(); stuff = (struct dotnet_runtime_stuff*)COMG(dotnet_runtime_stuff); @@ -245,11 +246,17 @@ PHP_FUNCTION(com_dotnet_create_instance) if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", &assembly_name, &assembly_name_len, &datatype_name, &datatype_name_len, - &obj->code_page)) { + &cp)) { php_com_throw_exception(E_INVALIDARG, "Could not create .Net object - invalid arguments!"); return; } + if (Z_L(0) > cp || ZEND_LONG_INT_OVFL(cp)) { + php_com_throw_exception(E_INVALIDARG, "Could not create .Net object - invalid codepage!"); + return; + } + obj->code_page = (int)cp; + oletype = php_com_string_to_olestring(datatype_name, datatype_name_len, obj->code_page); oleassembly = php_com_string_to_olestring(assembly_name, assembly_name_len, obj->code_page); oletype_sys = SysAllocString(oletype); diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c index 5752a7d705..12c82a41bc 100644 --- a/ext/com_dotnet/com_handlers.c +++ b/ext/com_dotnet/com_handlers.c @@ -656,5 +656,7 @@ zend_object* php_com_object_new(zend_class_entry *ce) zend_object_std_init(&obj->zo, ce); obj->zo.handlers = &php_com_object_handlers; + obj->typeinfo = NULL; + return (zend_object*)obj; } diff --git a/ext/com_dotnet/tests/bug73679.phpt b/ext/com_dotnet/tests/bug73679.phpt new file mode 100644 index 0000000000..6f46d87d7f --- /dev/null +++ b/ext/com_dotnet/tests/bug73679.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #73679 DOTNET read access violation using invalid codepage +--SKIPIF-- +<?php # vim:ft=php +if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; ?> +--FILE-- +<?php + +$stack = new DOTNET("mscorlib", "System.Collections.Stack", -2200000000); +$stack->Push(".Net"); +$stack->Push("Hello "); +echo $stack->Pop() . $stack->Pop(); + +?> +--EXPECTF-- +Fatal error: Uncaught com_exception: Could not create .Net object - invalid codepage! in %sbug73679.php:%d +Stack trace: +#0 %sbug73679.php(%d): dotnet->dotnet('mscorlib', 'System.Collecti...', -2200000000) +#1 {main} + thrown in %sbug73679.php on line %d diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 65539d1acc..8a354a371f 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -2302,8 +2302,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{ error = curl_easy_setopt(ch->cp, option, lval); break; case CURLOPT_SAFE_UPLOAD: - lval = zval_get_long(zvalue); - if (lval == 0) { + if (!zend_is_true(zvalue)) { php_error_docref(NULL, E_WARNING, "Disabling safe uploads is no longer supported"); return FAILURE; } @@ -2639,13 +2638,11 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{ break; case CURLOPT_FOLLOWLOCATION: - lval = zval_get_long(zvalue); + lval = zend_is_true(zvalue); #if LIBCURL_VERSION_NUM < 0x071304 - if (PG(open_basedir) && *PG(open_basedir)) { - if (lval != 0) { - php_error_docref(NULL, E_WARNING, "CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set"); - return FAILURE; - } + if (lval && PG(open_basedir) && *PG(open_basedir)) { + php_error_docref(NULL, E_WARNING, "CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set"); + return FAILURE; } #endif error = curl_easy_setopt(ch->cp, option, lval); @@ -2801,8 +2798,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{ break; case CURLOPT_RETURNTRANSFER: - lval = zval_get_long(zvalue); - if (lval) { + if (zend_is_true(zvalue)) { ch->handlers->write->method = PHP_CURL_RETURN; } else { ch->handlers->write->method = PHP_CURL_STDOUT; @@ -2878,8 +2874,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{ } case CURLINFO_HEADER_OUT: - lval = zval_get_long(zvalue); - if (lval == 1) { + if (zend_is_true(zvalue)) { curl_easy_setopt(ch->cp, CURLOPT_DEBUGFUNCTION, curl_debug); curl_easy_setopt(ch->cp, CURLOPT_DEBUGDATA, (void *)ch); curl_easy_setopt(ch->cp, CURLOPT_VERBOSE, 1); diff --git a/ext/curl/tests/bug48203-win32.phpt b/ext/curl/tests/bug48203-win32.phpt new file mode 100644 index 0000000000..947c33a3d1 --- /dev/null +++ b/ext/curl/tests/bug48203-win32.phpt @@ -0,0 +1,36 @@ +--TEST-- +Bug #48203 (Crash when CURLOPT_STDERR is set to regular file) +--SKIPIF-- +<?php include 'skipif.inc'; ?> +<?php +if(substr(PHP_OS, 0, 3) != 'WIN' ) { + die('skip Windows only test'); +} +?> +--FILE-- +<?php +include 'server.inc'; +$fp = fopen(dirname(__FILE__) . '/bug48203.tmp', 'w'); + +$ch = curl_init(); + +curl_setopt($ch, CURLOPT_VERBOSE, 1); +curl_setopt($ch, CURLOPT_STDERR, $fp); +curl_setopt($ch, CURLOPT_URL, curl_cli_server_start()); + +fclose($fp); // <-- premature close of $fp caused a crash! + +curl_exec($ch); +curl_close($ch); + +echo "Ok\n"; + +?> +--CLEAN-- +<?php @unlink(dirname(__FILE__) . '/bug48203.tmp'); ?> +--EXPECTF-- +Warning: curl_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %s on line %d +Hello World! +Hello World!Ok +%A + diff --git a/ext/curl/tests/bug48203.phpt b/ext/curl/tests/bug48203.phpt index aae7fc51a4..fc8b4091fc 100644 --- a/ext/curl/tests/bug48203.phpt +++ b/ext/curl/tests/bug48203.phpt @@ -2,6 +2,11 @@ Bug #48203 (Crash when CURLOPT_STDERR is set to regular file) --SKIPIF-- <?php include 'skipif.inc'; ?> +<?php +if(substr(PHP_OS, 0, 3) == 'WIN' ) { + die('skip now for Windows'); +} +?> --FILE-- <?php include 'server.inc'; diff --git a/ext/curl/tests/bug48203_multi.phpt b/ext/curl/tests/bug48203_multi.phpt index e28c990e93..5f9e2ba6b2 100644 --- a/ext/curl/tests/bug48203_multi.phpt +++ b/ext/curl/tests/bug48203_multi.phpt @@ -7,7 +7,7 @@ include 'skipif.inc'; --FILE-- <?php include 'server.inc'; -function checkForClosedFilePointer($curl_option, $description) { +function checkForClosedFilePointer($target_url, $curl_option, $description) { $fp = fopen(dirname(__FILE__) . '/bug48203.tmp', 'w'); $ch1 = curl_init(); @@ -16,7 +16,7 @@ function checkForClosedFilePointer($curl_option, $description) { $options = array( CURLOPT_RETURNTRANSFER => 1, $curl_option => $fp, - CURLOPT_URL => curl_cli_server_start() + CURLOPT_URL => $target_url, ); // we also need to set CURLOPT_VERBOSE to test CURLOPT_STDERR properly @@ -47,6 +47,10 @@ function checkForClosedFilePointer($curl_option, $description) { curl_multi_remove_handle($mh, $ch2); curl_multi_close($mh); + // Force curl to output results + fflush(STDERR); + fflush(STDOUT); + echo "Ok for $description\n"; } @@ -54,31 +58,34 @@ $options_to_check = array( "CURLOPT_STDERR", "CURLOPT_WRITEHEADER", "CURLOPT_FILE", "CURLOPT_INFILE" ); +$target_url = curl_cli_server_start(); foreach($options_to_check as $option) { - checkForClosedFilePointer(constant($option), $option); + checkForClosedFilePointer($target_url, constant($option), $option); } ?> --CLEAN-- <?php @unlink(dirname(__FILE__) . '/bug48203.tmp'); ?> --EXPECTF-- -Warning: curl_multi_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %sbug48203_multi.php on line 36 +Warning: curl_multi_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %s on line %d -Warning: curl_multi_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %sbug48203_multi.php on line 36 +Warning: curl_multi_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %s on line %d %A Ok for CURLOPT_STDERR -%A -Warning: curl_multi_exec(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in %sbug48203_multi.php on line 36 -Warning: curl_multi_exec(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in %sbug48203_multi.php on line 36 +Warning: curl_multi_exec(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in %s on line %d + +Warning: curl_multi_exec(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in %s on line %d Ok for CURLOPT_WRITEHEADER -Warning: curl_multi_exec(): CURLOPT_FILE resource has gone away, resetting to default in %sbug48203_multi.php on line 36 +Warning: curl_multi_exec(): CURLOPT_FILE resource has gone away, resetting to default in %s on line %d -Warning: curl_multi_exec(): CURLOPT_FILE resource has gone away, resetting to default in %sbug48203_multi.php on line 36 -%AOk for CURLOPT_FILE +Warning: curl_multi_exec(): CURLOPT_FILE resource has gone away, resetting to default in %s on line %d +Hello World! +Hello World!Hello World! +Hello World!Ok for CURLOPT_FILE -Warning: curl_multi_exec(): CURLOPT_INFILE resource has gone away, resetting to default in %sbug48203_multi.php on line 36 +Warning: curl_multi_exec(): CURLOPT_INFILE resource has gone away, resetting to default in %s on line %d -Warning: curl_multi_exec(): CURLOPT_INFILE resource has gone away, resetting to default in %sbug48203_multi.php on line 36 +Warning: curl_multi_exec(): CURLOPT_INFILE resource has gone away, resetting to default in %s on line %d Ok for CURLOPT_INFILE diff --git a/ext/curl/tests/bug54798-win32.phpt b/ext/curl/tests/bug54798-win32.phpt new file mode 100644 index 0000000000..c3b240dea7 --- /dev/null +++ b/ext/curl/tests/bug54798-win32.phpt @@ -0,0 +1,68 @@ +--TEST-- +Bug #54798 (Segfault when CURLOPT_STDERR file pointer is closed before calling curl_exec) +--SKIPIF-- +<?php +include 'skipif.inc'; +if(substr(PHP_OS, 0, 3) != 'WIN' ) { + die('skip Windows only'); +} +?> +--FILE-- +<?php + +function checkForClosedFilePointer($host, $curl_option, $description) { + $fp = fopen(dirname(__FILE__) . '/bug54798.tmp', 'w+'); + + $ch = curl_init(); + + // we also need CURLOPT_VERBOSE to be set to test CURLOPT_STDERR properly + if (CURLOPT_STDERR == $curl_option) { + curl_setopt($ch, CURLOPT_VERBOSE, 1); + } + + if (CURLOPT_INFILE == $curl_option) { + curl_setopt($ch, CURLOPT_UPLOAD, 1); + } + + curl_setopt($ch, $curl_option, $fp); + + curl_setopt($ch, CURLOPT_URL, $host); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + + fclose($fp); // <-- premature close of $fp caused a crash! + + curl_exec($ch); + + curl_close($ch); + + echo "Ok for $description\n"; +} + +$options_to_check = array( + "CURLOPT_STDERR", + "CURLOPT_WRITEHEADER", + "CURLOPT_FILE", + "CURLOPT_INFILE" +); + +include 'server.inc'; +$host = curl_cli_server_start(); +foreach($options_to_check as $option) { + checkForClosedFilePointer($host, constant($option), $option); +} + +?> +===DONE=== +--CLEAN-- +<?php @unlink(dirname(__FILE__) . '/bug54798.tmp'); ?> +--EXPECTF-- +%AOk for CURLOPT_STDERR + +%AOk for CURLOPT_WRITEHEADER + +%AHello World! +Hello World!Ok for CURLOPT_FILE + +%AOk for CURLOPT_INFILE +===DONE=== +%A diff --git a/ext/curl/tests/bug54798.phpt b/ext/curl/tests/bug54798.phpt index 4a9b999940..d2542815d4 100644 --- a/ext/curl/tests/bug54798.phpt +++ b/ext/curl/tests/bug54798.phpt @@ -3,6 +3,9 @@ Bug #54798 (Segfault when CURLOPT_STDERR file pointer is closed before calling c --SKIPIF-- <?php include 'skipif.inc'; +if(substr(PHP_OS, 0, 3) == 'WIN' ) { + die('skip not for Windows'); +} ?> --FILE-- <?php diff --git a/ext/curl/tests/bug61948-win32.phpt b/ext/curl/tests/bug61948-win32.phpt index 00f498f910..b91ccb7815 100644 --- a/ext/curl/tests/bug61948-win32.phpt +++ b/ext/curl/tests/bug61948-win32.phpt @@ -5,19 +5,28 @@ Bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction) if(substr(PHP_OS, 0, 3) != 'WIN' ) die("skip Not Valid for Linux"); ?> ---INI-- -open_basedir="c:/tmp" --FILE-- <?php + $base_dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug61948"; + mkdir($base_dir . DIRECTORY_SEPARATOR . "foo", 0755, true); + + ini_set("open_basedir", $base_dir); + $ch = curl_init(); var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "")); - var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "c:/tmp/foo")); + var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "$base_dir/foo")); var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "c:/xxx/bar")); curl_close($ch); ?> +--CLEAN-- +<?php + $base_dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug61948"; + rmdir("$base_dir/foo"); + rmdir($base_dir); +?> --EXPECTF-- %a bool(true) -Warning: curl_setopt(): open_basedir restriction in effect. File(c:/xxx/bar) is not within the allowed path(s): (c:/tmp) in %sbug61948-win32.php on line %d +Warning: curl_setopt(): open_basedir restriction in effect. File(c:/xxx/bar) is not within the allowed path(s): (%sbug61948) in %sbug61948-win32.php on line %d bool(false) diff --git a/ext/curl/tests/server.inc b/ext/curl/tests/server.inc index 6d96a9850c..315fd68cc4 100644 --- a/ext/curl/tests/server.inc +++ b/ext/curl/tests/server.inc @@ -9,48 +9,64 @@ function curl_cli_server_start() { return getenv('PHP_CURL_HTTP_REMOTE_SERVER'); } - $php_executable = getenv('TEST_PHP_EXECUTABLE'); - $doc_root = __DIR__; - $router = "responder/get.php"; - - $descriptorspec = array( - 0 => STDIN, - 1 => STDOUT, - 2 => STDERR, - ); - - if (substr(PHP_OS, 0, 3) == 'WIN') { - $cmd = "{$php_executable} -t {$doc_root} -n -S " . PHP_CURL_SERVER_ADDRESS; + $php_executable = getenv('TEST_PHP_EXECUTABLE'); + $doc_root = __DIR__; + $router = "responder/get.php"; + + $descriptorspec = array( + 0 => STDIN, + 1 => STDOUT, + 2 => STDERR, + ); + + if (substr(PHP_OS, 0, 3) == 'WIN') { + $cmd = "{$php_executable} -t {$doc_root} -n -S " . PHP_CURL_SERVER_ADDRESS; + $cmd .= " {$router}"; + $handle = proc_open(addslashes($cmd), $descriptorspec, $pipes, $doc_root, NULL, array("bypass_shell" => true, "suppress_errors" => true)); + } else { + $cmd = "exec {$php_executable} -t {$doc_root} -n -S " . PHP_CURL_SERVER_ADDRESS; $cmd .= " {$router}"; - $handle = proc_open(addslashes($cmd), $descriptorspec, $pipes, $doc_root, NULL, array("bypass_shell" => true, "suppress_errors" => true)); - } else { - $cmd = "exec {$php_executable} -t {$doc_root} -n -S " . PHP_CURL_SERVER_ADDRESS; - $cmd .= " {$router}"; - $cmd .= " 2>/dev/null"; - - $handle = proc_open($cmd, $descriptorspec, $pipes, $doc_root); - } + $cmd .= " 2>/dev/null"; + + $handle = proc_open($cmd, $descriptorspec, $pipes, $doc_root); + } - // note: even when server prints 'Listening on localhost:8964...Press Ctrl-C to quit.' - // it might not be listening yet...need to wait until fsockopen() call returns - $i = 0; - while (($i++ < 30) && !($fp = @fsockopen(PHP_CURL_SERVER_HOSTNAME, PHP_CURL_SERVER_PORT))) { - usleep(10000); + // note: even when server prints 'Listening on localhost:8964...Press Ctrl-C to quit.' + // it might not be listening yet...need to wait until fsockopen() call returns + $error = "Unable to connect to servers\n"; + for ($i=0; $i < 60; $i++) { + usleep(25000); // 25ms per try + $status = proc_get_status($handle); + $fp = @fsockopen(PHP_CURL_SERVER_HOSTNAME, PHP_CURL_SERVER_PORT); + // Failure, the server is no longer running + if (!($status && $status['running'])) { + $error = "Server is not running\n"; + break; + } + // Success, Connected to servers + if ($fp) { + $error = ''; + break; + } } if ($fp) { fclose($fp); } - register_shutdown_function( - function($handle) use($router) { - proc_terminate($handle); - }, - $handle - ); - // don't bother sleeping, server is already up - // server can take a variable amount of time to be up, so just sleeping a guessed amount of time - // does not work. this is why tests sometimes pass and sometimes fail. to get a reliable pass - // sleeping doesn't work. + if ($error) { + echo $error; + proc_terminate($handle); + exit(1); + } + + register_shutdown_function( + function($handle) use($router) { + proc_terminate($handle); + }, + $handle + ); + return PHP_CURL_SERVER_ADDRESS; } + diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c index a23dc81db2..ce7e58d950 100644 --- a/ext/date/lib/parse_date.c +++ b/ext/date/lib/parse_date.c @@ -828,7 +828,7 @@ std: -#line 832 "<stdout>" +#line 832 "ext/date/lib/parse_date.c" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -976,7 +976,7 @@ yy3: TIMELIB_DEINIT; return TIMELIB_TIMEZONE; } -#line 980 "<stdout>" +#line 980 "ext/date/lib/parse_date.c" yy4: yych = *++YYCURSOR; if (yych <= 'E') { @@ -1281,7 +1281,7 @@ yy12: add_error(s, "Unexpected character"); goto std; } -#line 1285 "<stdout>" +#line 1285 "ext/date/lib/parse_date.c" yy13: yych = *++YYCURSOR; if (yych <= 'R') { @@ -2299,7 +2299,7 @@ yy49: { goto std; } -#line 2303 "<stdout>" +#line 2303 "ext/date/lib/parse_date.c" yy50: yych = *++YYCURSOR; goto yy49; @@ -2310,7 +2310,7 @@ yy51: s->pos = cursor; s->line++; goto std; } -#line 2314 "<stdout>" +#line 2314 "ext/date/lib/parse_date.c" yy53: yych = *++YYCURSOR; goto yy12; @@ -2692,7 +2692,7 @@ yy72: TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 2696 "<stdout>" +#line 2696 "ext/date/lib/parse_date.c" yy73: yych = *++YYCURSOR; if (yych == 'D') goto yy74; @@ -3377,7 +3377,7 @@ yy166: TIMELIB_DEINIT; return TIMELIB_WEEKDAY; } -#line 3381 "<stdout>" +#line 3381 "ext/date/lib/parse_date.c" yy167: yych = *++YYCURSOR; if (yych <= 'K') { @@ -3879,7 +3879,7 @@ yy193: TIMELIB_DEINIT; return TIMELIB_DATE_TEXT; } -#line 3883 "<stdout>" +#line 3883 "ext/date/lib/parse_date.c" yy194: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 21) YYFILL(21); @@ -3938,7 +3938,7 @@ yy198: TIMELIB_DEINIT; return TIMELIB_DATE_TEXT; } -#line 3942 "<stdout>" +#line 3942 "ext/date/lib/parse_date.c" yy199: yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); @@ -4212,7 +4212,7 @@ yy222: TIMELIB_DEINIT; return TIMELIB_SHORTDATE_WITH_TIME; } -#line 4216 "<stdout>" +#line 4216 "ext/date/lib/parse_date.c" yy223: yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); @@ -4877,7 +4877,7 @@ yy277: TIMELIB_DEINIT; return TIMELIB_SHORTDATE_WITH_TIME; } -#line 4881 "<stdout>" +#line 4881 "ext/date/lib/parse_date.c" yy279: yych = *++YYCURSOR; if (yych <= 0x1F) { @@ -5052,7 +5052,7 @@ yy294: TIMELIB_DEINIT; return TIMELIB_DATE_NO_DAY; } -#line 5056 "<stdout>" +#line 5056 "ext/date/lib/parse_date.c" yy295: yych = *++YYCURSOR; if (yych <= '/') { @@ -6216,7 +6216,7 @@ yy363: TIMELIB_DEINIT; return TIMELIB_PG_TEXT; } -#line 6220 "<stdout>" +#line 6220 "ext/date/lib/parse_date.c" yy364: yych = *++YYCURSOR; if (yych <= '/') goto yy363; @@ -6845,7 +6845,7 @@ yy392: TIMELIB_DEINIT; return TIMELIB_AGO; } -#line 6849 "<stdout>" +#line 6849 "ext/date/lib/parse_date.c" yy393: yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); @@ -8544,7 +8544,7 @@ yy454: TIMELIB_DEINIT; return TIMELIB_ISO_DATE; } -#line 8548 "<stdout>" +#line 8548 "ext/date/lib/parse_date.c" yy455: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); @@ -9091,7 +9091,7 @@ yy475: TIMELIB_DEINIT; return TIMELIB_DATE_TEXT; } -#line 9095 "<stdout>" +#line 9095 "ext/date/lib/parse_date.c" yy476: yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); @@ -9235,7 +9235,7 @@ yy487: TIMELIB_DEINIT; return TIMELIB_TIME12; } -#line 9239 "<stdout>" +#line 9239 "ext/date/lib/parse_date.c" yy489: yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); @@ -9271,7 +9271,7 @@ yy490: TIMELIB_DEINIT; return TIMELIB_TIME24_WITH_ZONE; } -#line 9275 "<stdout>" +#line 9275 "ext/date/lib/parse_date.c" yy491: yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); @@ -9567,7 +9567,7 @@ yy522: TIMELIB_DEINIT; return TIMELIB_TIME24_WITH_ZONE; } -#line 9571 "<stdout>" +#line 9571 "ext/date/lib/parse_date.c" yy524: yyaccept = 11; YYMARKER = ++YYCURSOR; @@ -9676,7 +9676,7 @@ yy534: TIMELIB_DEINIT; return TIMELIB_DATE_FULL; } -#line 9680 "<stdout>" +#line 9680 "ext/date/lib/parse_date.c" yy535: yych = *++YYCURSOR; if (yych == 'M') goto yy536; @@ -10351,7 +10351,7 @@ yy604: TIMELIB_DEINIT; return TIMELIB_DATE_FULL_POINTED; } -#line 10355 "<stdout>" +#line 10355 "ext/date/lib/parse_date.c" yy607: yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); @@ -10395,7 +10395,7 @@ yy611: TIMELIB_DEINIT; return TIMELIB_DATE_FULL_POINTED; } -#line 10399 "<stdout>" +#line 10399 "ext/date/lib/parse_date.c" yy612: yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); @@ -11004,7 +11004,7 @@ yy656: TIMELIB_DEINIT; return TIMELIB_ISO_DATE; } -#line 11008 "<stdout>" +#line 11008 "ext/date/lib/parse_date.c" yy657: yyaccept = 13; yych = *(YYMARKER = ++YYCURSOR); @@ -11115,7 +11115,7 @@ yy666: TIMELIB_DEINIT; return TIMELIB_AMERICAN; } -#line 11119 "<stdout>" +#line 11119 "ext/date/lib/parse_date.c" yy667: yyaccept = 14; yych = *(YYMARKER = ++YYCURSOR); @@ -11334,7 +11334,7 @@ yy700: TIMELIB_DEINIT; return TIMELIB_CLF; } -#line 11338 "<stdout>" +#line 11338 "ext/date/lib/parse_date.c" yy701: yych = *++YYCURSOR; if (yych <= '5') { @@ -11834,7 +11834,7 @@ yy763: TIMELIB_DEINIT; return TIMELIB_ISO_DATE; } -#line 11838 "<stdout>" +#line 11838 "ext/date/lib/parse_date.c" yy764: yych = *++YYCURSOR; if (yych == 'C') goto yy765; @@ -11878,7 +11878,7 @@ yy770: TIMELIB_DEINIT; return TIMELIB_PG_TEXT; } -#line 11882 "<stdout>" +#line 11882 "ext/date/lib/parse_date.c" yy772: yych = *++YYCURSOR; if (yych == 'V') goto yy765; @@ -12011,7 +12011,7 @@ yy783: TIMELIB_DEINIT; return TIMELIB_CLF; } -#line 12015 "<stdout>" +#line 12015 "ext/date/lib/parse_date.c" yy784: yych = *++YYCURSOR; switch (yych) { @@ -12162,7 +12162,7 @@ yy793: TIMELIB_DEINIT; return TIMELIB_DATE_NO_DAY; } -#line 12166 "<stdout>" +#line 12166 "ext/date/lib/parse_date.c" yy794: yych = *++YYCURSOR; if (yych == 'I') goto yy927; @@ -12374,7 +12374,7 @@ yy814: TIMELIB_DEINIT; return TIMELIB_ISO_WEEK; } -#line 12378 "<stdout>" +#line 12378 "ext/date/lib/parse_date.c" yy815: yych = *++YYCURSOR; if (yych <= '/') goto yy56; @@ -12399,7 +12399,7 @@ yy816: TIMELIB_DEINIT; return TIMELIB_ISO_WEEK; } -#line 12403 "<stdout>" +#line 12403 "ext/date/lib/parse_date.c" yy818: yych = *++YYCURSOR; if (yych <= '/') goto yy60; @@ -12472,7 +12472,7 @@ yy821: TIMELIB_DEINIT; return TIMELIB_PG_YEARDAY; } -#line 12476 "<stdout>" +#line 12476 "ext/date/lib/parse_date.c" yy822: yych = *++YYCURSOR; if (yych <= '/') goto yy60; @@ -12579,7 +12579,7 @@ yy842: TIMELIB_DEINIT; return TIMELIB_XMLRPC_SOAP; } -#line 12583 "<stdout>" +#line 12583 "ext/date/lib/parse_date.c" yy843: yych = *++YYCURSOR; if (yych <= '2') { @@ -12846,7 +12846,7 @@ yy848: TIMELIB_DEINIT; return TIMELIB_DATE_NOCOLON; } -#line 12850 "<stdout>" +#line 12850 "ext/date/lib/parse_date.c" yy849: yych = *++YYCURSOR; if (yych <= 'H') { @@ -13653,7 +13653,7 @@ yy973: TIMELIB_DEINIT; return TIMELIB_ISO_DATE; } -#line 13657 "<stdout>" +#line 13657 "ext/date/lib/parse_date.c" yy974: yyaccept = 22; yych = *(YYMARKER = ++YYCURSOR); @@ -14587,7 +14587,7 @@ yy1067: TIMELIB_DEINIT; return TIMELIB_GNU_NOCOLON; } -#line 14591 "<stdout>" +#line 14591 "ext/date/lib/parse_date.c" yy1068: yych = *++YYCURSOR; if (yych <= '/') goto yy60; @@ -14690,7 +14690,7 @@ yy1075: TIMELIB_DEINIT; return TIMELIB_ISO_NOCOLON; } -#line 14694 "<stdout>" +#line 14694 "ext/date/lib/parse_date.c" yy1076: yyaccept = 25; yych = *(YYMARKER = ++YYCURSOR); @@ -15562,7 +15562,7 @@ yy1117: TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 15566 "<stdout>" +#line 15566 "ext/date/lib/parse_date.c" yy1118: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); @@ -15625,7 +15625,7 @@ yy1125: TIMELIB_DEINIT; return TIMELIB_WEEK_DAY_OF_MONTH; } -#line 15629 "<stdout>" +#line 15629 "ext/date/lib/parse_date.c" yy1127: yyaccept = 26; yych = *(YYMARKER = ++YYCURSOR); @@ -15741,7 +15741,7 @@ yy1141: TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 15745 "<stdout>" +#line 15745 "ext/date/lib/parse_date.c" yy1142: yych = *++YYCURSOR; goto yy1117; @@ -18287,7 +18287,7 @@ yy1294: TIMELIB_DEINIT; return TIMELIB_LF_DAY_OF_MONTH; } -#line 18291 "<stdout>" +#line 18291 "ext/date/lib/parse_date.c" yy1295: yyaccept = 28; yych = *(YYMARKER = ++YYCURSOR); @@ -18542,7 +18542,7 @@ yy1315: TIMELIB_DEINIT; return TIMELIB_LF_DAY_OF_MONTH; } -#line 18546 "<stdout>" +#line 18546 "ext/date/lib/parse_date.c" yy1317: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); @@ -19927,7 +19927,7 @@ yy1387: TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 19931 "<stdout>" +#line 19931 "ext/date/lib/parse_date.c" yy1388: yych = *++YYCURSOR; if (yych <= 'N') { @@ -20344,7 +20344,7 @@ yy1417: TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 20348 "<stdout>" +#line 20348 "ext/date/lib/parse_date.c" yy1418: yych = *++YYCURSOR; if (yych <= 'Y') { @@ -20385,7 +20385,7 @@ yy1420: TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 20389 "<stdout>" +#line 20389 "ext/date/lib/parse_date.c" yy1421: yych = *++YYCURSOR; if (yych <= 'S') { @@ -22325,7 +22325,7 @@ yy1500: TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 22329 "<stdout>" +#line 22329 "ext/date/lib/parse_date.c" yy1501: yych = *++YYCURSOR; if (yych <= 'N') { @@ -22467,7 +22467,7 @@ yy1508: TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 22471 "<stdout>" +#line 22471 "ext/date/lib/parse_date.c" yy1509: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); @@ -22988,7 +22988,7 @@ yy1531: TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 22992 "<stdout>" +#line 22992 "ext/date/lib/parse_date.c" yy1532: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); diff --git a/ext/date/lib/timezonedb.h b/ext/date/lib/timezonedb.h index 2ae2e9a5d3..9f483bf750 100644 --- a/ext/date/lib/timezonedb.h +++ b/ext/date/lib/timezonedb.h @@ -1,5 +1,5 @@ /* This is a generated file, do not modify */ -const timelib_tzdb_index_entry timezonedb_idx_builtin[591] = { +const timelib_tzdb_index_entry timezonedb_idx_builtin[593] = { #ifdef TIMELIB_SUPPORTS_V2DATA # define FOR_V2(v2,v1) v2 #else @@ -242,365 +242,367 @@ const timelib_tzdb_index_entry timezonedb_idx_builtin[591] = { { "Asia/Amman" , FOR_V2(0x0416C3, 0x0197FF) }, { "Asia/Anadyr" , FOR_V2(0x041E24, 0x019ABA) }, { "Asia/Aqtau" , FOR_V2(0x042309, 0x019CB3) }, - { "Asia/Aqtobe" , FOR_V2(0x04273A, 0x019E7B) }, - { "Asia/Ashgabat" , FOR_V2(0x042B6A, 0x01A031) }, - { "Asia/Ashkhabad" , FOR_V2(0x042E01, 0x01A148) }, - { "Asia/Baghdad" , FOR_V2(0x043098, 0x01A25F) }, - { "Asia/Bahrain" , FOR_V2(0x043480, 0x01A3E5) }, - { "Asia/Baku" , FOR_V2(0x04355D, 0x01A450) }, - { "Asia/Bangkok" , FOR_V2(0x043A5E, 0x01A646) }, - { "Asia/Barnaul" , FOR_V2(0x043B36, 0x01A6AC) }, - { "Asia/Beirut" , FOR_V2(0x044037, 0x01A8AB) }, - { "Asia/Bishkek" , FOR_V2(0x0448C2, 0x01ABC9) }, - { "Asia/Brunei" , FOR_V2(0x044CE3, 0x01AD6F) }, - { "Asia/Calcutta" , FOR_V2(0x044DB8, 0x01ADD6) }, - { "Asia/Chita" , FOR_V2(0x044EE7, 0x01AE60) }, - { "Asia/Choibalsan" , FOR_V2(0x0453F0, 0x01B068) }, - { "Asia/Chongqing" , FOR_V2(0x045A3F, 0x01B2D4) }, - { "Asia/Chungking" , FOR_V2(0x045BE9, 0x01B385) }, - { "Asia/Colombo" , FOR_V2(0x045D93, 0x01B436) }, - { "Asia/Dacca" , FOR_V2(0x045F3C, 0x01B4F3) }, - { "Asia/Damascus" , FOR_V2(0x0460CE, 0x01B5AA) }, - { "Asia/Dhaka" , FOR_V2(0x0469EA, 0x01B8FF) }, - { "Asia/Dili" , FOR_V2(0x046B7C, 0x01B9B6) }, - { "Asia/Dubai" , FOR_V2(0x046CBD, 0x01BA4D) }, - { "Asia/Dushanbe" , FOR_V2(0x046D74, 0x01BAA7) }, - { "Asia/Famagusta" , FOR_V2(0x046FED, 0x01BBB1) }, - { "Asia/Gaza" , FOR_V2(0x0475AD, 0x01BDEC) }, - { "Asia/Harbin" , FOR_V2(0x047ECA, 0x01C150) }, - { "Asia/Hebron" , FOR_V2(0x048074, 0x01C201) }, - { "Asia/Ho_Chi_Minh" , FOR_V2(0x0489AC, 0x01C56E) }, - { "Asia/Hong_Kong" , FOR_V2(0x048B2D, 0x01C61D) }, - { "Asia/Hovd" , FOR_V2(0x048FDE, 0x01C7EC) }, - { "Asia/Irkutsk" , FOR_V2(0x0495FE, 0x01CA4F) }, - { "Asia/Istanbul" , FOR_V2(0x049B20, 0x01CC64) }, - { "Asia/Jakarta" , FOR_V2(0x04A3A2, 0x01CF9C) }, - { "Asia/Jayapura" , FOR_V2(0x04A52D, 0x01D056) }, - { "Asia/Jerusalem" , FOR_V2(0x04A660, 0x01D105) }, - { "Asia/Kabul" , FOR_V2(0x04AF45, 0x01D44D) }, - { "Asia/Kamchatka" , FOR_V2(0x04B018, 0x01D4AF) }, - { "Asia/Karachi" , FOR_V2(0x04B4E4, 0x01D69B) }, - { "Asia/Kashgar" , FOR_V2(0x04B683, 0x01D755) }, - { "Asia/Kathmandu" , FOR_V2(0x04B73A, 0x01D7AF) }, - { "Asia/Katmandu" , FOR_V2(0x04B81A, 0x01D81A) }, - { "Asia/Khandyga" , FOR_V2(0x04B8FA, 0x01D885) }, - { "Asia/Kolkata" , FOR_V2(0x04BE43, 0x01DAB0) }, - { "Asia/Krasnoyarsk" , FOR_V2(0x04BF72, 0x01DB3A) }, - { "Asia/Kuala_Lumpur" , FOR_V2(0x04C472, 0x01DD42) }, - { "Asia/Kuching" , FOR_V2(0x04C620, 0x01DE11) }, - { "Asia/Kuwait" , FOR_V2(0x04C841, 0x01DF03) }, - { "Asia/Macao" , FOR_V2(0x04C8F8, 0x01DF5D) }, - { "Asia/Macau" , FOR_V2(0x04CC1F, 0x01E09D) }, - { "Asia/Magadan" , FOR_V2(0x04CF46, 0x01E1DD) }, - { "Asia/Makassar" , FOR_V2(0x04D44C, 0x01E3E1) }, - { "Asia/Manila" , FOR_V2(0x04D5B9, 0x01E4B4) }, - { "Asia/Muscat" , FOR_V2(0x04D72E, 0x01E552) }, - { "Asia/Nicosia" , FOR_V2(0x04D7E5, 0x01E5AC) }, - { "Asia/Novokuznetsk" , FOR_V2(0x04DFE4, 0x01E8AC) }, - { "Asia/Novosibirsk" , FOR_V2(0x04E4AE, 0x01EA97) }, - { "Asia/Omsk" , FOR_V2(0x04E9B5, 0x01EC9C) }, - { "Asia/Oral" , FOR_V2(0x04EEA9, 0x01EE98) }, - { "Asia/Phnom_Penh" , FOR_V2(0x04F2CB, 0x01F048) }, - { "Asia/Pontianak" , FOR_V2(0x04F3A3, 0x01F0AE) }, - { "Asia/Pyongyang" , FOR_V2(0x04F53C, 0x01F176) }, - { "Asia/Qatar" , FOR_V2(0x04F680, 0x01F20D) }, - { "Asia/Qyzylorda" , FOR_V2(0x04F75D, 0x01F278) }, - { "Asia/Rangoon" , FOR_V2(0x04FB9D, 0x01F43E) }, - { "Asia/Riyadh" , FOR_V2(0x04FCC6, 0x01F4C7) }, - { "Asia/Saigon" , FOR_V2(0x04FD7D, 0x01F521) }, - { "Asia/Sakhalin" , FOR_V2(0x04FEFE, 0x01F5D0) }, - { "Asia/Samarkand" , FOR_V2(0x0503F4, 0x01F7D0) }, - { "Asia/Seoul" , FOR_V2(0x05067C, 0x01F8E8) }, - { "Asia/Shanghai" , FOR_V2(0x0508C3, 0x01F9E0) }, - { "Asia/Singapore" , FOR_V2(0x050A79, 0x01FA9D) }, - { "Asia/Srednekolymsk" , FOR_V2(0x050C31, 0x01FB65) }, - { "Asia/Taipei" , FOR_V2(0x05113B, 0x01FD76) }, - { "Asia/Tashkent" , FOR_V2(0x051467, 0x01FEB8) }, - { "Asia/Tbilisi" , FOR_V2(0x0516FF, 0x01FFD8) }, - { "Asia/Tehran" , FOR_V2(0x051B43, 0x02018B) }, - { "Asia/Tel_Aviv" , FOR_V2(0x0521DD, 0x020406) }, - { "Asia/Thimbu" , FOR_V2(0x052AC2, 0x02074E) }, - { "Asia/Thimphu" , FOR_V2(0x052B9F, 0x0207B9) }, - { "Asia/Tokyo" , FOR_V2(0x052C7C, 0x020824) }, - { "Asia/Tomsk" , FOR_V2(0x052DEB, 0x0208BB) }, - { "Asia/Ujung_Pandang" , FOR_V2(0x0532EC, 0x020ABA) }, - { "Asia/Ulaanbaatar" , FOR_V2(0x053410, 0x020B44) }, - { "Asia/Ulan_Bator" , FOR_V2(0x053A1A, 0x020D91) }, - { "Asia/Urumqi" , FOR_V2(0x05400F, 0x020FC9) }, - { "Asia/Ust-Nera" , FOR_V2(0x0540D3, 0x021030) }, - { "Asia/Vientiane" , FOR_V2(0x0545FD, 0x021248) }, - { "Asia/Vladivostok" , FOR_V2(0x0546D5, 0x0212AE) }, - { "Asia/Yakutsk" , FOR_V2(0x054BD0, 0x0214B0) }, - { "Asia/Yangon" , FOR_V2(0x0550CA, 0x0216B2) }, - { "Asia/Yekaterinburg" , FOR_V2(0x0551F3, 0x02173B) }, - { "Asia/Yerevan" , FOR_V2(0x05570E, 0x021949) }, - { "Atlantic/Azores" , FOR_V2(0x055BC9, 0x021B26) }, - { "Atlantic/Bermuda" , FOR_V2(0x05697B, 0x02203A) }, - { "Atlantic/Canary" , FOR_V2(0x05715B, 0x022320) }, - { "Atlantic/Cape_Verde" , FOR_V2(0x0578EE, 0x0225FB) }, - { "Atlantic/Faeroe" , FOR_V2(0x0579F8, 0x022679) }, - { "Atlantic/Faroe" , FOR_V2(0x058129, 0x022922) }, - { "Atlantic/Jan_Mayen" , FOR_V2(0x05885A, 0x022BCB) }, - { "Atlantic/Madeira" , FOR_V2(0x059131, 0x022F0E) }, - { "Atlantic/Reykjavik" , FOR_V2(0x059EE2, 0x023428) }, - { "Atlantic/South_Georgia" , FOR_V2(0x05A394, 0x0235FA) }, - { "Atlantic/St_Helena" , FOR_V2(0x05A434, 0x02363E) }, - { "Atlantic/Stanley" , FOR_V2(0x05A4EA, 0x023698) }, - { "Australia/ACT" , FOR_V2(0x05A9D4, 0x02387F) }, - { "Australia/Adelaide" , FOR_V2(0x05B28F, 0x023BB3) }, - { "Australia/Brisbane" , FOR_V2(0x05BB68, 0x023EF2) }, - { "Australia/Broken_Hill" , FOR_V2(0x05BD4F, 0x023FCC) }, - { "Australia/Canberra" , FOR_V2(0x05C659, 0x02431D) }, - { "Australia/Currie" , FOR_V2(0x05CF14, 0x024651) }, - { "Australia/Darwin" , FOR_V2(0x05D7E5, 0x02499B) }, - { "Australia/Eucla" , FOR_V2(0x05D946, 0x024A34) }, - { "Australia/Hobart" , FOR_V2(0x05DB52, 0x024B1C) }, - { "Australia/LHI" , FOR_V2(0x05E492, 0x024E8D) }, - { "Australia/Lindeman" , FOR_V2(0x05EBE1, 0x02513F) }, - { "Australia/Lord_Howe" , FOR_V2(0x05EE16, 0x02523A) }, - { "Australia/Melbourne" , FOR_V2(0x05F575, 0x0254FC) }, - { "Australia/North" , FOR_V2(0x05FE38, 0x025838) }, - { "Australia/NSW" , FOR_V2(0x05FF87, 0x0258BF) }, - { "Australia/Perth" , FOR_V2(0x060842, 0x025BF3) }, - { "Australia/Queensland" , FOR_V2(0x060A4B, 0x025CDE) }, - { "Australia/South" , FOR_V2(0x060C1B, 0x025DA1) }, - { "Australia/Sydney" , FOR_V2(0x0614E5, 0x0260D1) }, - { "Australia/Tasmania" , FOR_V2(0x061DBC, 0x026421) }, - { "Australia/Victoria" , FOR_V2(0x0626E7, 0x02677D) }, - { "Australia/West" , FOR_V2(0x062FA2, 0x026AB1) }, - { "Australia/Yancowinna" , FOR_V2(0x06318D, 0x026B7E) }, - { "Brazil/Acre" , FOR_V2(0x063A7B, 0x026EB3) }, - { "Brazil/DeNoronha" , FOR_V2(0x063D17, 0x026FC4) }, - { "Brazil/East" , FOR_V2(0x063FFB, 0x0270E9) }, - { "Brazil/West" , FOR_V2(0x0647E6, 0x0273CB) }, - { "Canada/Atlantic" , FOR_V2(0x064A5A, 0x0274C8) }, - { "Canada/Central" , FOR_V2(0x0657D4, 0x0279B5) }, - { "Canada/East-Saskatchewan" , FOR_V2(0x06632B, 0x027DE0) }, - { "Canada/Eastern" , FOR_V2(0x066719, 0x027F6E) }, - { "Canada/Mountain" , FOR_V2(0x0674D4, 0x02846F) }, - { "Canada/Newfoundland" , FOR_V2(0x067E42, 0x0287EA) }, - { "Canada/Pacific" , FOR_V2(0x068C9E, 0x028D2E) }, - { "Canada/Saskatchewan" , FOR_V2(0x0697FF, 0x029158) }, - { "Canada/Yukon" , FOR_V2(0x069BED, 0x0292E6) }, - { "CET" , FOR_V2(0x06A426, 0x0295FA) }, - { "Chile/Continental" , FOR_V2(0x06AC68, 0x029903) }, - { "Chile/EasterIsland" , FOR_V2(0x06B647, 0x029CA7) }, - { "CST6CDT" , FOR_V2(0x06BF04, 0x029FE1) }, - { "Cuba" , FOR_V2(0x06C806, 0x02A332) }, - { "EET" , FOR_V2(0x06D197, 0x02A6B6) }, - { "Egypt" , FOR_V2(0x06D8F7, 0x02A969) }, - { "Eire" , FOR_V2(0x06E0B7, 0x02AC49) }, - { "EST" , FOR_V2(0x06EEAA, 0x02B16B) }, - { "EST5EDT" , FOR_V2(0x06EF35, 0x02B1AF) }, - { "Etc/GMT" , FOR_V2(0x06F837, 0x02B500) }, - { "Etc/GMT+0" , FOR_V2(0x06F8C2, 0x02B544) }, - { "Etc/GMT+1" , FOR_V2(0x06F94D, 0x02B588) }, - { "Etc/GMT+10" , FOR_V2(0x06F9ED, 0x02B5D6) }, - { "Etc/GMT+11" , FOR_V2(0x06FA8E, 0x02B624) }, - { "Etc/GMT+12" , FOR_V2(0x06FB2F, 0x02B672) }, - { "Etc/GMT+2" , FOR_V2(0x06FBD0, 0x02B6C0) }, - { "Etc/GMT+3" , FOR_V2(0x06FC70, 0x02B70E) }, - { "Etc/GMT+4" , FOR_V2(0x06FD10, 0x02B75C) }, - { "Etc/GMT+5" , FOR_V2(0x06FDB0, 0x02B7AA) }, - { "Etc/GMT+6" , FOR_V2(0x06FE50, 0x02B7F8) }, - { "Etc/GMT+7" , FOR_V2(0x06FEF0, 0x02B846) }, - { "Etc/GMT+8" , FOR_V2(0x06FF90, 0x02B894) }, - { "Etc/GMT+9" , FOR_V2(0x070030, 0x02B8E2) }, - { "Etc/GMT-0" , FOR_V2(0x0700D0, 0x02B930) }, - { "Etc/GMT-1" , FOR_V2(0x07015B, 0x02B974) }, - { "Etc/GMT-10" , FOR_V2(0x0701FC, 0x02B9C2) }, - { "Etc/GMT-11" , FOR_V2(0x07029E, 0x02BA10) }, - { "Etc/GMT-12" , FOR_V2(0x070340, 0x02BA5E) }, - { "Etc/GMT-13" , FOR_V2(0x0703E2, 0x02BAAC) }, - { "Etc/GMT-14" , FOR_V2(0x070484, 0x02BAFA) }, - { "Etc/GMT-2" , FOR_V2(0x070526, 0x02BB48) }, - { "Etc/GMT-3" , FOR_V2(0x0705C7, 0x02BB96) }, - { "Etc/GMT-4" , FOR_V2(0x070668, 0x02BBE4) }, - { "Etc/GMT-5" , FOR_V2(0x070709, 0x02BC32) }, - { "Etc/GMT-6" , FOR_V2(0x0707AA, 0x02BC80) }, - { "Etc/GMT-7" , FOR_V2(0x07084B, 0x02BCCE) }, - { "Etc/GMT-8" , FOR_V2(0x0708EC, 0x02BD1C) }, - { "Etc/GMT-9" , FOR_V2(0x07098D, 0x02BD6A) }, - { "Etc/GMT0" , FOR_V2(0x070A2E, 0x02BDB8) }, - { "Etc/Greenwich" , FOR_V2(0x070AB9, 0x02BDFC) }, - { "Etc/UCT" , FOR_V2(0x070B44, 0x02BE40) }, - { "Etc/Universal" , FOR_V2(0x070BCF, 0x02BE84) }, - { "Etc/UTC" , FOR_V2(0x070C5A, 0x02BEC8) }, - { "Etc/Zulu" , FOR_V2(0x070CE5, 0x02BF0C) }, - { "Europe/Amsterdam" , FOR_V2(0x070D70, 0x02BF50) }, - { "Europe/Andorra" , FOR_V2(0x0718FB, 0x02C39F) }, - { "Europe/Astrakhan" , FOR_V2(0x071FDE, 0x02C62C) }, - { "Europe/Athens" , FOR_V2(0x0724A9, 0x02C818) }, - { "Europe/Belfast" , FOR_V2(0x072D94, 0x02CB6C) }, - { "Europe/Belgrade" , FOR_V2(0x073C07, 0x02D0B4) }, - { "Europe/Berlin" , FOR_V2(0x0743B8, 0x02D38E) }, - { "Europe/Bratislava" , FOR_V2(0x074CF7, 0x02D709) }, - { "Europe/Brussels" , FOR_V2(0x0755E3, 0x02DA4C) }, - { "Europe/Bucharest" , FOR_V2(0x076189, 0x02DE94) }, - { "Europe/Budapest" , FOR_V2(0x076A42, 0x02E1CF) }, - { "Europe/Busingen" , FOR_V2(0x0773B3, 0x02E549) }, - { "Europe/Chisinau" , FOR_V2(0x077B45, 0x02E811) }, - { "Europe/Copenhagen" , FOR_V2(0x0784DE, 0x02EBB5) }, - { "Europe/Dublin" , FOR_V2(0x078D5A, 0x02EED0) }, - { "Europe/Gibraltar" , FOR_V2(0x079B4D, 0x02F3F2) }, - { "Europe/Guernsey" , FOR_V2(0x07A74E, 0x02F85A) }, - { "Europe/Helsinki" , FOR_V2(0x07B5C1, 0x02FDA2) }, - { "Europe/Isle_of_Man" , FOR_V2(0x07BD42, 0x030069) }, - { "Europe/Istanbul" , FOR_V2(0x07CBB5, 0x0305B1) }, - { "Europe/Jersey" , FOR_V2(0x07D437, 0x0308E9) }, - { "Europe/Kaliningrad" , FOR_V2(0x07E2AA, 0x030E31) }, - { "Europe/Kiev" , FOR_V2(0x07E8B8, 0x0310A2) }, - { "Europe/Kirov" , FOR_V2(0x07F109, 0x0313D5) }, - { "Europe/Lisbon" , FOR_V2(0x07F5B2, 0x0315B0) }, - { "Europe/Ljubljana" , FOR_V2(0x08034E, 0x031AC4) }, - { "Europe/London" , FOR_V2(0x080AFF, 0x031D9E) }, - { "Europe/Luxembourg" , FOR_V2(0x081972, 0x0322E6) }, - { "Europe/Madrid" , FOR_V2(0x08251C, 0x032741) }, - { "Europe/Malta" , FOR_V2(0x082F73, 0x032B20) }, - { "Europe/Mariehamn" , FOR_V2(0x0839C4, 0x032EEA) }, - { "Europe/Minsk" , FOR_V2(0x084145, 0x0331B1) }, - { "Europe/Monaco" , FOR_V2(0x0846AB, 0x0333D5) }, - { "Europe/Moscow" , FOR_V2(0x085240, 0x033821) }, - { "Europe/Nicosia" , FOR_V2(0x085868, 0x033AA1) }, - { "Europe/Oslo" , FOR_V2(0x086054, 0x033D8E) }, - { "Europe/Paris" , FOR_V2(0x08692B, 0x0340D1) }, - { "Europe/Podgorica" , FOR_V2(0x0874D2, 0x034528) }, - { "Europe/Prague" , FOR_V2(0x087C83, 0x034802) }, - { "Europe/Riga" , FOR_V2(0x08856F, 0x034B45) }, - { "Europe/Rome" , FOR_V2(0x088E36, 0x034E9B) }, - { "Europe/Samara" , FOR_V2(0x0898C6, 0x035274) }, - { "Europe/San_Marino" , FOR_V2(0x089DD0, 0x035483) }, - { "Europe/Sarajevo" , FOR_V2(0x08A860, 0x03585C) }, - { "Europe/Simferopol" , FOR_V2(0x08B011, 0x035B36) }, - { "Europe/Skopje" , FOR_V2(0x08B5FE, 0x035D98) }, - { "Europe/Sofia" , FOR_V2(0x08BDAF, 0x036072) }, - { "Europe/Stockholm" , FOR_V2(0x08C60D, 0x03638B) }, - { "Europe/Tallinn" , FOR_V2(0x08CD97, 0x03664B) }, - { "Europe/Tirane" , FOR_V2(0x08D62E, 0x036991) }, - { "Europe/Tiraspol" , FOR_V2(0x08DE6C, 0x036C9C) }, - { "Europe/Ulyanovsk" , FOR_V2(0x08E805, 0x037040) }, - { "Europe/Uzhgorod" , FOR_V2(0x08ED24, 0x037252) }, - { "Europe/Vaduz" , FOR_V2(0x08F56F, 0x03757A) }, - { "Europe/Vatican" , FOR_V2(0x08FCF9, 0x03783A) }, - { "Europe/Vienna" , FOR_V2(0x090789, 0x037C13) }, - { "Europe/Vilnius" , FOR_V2(0x091052, 0x037F51) }, - { "Europe/Volgograd" , FOR_V2(0x0918F5, 0x0382A1) }, - { "Europe/Warsaw" , FOR_V2(0x091DAB, 0x038489) }, - { "Europe/Zagreb" , FOR_V2(0x092848, 0x03887B) }, - { "Europe/Zaporozhye" , FOR_V2(0x092FF9, 0x038B55) }, - { "Europe/Zurich" , FOR_V2(0x093872, 0x038EA7) }, - { "Factory" , FOR_V2(0x093FFC, 0x039167) }, - { "GB" , FOR_V2(0x09409C, 0x0391B5) }, - { "GB-Eire" , FOR_V2(0x094F0F, 0x0396FD) }, - { "GMT" , FOR_V2(0x095D82, 0x039C45) }, - { "GMT+0" , FOR_V2(0x095E0D, 0x039C89) }, - { "GMT-0" , FOR_V2(0x095E98, 0x039CCD) }, - { "GMT0" , FOR_V2(0x095F23, 0x039D11) }, - { "Greenwich" , FOR_V2(0x095FAE, 0x039D55) }, - { "Hongkong" , FOR_V2(0x096039, 0x039D99) }, - { "HST" , FOR_V2(0x0964EA, 0x039F68) }, - { "Iceland" , FOR_V2(0x096576, 0x039FAC) }, - { "Indian/Antananarivo" , FOR_V2(0x096A28, 0x03A17E) }, - { "Indian/Chagos" , FOR_V2(0x096B4F, 0x03A20A) }, - { "Indian/Christmas" , FOR_V2(0x096C24, 0x03A271) }, - { "Indian/Cocos" , FOR_V2(0x096CC5, 0x03A2B5) }, - { "Indian/Comoro" , FOR_V2(0x096D69, 0x03A2F9) }, - { "Indian/Kerguelen" , FOR_V2(0x096E90, 0x03A385) }, - { "Indian/Mahe" , FOR_V2(0x096F57, 0x03A3E4) }, - { "Indian/Maldives" , FOR_V2(0x09700E, 0x03A43E) }, - { "Indian/Mauritius" , FOR_V2(0x0970E6, 0x03A4A4) }, - { "Indian/Mayotte" , FOR_V2(0x0971EF, 0x03A51F) }, - { "Indian/Reunion" , FOR_V2(0x097316, 0x03A5AB) }, - { "Iran" , FOR_V2(0x0973CD, 0x03A605) }, - { "Israel" , FOR_V2(0x097A67, 0x03A880) }, - { "Jamaica" , FOR_V2(0x09834C, 0x03ABC8) }, - { "Japan" , FOR_V2(0x098553, 0x03AC9E) }, - { "Kwajalein" , FOR_V2(0x0986C2, 0x03AD35) }, - { "Libya" , FOR_V2(0x0987BB, 0x03ADA9) }, - { "MET" , FOR_V2(0x098A56, 0x03AEB7) }, - { "Mexico/BajaNorte" , FOR_V2(0x099298, 0x03B1C0) }, - { "Mexico/BajaSur" , FOR_V2(0x099BD8, 0x03B52E) }, - { "Mexico/General" , FOR_V2(0x09A200, 0x03B780) }, - { "MST" , FOR_V2(0x09A85E, 0x03B9E3) }, - { "MST7MDT" , FOR_V2(0x09A8E9, 0x03BA27) }, - { "Navajo" , FOR_V2(0x09B1EB, 0x03BD78) }, - { "NZ" , FOR_V2(0x09BB8C, 0x03C102) }, - { "NZ-CHAT" , FOR_V2(0x09C534, 0x03C491) }, - { "Pacific/Apia" , FOR_V2(0x09CD49, 0x03C786) }, - { "Pacific/Auckland" , FOR_V2(0x09D1A3, 0x03C92F) }, - { "Pacific/Bougainville" , FOR_V2(0x09DB63, 0x03CCD6) }, - { "Pacific/Chatham" , FOR_V2(0x09DC93, 0x03CD5F) }, - { "Pacific/Chuuk" , FOR_V2(0x09E4B7, 0x03D063) }, - { "Pacific/Easter" , FOR_V2(0x09E56B, 0x03D0B7) }, - { "Pacific/Efate" , FOR_V2(0x09EE35, 0x03D3FE) }, - { "Pacific/Enderbury" , FOR_V2(0x09F01F, 0x03D4C9) }, - { "Pacific/Fakaofo" , FOR_V2(0x09F120, 0x03D548) }, - { "Pacific/Fiji" , FOR_V2(0x09F1F1, 0x03D5AA) }, - { "Pacific/Funafuti" , FOR_V2(0x09F62E, 0x03D742) }, - { "Pacific/Galapagos" , FOR_V2(0x09F6D0, 0x03D786) }, - { "Pacific/Gambier" , FOR_V2(0x09F7C0, 0x03D803) }, - { "Pacific/Guadalcanal" , FOR_V2(0x09F888, 0x03D86D) }, - { "Pacific/Guam" , FOR_V2(0x09F940, 0x03D8C7) }, - { "Pacific/Honolulu" , FOR_V2(0x09FA2D, 0x03D92E) }, - { "Pacific/Johnston" , FOR_V2(0x09FB53, 0x03D9B6) }, - { "Pacific/Kiritimati" , FOR_V2(0x09FC81, 0x03DA46) }, - { "Pacific/Kosrae" , FOR_V2(0x09FD7F, 0x03DAC2) }, - { "Pacific/Kwajalein" , FOR_V2(0x09FE77, 0x03DB38) }, - { "Pacific/Majuro" , FOR_V2(0x09FF79, 0x03DBB5) }, - { "Pacific/Marquesas" , FOR_V2(0x0A0067, 0x03DC34) }, - { "Pacific/Midway" , FOR_V2(0x0A0134, 0x03DCA0) }, - { "Pacific/Nauru" , FOR_V2(0x0A025E, 0x03DD32) }, - { "Pacific/Niue" , FOR_V2(0x0A0368, 0x03DDAF) }, - { "Pacific/Norfolk" , FOR_V2(0x0A0456, 0x03DE1E) }, - { "Pacific/Noumea" , FOR_V2(0x0A0583, 0x03DEA8) }, - { "Pacific/Pago_Pago" , FOR_V2(0x0A06C9, 0x03DF3D) }, - { "Pacific/Palau" , FOR_V2(0x0A07E5, 0x03DFC1) }, - { "Pacific/Pitcairn" , FOR_V2(0x0A0886, 0x03E005) }, - { "Pacific/Pohnpei" , FOR_V2(0x0A095D, 0x03E06B) }, - { "Pacific/Ponape" , FOR_V2(0x0A0A10, 0x03E0BE) }, - { "Pacific/Port_Moresby" , FOR_V2(0x0A0AB5, 0x03E103) }, - { "Pacific/Rarotonga" , FOR_V2(0x0A0B8A, 0x03E164) }, - { "Pacific/Saipan" , FOR_V2(0x0A0DD4, 0x03E251) }, - { "Pacific/Samoa" , FOR_V2(0x0A0EC1, 0x03E2B8) }, - { "Pacific/Tahiti" , FOR_V2(0x0A0FDD, 0x03E33C) }, - { "Pacific/Tarawa" , FOR_V2(0x0A10A6, 0x03E3A6) }, - { "Pacific/Tongatapu" , FOR_V2(0x0A115A, 0x03E3FA) }, - { "Pacific/Truk" , FOR_V2(0x0A1543, 0x03E578) }, - { "Pacific/Wake" , FOR_V2(0x0A15E8, 0x03E5BD) }, - { "Pacific/Wallis" , FOR_V2(0x0A1698, 0x03E60D) }, - { "Pacific/Yap" , FOR_V2(0x0A173A, 0x03E651) }, - { "Poland" , FOR_V2(0x0A17DF, 0x03E696) }, - { "Portugal" , FOR_V2(0x0A227C, 0x03EA88) }, - { "PRC" , FOR_V2(0x0A3005, 0x03EF89) }, - { "PST8PDT" , FOR_V2(0x0A31AF, 0x03F03A) }, - { "ROC" , FOR_V2(0x0A3AB1, 0x03F38B) }, - { "ROK" , FOR_V2(0x0A3DDD, 0x03F4CD) }, - { "Singapore" , FOR_V2(0x0A4024, 0x03F5C5) }, - { "Turkey" , FOR_V2(0x0A41DC, 0x03F68D) }, - { "UCT" , FOR_V2(0x0A4A5E, 0x03F9C5) }, - { "Universal" , FOR_V2(0x0A4AE9, 0x03FA09) }, - { "US/Alaska" , FOR_V2(0x0A4B74, 0x03FA4D) }, - { "US/Aleutian" , FOR_V2(0x0A54D0, 0x03FDC7) }, - { "US/Arizona" , FOR_V2(0x0A5E19, 0x040138) }, - { "US/Central" , FOR_V2(0x0A5F86, 0x0401D7) }, - { "US/East-Indiana" , FOR_V2(0x0A6D93, 0x0406FB) }, - { "US/Eastern" , FOR_V2(0x0A742A, 0x040976) }, - { "US/Hawaii" , FOR_V2(0x0A820F, 0x040E86) }, - { "US/Indiana-Starke" , FOR_V2(0x0A832F, 0x040F08) }, - { "US/Michigan" , FOR_V2(0x0A8CC0, 0x041292) }, - { "US/Mountain" , FOR_V2(0x0A9574, 0x0415CE) }, - { "US/Pacific" , FOR_V2(0x0A9F15, 0x041958) }, - { "US/Pacific-New" , FOR_V2(0x0AAA3E, 0x041D6E) }, - { "US/Samoa" , FOR_V2(0x0AB567, 0x042184) }, - { "UTC" , FOR_V2(0x0AB683, 0x042208) }, - { "W-SU" , FOR_V2(0x0AB70E, 0x04224C) }, - { "WET" , FOR_V2(0x0ABD22, 0x0424B8) }, - { "Zulu" , FOR_V2(0x0AC47F, 0x04276B) }, + { "Asia/Aqtobe" , FOR_V2(0x042723, 0x019E64) }, + { "Asia/Ashgabat" , FOR_V2(0x042B53, 0x01A01A) }, + { "Asia/Ashkhabad" , FOR_V2(0x042DEA, 0x01A131) }, + { "Asia/Atyrau" , FOR_V2(0x043081, 0x01A248) }, + { "Asia/Baghdad" , FOR_V2(0x04349B, 0x01A3F9) }, + { "Asia/Bahrain" , FOR_V2(0x043883, 0x01A57F) }, + { "Asia/Baku" , FOR_V2(0x043960, 0x01A5EA) }, + { "Asia/Bangkok" , FOR_V2(0x043E61, 0x01A7E0) }, + { "Asia/Barnaul" , FOR_V2(0x043F39, 0x01A846) }, + { "Asia/Beirut" , FOR_V2(0x04443A, 0x01AA45) }, + { "Asia/Bishkek" , FOR_V2(0x044CC5, 0x01AD63) }, + { "Asia/Brunei" , FOR_V2(0x0450E6, 0x01AF09) }, + { "Asia/Calcutta" , FOR_V2(0x0451BB, 0x01AF70) }, + { "Asia/Chita" , FOR_V2(0x0452EA, 0x01AFFA) }, + { "Asia/Choibalsan" , FOR_V2(0x0457F3, 0x01B202) }, + { "Asia/Chongqing" , FOR_V2(0x045E42, 0x01B46E) }, + { "Asia/Chungking" , FOR_V2(0x045FEC, 0x01B51F) }, + { "Asia/Colombo" , FOR_V2(0x046196, 0x01B5D0) }, + { "Asia/Dacca" , FOR_V2(0x04633F, 0x01B68D) }, + { "Asia/Damascus" , FOR_V2(0x0464D1, 0x01B744) }, + { "Asia/Dhaka" , FOR_V2(0x046DED, 0x01BA99) }, + { "Asia/Dili" , FOR_V2(0x046F7F, 0x01BB50) }, + { "Asia/Dubai" , FOR_V2(0x0470C0, 0x01BBE7) }, + { "Asia/Dushanbe" , FOR_V2(0x047177, 0x01BC41) }, + { "Asia/Famagusta" , FOR_V2(0x0473F0, 0x01BD4B) }, + { "Asia/Gaza" , FOR_V2(0x0479B0, 0x01BF86) }, + { "Asia/Harbin" , FOR_V2(0x0482BD, 0x01C2E2) }, + { "Asia/Hebron" , FOR_V2(0x048467, 0x01C393) }, + { "Asia/Ho_Chi_Minh" , FOR_V2(0x048D8F, 0x01C6F8) }, + { "Asia/Hong_Kong" , FOR_V2(0x048F10, 0x01C7A7) }, + { "Asia/Hovd" , FOR_V2(0x0493C1, 0x01C976) }, + { "Asia/Irkutsk" , FOR_V2(0x0499E1, 0x01CBD9) }, + { "Asia/Istanbul" , FOR_V2(0x049F03, 0x01CDEE) }, + { "Asia/Jakarta" , FOR_V2(0x04A785, 0x01D126) }, + { "Asia/Jayapura" , FOR_V2(0x04A910, 0x01D1E0) }, + { "Asia/Jerusalem" , FOR_V2(0x04AA43, 0x01D28F) }, + { "Asia/Kabul" , FOR_V2(0x04B328, 0x01D5D7) }, + { "Asia/Kamchatka" , FOR_V2(0x04B3FB, 0x01D639) }, + { "Asia/Karachi" , FOR_V2(0x04B8C7, 0x01D825) }, + { "Asia/Kashgar" , FOR_V2(0x04BA66, 0x01D8DF) }, + { "Asia/Kathmandu" , FOR_V2(0x04BB1D, 0x01D939) }, + { "Asia/Katmandu" , FOR_V2(0x04BBFD, 0x01D9A4) }, + { "Asia/Khandyga" , FOR_V2(0x04BCDD, 0x01DA0F) }, + { "Asia/Kolkata" , FOR_V2(0x04C226, 0x01DC3A) }, + { "Asia/Krasnoyarsk" , FOR_V2(0x04C355, 0x01DCC4) }, + { "Asia/Kuala_Lumpur" , FOR_V2(0x04C855, 0x01DECC) }, + { "Asia/Kuching" , FOR_V2(0x04CA03, 0x01DF9B) }, + { "Asia/Kuwait" , FOR_V2(0x04CC24, 0x01E08D) }, + { "Asia/Macao" , FOR_V2(0x04CCDB, 0x01E0E7) }, + { "Asia/Macau" , FOR_V2(0x04D002, 0x01E227) }, + { "Asia/Magadan" , FOR_V2(0x04D329, 0x01E367) }, + { "Asia/Makassar" , FOR_V2(0x04D82F, 0x01E56B) }, + { "Asia/Manila" , FOR_V2(0x04D99C, 0x01E63E) }, + { "Asia/Muscat" , FOR_V2(0x04DB11, 0x01E6DC) }, + { "Asia/Nicosia" , FOR_V2(0x04DBC8, 0x01E736) }, + { "Asia/Novokuznetsk" , FOR_V2(0x04E3C7, 0x01EA36) }, + { "Asia/Novosibirsk" , FOR_V2(0x04E891, 0x01EC21) }, + { "Asia/Omsk" , FOR_V2(0x04ED98, 0x01EE26) }, + { "Asia/Oral" , FOR_V2(0x04F28C, 0x01F022) }, + { "Asia/Phnom_Penh" , FOR_V2(0x04F6AE, 0x01F1D2) }, + { "Asia/Pontianak" , FOR_V2(0x04F786, 0x01F238) }, + { "Asia/Pyongyang" , FOR_V2(0x04F91F, 0x01F300) }, + { "Asia/Qatar" , FOR_V2(0x04FA63, 0x01F397) }, + { "Asia/Qyzylorda" , FOR_V2(0x04FB40, 0x01F402) }, + { "Asia/Rangoon" , FOR_V2(0x04FF80, 0x01F5C8) }, + { "Asia/Riyadh" , FOR_V2(0x0500A9, 0x01F651) }, + { "Asia/Saigon" , FOR_V2(0x050160, 0x01F6AB) }, + { "Asia/Sakhalin" , FOR_V2(0x0502E1, 0x01F75A) }, + { "Asia/Samarkand" , FOR_V2(0x0507D7, 0x01F95A) }, + { "Asia/Seoul" , FOR_V2(0x050A5F, 0x01FA72) }, + { "Asia/Shanghai" , FOR_V2(0x050CA6, 0x01FB6A) }, + { "Asia/Singapore" , FOR_V2(0x050E5C, 0x01FC27) }, + { "Asia/Srednekolymsk" , FOR_V2(0x051014, 0x01FCEF) }, + { "Asia/Taipei" , FOR_V2(0x05151E, 0x01FF00) }, + { "Asia/Tashkent" , FOR_V2(0x05184A, 0x020042) }, + { "Asia/Tbilisi" , FOR_V2(0x051AE2, 0x020162) }, + { "Asia/Tehran" , FOR_V2(0x051F26, 0x020315) }, + { "Asia/Tel_Aviv" , FOR_V2(0x0525C0, 0x020590) }, + { "Asia/Thimbu" , FOR_V2(0x052EA5, 0x0208D8) }, + { "Asia/Thimphu" , FOR_V2(0x052F82, 0x020943) }, + { "Asia/Tokyo" , FOR_V2(0x05305F, 0x0209AE) }, + { "Asia/Tomsk" , FOR_V2(0x0531CE, 0x020A45) }, + { "Asia/Ujung_Pandang" , FOR_V2(0x0536CF, 0x020C44) }, + { "Asia/Ulaanbaatar" , FOR_V2(0x0537F3, 0x020CCE) }, + { "Asia/Ulan_Bator" , FOR_V2(0x053DFD, 0x020F1B) }, + { "Asia/Urumqi" , FOR_V2(0x0543F2, 0x021153) }, + { "Asia/Ust-Nera" , FOR_V2(0x0544B6, 0x0211BA) }, + { "Asia/Vientiane" , FOR_V2(0x0549E0, 0x0213D2) }, + { "Asia/Vladivostok" , FOR_V2(0x054AB8, 0x021438) }, + { "Asia/Yakutsk" , FOR_V2(0x054FB3, 0x02163A) }, + { "Asia/Yangon" , FOR_V2(0x0554AD, 0x02183C) }, + { "Asia/Yekaterinburg" , FOR_V2(0x0555D6, 0x0218C5) }, + { "Asia/Yerevan" , FOR_V2(0x055AF1, 0x021AD3) }, + { "Atlantic/Azores" , FOR_V2(0x055FAC, 0x021CB0) }, + { "Atlantic/Bermuda" , FOR_V2(0x056D5E, 0x0221C4) }, + { "Atlantic/Canary" , FOR_V2(0x05753E, 0x0224AA) }, + { "Atlantic/Cape_Verde" , FOR_V2(0x057CD1, 0x022785) }, + { "Atlantic/Faeroe" , FOR_V2(0x057DDB, 0x022803) }, + { "Atlantic/Faroe" , FOR_V2(0x05850C, 0x022AAC) }, + { "Atlantic/Jan_Mayen" , FOR_V2(0x058C3D, 0x022D55) }, + { "Atlantic/Madeira" , FOR_V2(0x059514, 0x023098) }, + { "Atlantic/Reykjavik" , FOR_V2(0x05A2C5, 0x0235B2) }, + { "Atlantic/South_Georgia" , FOR_V2(0x05A777, 0x023784) }, + { "Atlantic/St_Helena" , FOR_V2(0x05A817, 0x0237C8) }, + { "Atlantic/Stanley" , FOR_V2(0x05A8CD, 0x023822) }, + { "Australia/ACT" , FOR_V2(0x05ADB7, 0x023A09) }, + { "Australia/Adelaide" , FOR_V2(0x05B672, 0x023D3D) }, + { "Australia/Brisbane" , FOR_V2(0x05BF4B, 0x02407C) }, + { "Australia/Broken_Hill" , FOR_V2(0x05C132, 0x024156) }, + { "Australia/Canberra" , FOR_V2(0x05CA3C, 0x0244A7) }, + { "Australia/Currie" , FOR_V2(0x05D2F7, 0x0247DB) }, + { "Australia/Darwin" , FOR_V2(0x05DBC8, 0x024B25) }, + { "Australia/Eucla" , FOR_V2(0x05DD29, 0x024BBE) }, + { "Australia/Hobart" , FOR_V2(0x05DF35, 0x024CA6) }, + { "Australia/LHI" , FOR_V2(0x05E875, 0x025017) }, + { "Australia/Lindeman" , FOR_V2(0x05EFC4, 0x0252C9) }, + { "Australia/Lord_Howe" , FOR_V2(0x05F1F9, 0x0253C4) }, + { "Australia/Melbourne" , FOR_V2(0x05F958, 0x025686) }, + { "Australia/North" , FOR_V2(0x06021B, 0x0259C2) }, + { "Australia/NSW" , FOR_V2(0x06036A, 0x025A49) }, + { "Australia/Perth" , FOR_V2(0x060C25, 0x025D7D) }, + { "Australia/Queensland" , FOR_V2(0x060E2E, 0x025E68) }, + { "Australia/South" , FOR_V2(0x060FFE, 0x025F2B) }, + { "Australia/Sydney" , FOR_V2(0x0618C8, 0x02625B) }, + { "Australia/Tasmania" , FOR_V2(0x06219F, 0x0265AB) }, + { "Australia/Victoria" , FOR_V2(0x062ACA, 0x026907) }, + { "Australia/West" , FOR_V2(0x063385, 0x026C3B) }, + { "Australia/Yancowinna" , FOR_V2(0x063570, 0x026D08) }, + { "Brazil/Acre" , FOR_V2(0x063E5E, 0x02703D) }, + { "Brazil/DeNoronha" , FOR_V2(0x0640FA, 0x02714E) }, + { "Brazil/East" , FOR_V2(0x0643DE, 0x027273) }, + { "Brazil/West" , FOR_V2(0x064BC9, 0x027555) }, + { "Canada/Atlantic" , FOR_V2(0x064E3D, 0x027652) }, + { "Canada/Central" , FOR_V2(0x065BB7, 0x027B3F) }, + { "Canada/East-Saskatchewan" , FOR_V2(0x06670E, 0x027F6A) }, + { "Canada/Eastern" , FOR_V2(0x066AFC, 0x0280F8) }, + { "Canada/Mountain" , FOR_V2(0x0678B7, 0x0285F9) }, + { "Canada/Newfoundland" , FOR_V2(0x068225, 0x028974) }, + { "Canada/Pacific" , FOR_V2(0x069081, 0x028EB8) }, + { "Canada/Saskatchewan" , FOR_V2(0x069BE2, 0x0292E2) }, + { "Canada/Yukon" , FOR_V2(0x069FD0, 0x029470) }, + { "CET" , FOR_V2(0x06A809, 0x029784) }, + { "Chile/Continental" , FOR_V2(0x06B04B, 0x029A8D) }, + { "Chile/EasterIsland" , FOR_V2(0x06BA2A, 0x029E31) }, + { "CST6CDT" , FOR_V2(0x06C2E7, 0x02A16B) }, + { "Cuba" , FOR_V2(0x06CBE9, 0x02A4BC) }, + { "EET" , FOR_V2(0x06D57A, 0x02A840) }, + { "Egypt" , FOR_V2(0x06DCDA, 0x02AAF3) }, + { "Eire" , FOR_V2(0x06E49A, 0x02ADD3) }, + { "EST" , FOR_V2(0x06F28D, 0x02B2F5) }, + { "EST5EDT" , FOR_V2(0x06F318, 0x02B339) }, + { "Etc/GMT" , FOR_V2(0x06FC1A, 0x02B68A) }, + { "Etc/GMT+0" , FOR_V2(0x06FCA5, 0x02B6CE) }, + { "Etc/GMT+1" , FOR_V2(0x06FD30, 0x02B712) }, + { "Etc/GMT+10" , FOR_V2(0x06FDD0, 0x02B760) }, + { "Etc/GMT+11" , FOR_V2(0x06FE71, 0x02B7AE) }, + { "Etc/GMT+12" , FOR_V2(0x06FF12, 0x02B7FC) }, + { "Etc/GMT+2" , FOR_V2(0x06FFB3, 0x02B84A) }, + { "Etc/GMT+3" , FOR_V2(0x070053, 0x02B898) }, + { "Etc/GMT+4" , FOR_V2(0x0700F3, 0x02B8E6) }, + { "Etc/GMT+5" , FOR_V2(0x070193, 0x02B934) }, + { "Etc/GMT+6" , FOR_V2(0x070233, 0x02B982) }, + { "Etc/GMT+7" , FOR_V2(0x0702D3, 0x02B9D0) }, + { "Etc/GMT+8" , FOR_V2(0x070373, 0x02BA1E) }, + { "Etc/GMT+9" , FOR_V2(0x070413, 0x02BA6C) }, + { "Etc/GMT-0" , FOR_V2(0x0704B3, 0x02BABA) }, + { "Etc/GMT-1" , FOR_V2(0x07053E, 0x02BAFE) }, + { "Etc/GMT-10" , FOR_V2(0x0705DF, 0x02BB4C) }, + { "Etc/GMT-11" , FOR_V2(0x070681, 0x02BB9A) }, + { "Etc/GMT-12" , FOR_V2(0x070723, 0x02BBE8) }, + { "Etc/GMT-13" , FOR_V2(0x0707C5, 0x02BC36) }, + { "Etc/GMT-14" , FOR_V2(0x070867, 0x02BC84) }, + { "Etc/GMT-2" , FOR_V2(0x070909, 0x02BCD2) }, + { "Etc/GMT-3" , FOR_V2(0x0709AA, 0x02BD20) }, + { "Etc/GMT-4" , FOR_V2(0x070A4B, 0x02BD6E) }, + { "Etc/GMT-5" , FOR_V2(0x070AEC, 0x02BDBC) }, + { "Etc/GMT-6" , FOR_V2(0x070B8D, 0x02BE0A) }, + { "Etc/GMT-7" , FOR_V2(0x070C2E, 0x02BE58) }, + { "Etc/GMT-8" , FOR_V2(0x070CCF, 0x02BEA6) }, + { "Etc/GMT-9" , FOR_V2(0x070D70, 0x02BEF4) }, + { "Etc/GMT0" , FOR_V2(0x070E11, 0x02BF42) }, + { "Etc/Greenwich" , FOR_V2(0x070E9C, 0x02BF86) }, + { "Etc/UCT" , FOR_V2(0x070F27, 0x02BFCA) }, + { "Etc/Universal" , FOR_V2(0x070FB2, 0x02C00E) }, + { "Etc/UTC" , FOR_V2(0x07103D, 0x02C052) }, + { "Etc/Zulu" , FOR_V2(0x0710C8, 0x02C096) }, + { "Europe/Amsterdam" , FOR_V2(0x071153, 0x02C0DA) }, + { "Europe/Andorra" , FOR_V2(0x071CDE, 0x02C529) }, + { "Europe/Astrakhan" , FOR_V2(0x0723C1, 0x02C7B6) }, + { "Europe/Athens" , FOR_V2(0x07288C, 0x02C9A2) }, + { "Europe/Belfast" , FOR_V2(0x073177, 0x02CCF6) }, + { "Europe/Belgrade" , FOR_V2(0x073FEA, 0x02D23E) }, + { "Europe/Berlin" , FOR_V2(0x07479B, 0x02D518) }, + { "Europe/Bratislava" , FOR_V2(0x0750DA, 0x02D893) }, + { "Europe/Brussels" , FOR_V2(0x0759C6, 0x02DBD6) }, + { "Europe/Bucharest" , FOR_V2(0x07656C, 0x02E01E) }, + { "Europe/Budapest" , FOR_V2(0x076E25, 0x02E359) }, + { "Europe/Busingen" , FOR_V2(0x077796, 0x02E6D3) }, + { "Europe/Chisinau" , FOR_V2(0x077F28, 0x02E99B) }, + { "Europe/Copenhagen" , FOR_V2(0x0788C1, 0x02ED3F) }, + { "Europe/Dublin" , FOR_V2(0x07913D, 0x02F05A) }, + { "Europe/Gibraltar" , FOR_V2(0x079F30, 0x02F57C) }, + { "Europe/Guernsey" , FOR_V2(0x07AB31, 0x02F9E4) }, + { "Europe/Helsinki" , FOR_V2(0x07B9A4, 0x02FF2C) }, + { "Europe/Isle_of_Man" , FOR_V2(0x07C125, 0x0301F3) }, + { "Europe/Istanbul" , FOR_V2(0x07CF98, 0x03073B) }, + { "Europe/Jersey" , FOR_V2(0x07D81A, 0x030A73) }, + { "Europe/Kaliningrad" , FOR_V2(0x07E68D, 0x030FBB) }, + { "Europe/Kiev" , FOR_V2(0x07EC9B, 0x03122C) }, + { "Europe/Kirov" , FOR_V2(0x07F4EC, 0x03155F) }, + { "Europe/Lisbon" , FOR_V2(0x07F995, 0x03173A) }, + { "Europe/Ljubljana" , FOR_V2(0x080731, 0x031C4E) }, + { "Europe/London" , FOR_V2(0x080EE2, 0x031F28) }, + { "Europe/Luxembourg" , FOR_V2(0x081D55, 0x032470) }, + { "Europe/Madrid" , FOR_V2(0x0828FF, 0x0328CB) }, + { "Europe/Malta" , FOR_V2(0x083356, 0x032CAA) }, + { "Europe/Mariehamn" , FOR_V2(0x083DA7, 0x033074) }, + { "Europe/Minsk" , FOR_V2(0x084528, 0x03333B) }, + { "Europe/Monaco" , FOR_V2(0x084A8E, 0x03355F) }, + { "Europe/Moscow" , FOR_V2(0x085623, 0x0339AB) }, + { "Europe/Nicosia" , FOR_V2(0x085C4B, 0x033C2B) }, + { "Europe/Oslo" , FOR_V2(0x086437, 0x033F18) }, + { "Europe/Paris" , FOR_V2(0x086D0E, 0x03425B) }, + { "Europe/Podgorica" , FOR_V2(0x0878B5, 0x0346B2) }, + { "Europe/Prague" , FOR_V2(0x088066, 0x03498C) }, + { "Europe/Riga" , FOR_V2(0x088952, 0x034CCF) }, + { "Europe/Rome" , FOR_V2(0x089219, 0x035025) }, + { "Europe/Samara" , FOR_V2(0x089CA9, 0x0353FE) }, + { "Europe/San_Marino" , FOR_V2(0x08A1B3, 0x03560D) }, + { "Europe/Sarajevo" , FOR_V2(0x08AC43, 0x0359E6) }, + { "Europe/Saratov" , FOR_V2(0x08B3F4, 0x035CC0) }, + { "Europe/Simferopol" , FOR_V2(0x08B8BD, 0x035EAA) }, + { "Europe/Skopje" , FOR_V2(0x08BEAA, 0x03610C) }, + { "Europe/Sofia" , FOR_V2(0x08C65B, 0x0363E6) }, + { "Europe/Stockholm" , FOR_V2(0x08CEB9, 0x0366FF) }, + { "Europe/Tallinn" , FOR_V2(0x08D643, 0x0369BF) }, + { "Europe/Tirane" , FOR_V2(0x08DEDA, 0x036D05) }, + { "Europe/Tiraspol" , FOR_V2(0x08E718, 0x037010) }, + { "Europe/Ulyanovsk" , FOR_V2(0x08F0B1, 0x0373B4) }, + { "Europe/Uzhgorod" , FOR_V2(0x08F5D0, 0x0375C6) }, + { "Europe/Vaduz" , FOR_V2(0x08FE1B, 0x0378EE) }, + { "Europe/Vatican" , FOR_V2(0x0905A5, 0x037BAE) }, + { "Europe/Vienna" , FOR_V2(0x091035, 0x037F87) }, + { "Europe/Vilnius" , FOR_V2(0x0918FE, 0x0382C5) }, + { "Europe/Volgograd" , FOR_V2(0x0921A1, 0x038615) }, + { "Europe/Warsaw" , FOR_V2(0x09264E, 0x0387F4) }, + { "Europe/Zagreb" , FOR_V2(0x0930EB, 0x038BE6) }, + { "Europe/Zaporozhye" , FOR_V2(0x09389C, 0x038EC0) }, + { "Europe/Zurich" , FOR_V2(0x094115, 0x039212) }, + { "Factory" , FOR_V2(0x09489F, 0x0394D2) }, + { "GB" , FOR_V2(0x09493F, 0x039520) }, + { "GB-Eire" , FOR_V2(0x0957B2, 0x039A68) }, + { "GMT" , FOR_V2(0x096625, 0x039FB0) }, + { "GMT+0" , FOR_V2(0x0966B0, 0x039FF4) }, + { "GMT-0" , FOR_V2(0x09673B, 0x03A038) }, + { "GMT0" , FOR_V2(0x0967C6, 0x03A07C) }, + { "Greenwich" , FOR_V2(0x096851, 0x03A0C0) }, + { "Hongkong" , FOR_V2(0x0968DC, 0x03A104) }, + { "HST" , FOR_V2(0x096D8D, 0x03A2D3) }, + { "Iceland" , FOR_V2(0x096E19, 0x03A317) }, + { "Indian/Antananarivo" , FOR_V2(0x0972CB, 0x03A4E9) }, + { "Indian/Chagos" , FOR_V2(0x0973F2, 0x03A575) }, + { "Indian/Christmas" , FOR_V2(0x0974C7, 0x03A5DC) }, + { "Indian/Cocos" , FOR_V2(0x097568, 0x03A620) }, + { "Indian/Comoro" , FOR_V2(0x09760C, 0x03A664) }, + { "Indian/Kerguelen" , FOR_V2(0x097733, 0x03A6F0) }, + { "Indian/Mahe" , FOR_V2(0x0977FA, 0x03A74F) }, + { "Indian/Maldives" , FOR_V2(0x0978B1, 0x03A7A9) }, + { "Indian/Mauritius" , FOR_V2(0x097989, 0x03A80F) }, + { "Indian/Mayotte" , FOR_V2(0x097A92, 0x03A88A) }, + { "Indian/Reunion" , FOR_V2(0x097BB9, 0x03A916) }, + { "Iran" , FOR_V2(0x097C70, 0x03A970) }, + { "Israel" , FOR_V2(0x09830A, 0x03ABEB) }, + { "Jamaica" , FOR_V2(0x098BEF, 0x03AF33) }, + { "Japan" , FOR_V2(0x098DF6, 0x03B009) }, + { "Kwajalein" , FOR_V2(0x098F65, 0x03B0A0) }, + { "Libya" , FOR_V2(0x09905E, 0x03B114) }, + { "MET" , FOR_V2(0x0992F9, 0x03B222) }, + { "Mexico/BajaNorte" , FOR_V2(0x099B3B, 0x03B52B) }, + { "Mexico/BajaSur" , FOR_V2(0x09A47B, 0x03B899) }, + { "Mexico/General" , FOR_V2(0x09AAA3, 0x03BAEB) }, + { "MST" , FOR_V2(0x09B101, 0x03BD4E) }, + { "MST7MDT" , FOR_V2(0x09B18C, 0x03BD92) }, + { "Navajo" , FOR_V2(0x09BA8E, 0x03C0E3) }, + { "NZ" , FOR_V2(0x09C42F, 0x03C46D) }, + { "NZ-CHAT" , FOR_V2(0x09CDD7, 0x03C7FC) }, + { "Pacific/Apia" , FOR_V2(0x09D5EC, 0x03CAF1) }, + { "Pacific/Auckland" , FOR_V2(0x09DA46, 0x03CC9A) }, + { "Pacific/Bougainville" , FOR_V2(0x09E406, 0x03D041) }, + { "Pacific/Chatham" , FOR_V2(0x09E536, 0x03D0CA) }, + { "Pacific/Chuuk" , FOR_V2(0x09ED5A, 0x03D3CE) }, + { "Pacific/Easter" , FOR_V2(0x09EE0E, 0x03D422) }, + { "Pacific/Efate" , FOR_V2(0x09F6D8, 0x03D769) }, + { "Pacific/Enderbury" , FOR_V2(0x09F8C2, 0x03D834) }, + { "Pacific/Fakaofo" , FOR_V2(0x09F9C3, 0x03D8B3) }, + { "Pacific/Fiji" , FOR_V2(0x09FA94, 0x03D915) }, + { "Pacific/Funafuti" , FOR_V2(0x09FED1, 0x03DAAD) }, + { "Pacific/Galapagos" , FOR_V2(0x09FF73, 0x03DAF1) }, + { "Pacific/Gambier" , FOR_V2(0x0A0063, 0x03DB6E) }, + { "Pacific/Guadalcanal" , FOR_V2(0x0A012B, 0x03DBD8) }, + { "Pacific/Guam" , FOR_V2(0x0A01E3, 0x03DC32) }, + { "Pacific/Honolulu" , FOR_V2(0x0A02D0, 0x03DC99) }, + { "Pacific/Johnston" , FOR_V2(0x0A03F6, 0x03DD21) }, + { "Pacific/Kiritimati" , FOR_V2(0x0A0524, 0x03DDB1) }, + { "Pacific/Kosrae" , FOR_V2(0x0A0622, 0x03DE2D) }, + { "Pacific/Kwajalein" , FOR_V2(0x0A071A, 0x03DEA3) }, + { "Pacific/Majuro" , FOR_V2(0x0A081C, 0x03DF20) }, + { "Pacific/Marquesas" , FOR_V2(0x0A090A, 0x03DF9F) }, + { "Pacific/Midway" , FOR_V2(0x0A09D7, 0x03E00B) }, + { "Pacific/Nauru" , FOR_V2(0x0A0B01, 0x03E09D) }, + { "Pacific/Niue" , FOR_V2(0x0A0C0B, 0x03E11A) }, + { "Pacific/Norfolk" , FOR_V2(0x0A0CF9, 0x03E189) }, + { "Pacific/Noumea" , FOR_V2(0x0A0E26, 0x03E213) }, + { "Pacific/Pago_Pago" , FOR_V2(0x0A0F6C, 0x03E2A8) }, + { "Pacific/Palau" , FOR_V2(0x0A1088, 0x03E32C) }, + { "Pacific/Pitcairn" , FOR_V2(0x0A1129, 0x03E370) }, + { "Pacific/Pohnpei" , FOR_V2(0x0A1200, 0x03E3D6) }, + { "Pacific/Ponape" , FOR_V2(0x0A12B3, 0x03E429) }, + { "Pacific/Port_Moresby" , FOR_V2(0x0A1358, 0x03E46E) }, + { "Pacific/Rarotonga" , FOR_V2(0x0A142D, 0x03E4CF) }, + { "Pacific/Saipan" , FOR_V2(0x0A1677, 0x03E5BC) }, + { "Pacific/Samoa" , FOR_V2(0x0A1764, 0x03E623) }, + { "Pacific/Tahiti" , FOR_V2(0x0A1880, 0x03E6A7) }, + { "Pacific/Tarawa" , FOR_V2(0x0A1949, 0x03E711) }, + { "Pacific/Tongatapu" , FOR_V2(0x0A19FD, 0x03E765) }, + { "Pacific/Truk" , FOR_V2(0x0A1DE6, 0x03E8E3) }, + { "Pacific/Wake" , FOR_V2(0x0A1E8B, 0x03E928) }, + { "Pacific/Wallis" , FOR_V2(0x0A1F3B, 0x03E978) }, + { "Pacific/Yap" , FOR_V2(0x0A1FDD, 0x03E9BC) }, + { "Poland" , FOR_V2(0x0A2082, 0x03EA01) }, + { "Portugal" , FOR_V2(0x0A2B1F, 0x03EDF3) }, + { "PRC" , FOR_V2(0x0A38A8, 0x03F2F4) }, + { "PST8PDT" , FOR_V2(0x0A3A52, 0x03F3A5) }, + { "ROC" , FOR_V2(0x0A4354, 0x03F6F6) }, + { "ROK" , FOR_V2(0x0A4680, 0x03F838) }, + { "Singapore" , FOR_V2(0x0A48C7, 0x03F930) }, + { "Turkey" , FOR_V2(0x0A4A7F, 0x03F9F8) }, + { "UCT" , FOR_V2(0x0A5301, 0x03FD30) }, + { "Universal" , FOR_V2(0x0A538C, 0x03FD74) }, + { "US/Alaska" , FOR_V2(0x0A5417, 0x03FDB8) }, + { "US/Aleutian" , FOR_V2(0x0A5D73, 0x040132) }, + { "US/Arizona" , FOR_V2(0x0A66BC, 0x0404A3) }, + { "US/Central" , FOR_V2(0x0A6829, 0x040542) }, + { "US/East-Indiana" , FOR_V2(0x0A7636, 0x040A66) }, + { "US/Eastern" , FOR_V2(0x0A7CCD, 0x040CE1) }, + { "US/Hawaii" , FOR_V2(0x0A8AB2, 0x0411F1) }, + { "US/Indiana-Starke" , FOR_V2(0x0A8BD2, 0x041273) }, + { "US/Michigan" , FOR_V2(0x0A9563, 0x0415FD) }, + { "US/Mountain" , FOR_V2(0x0A9E17, 0x041939) }, + { "US/Pacific" , FOR_V2(0x0AA7B8, 0x041CC3) }, + { "US/Pacific-New" , FOR_V2(0x0AB2E1, 0x0420D9) }, + { "US/Samoa" , FOR_V2(0x0ABE0A, 0x0424EF) }, + { "UTC" , FOR_V2(0x0ABF26, 0x042573) }, + { "W-SU" , FOR_V2(0x0ABFB1, 0x0425B7) }, + { "WET" , FOR_V2(0x0AC5C5, 0x042823) }, + { "Zulu" , FOR_V2(0x0ACD22, 0x042AD6) }, }; #ifdef TIMELIB_SUPPORTS_V2DATA -const unsigned char timelib_timezone_db_data_builtin[705802] = { +const unsigned char timelib_timezone_db_data_builtin[708013] = { #else -const unsigned char timelib_timezone_db_data_builtin[272303] = { +const unsigned char timelib_timezone_db_data_builtin[273178] = { #endif @@ -18848,10 +18850,9 @@ const unsigned char timelib_timezone_db_data_builtin[272303] = { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x3C, 0x2B, 0x30, 0x35, 0x3E, 0x2D, 0x35, 0x0A, #endif -0x00, 0xCD, 0x41, 0x92, 0x01, 0x5F, 0x5B, 0xEA, 0x00, 0x00, 0x00, 0x2C, 0x41, 0x74, 0x79, 0x72, -0x61, 0x75, 0x2F, 0x41, 0x74, 0x69, 0x72, 0x61, 0x75, 0x2F, 0x47, 0x75, 0x72, 0x27, 0x79, 0x65, -0x76, 0x2C, 0x20, 0x4D, 0x61, 0x6E, 0x67, 0x67, 0x68, 0x79, 0x73, 0x74, 0x61, 0x75, 0x2F, 0x4D, -0x61, 0x6E, 0x6B, 0x69, 0x73, 0x74, 0x61, 0x75, +0x00, 0xCD, 0x41, 0x92, 0x01, 0x5F, 0x5B, 0xEA, 0x00, 0x00, 0x00, 0x15, 0x4D, 0x61, 0x6E, 0x67, +0x67, 0x68, 0x79, 0x73, 0x74, 0x61, 0x75, 0x2F, 0x4D, 0x61, 0x6E, 0x6B, 0x69, 0x73, 0x74, 0x61, +0x75, /* Asia/Aqtobe */ 0x50, 0x48, 0x50, 0x32, 0x01, 0x4B, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -19017,6 +19018,77 @@ const unsigned char timelib_timezone_db_data_builtin[272303] = { #endif 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, +/* Asia/Atyrau */ +0x50, 0x48, 0x50, 0x32, 0x01, 0x4B, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x10, 0x80, 0x00, 0x00, 0x00, +0xAA, 0x19, 0x93, 0x50, 0xB5, 0xA3, 0xFD, 0x40, 0x16, 0x18, 0xCE, 0x30, 0x17, 0x08, 0xB1, 0x20, +0x17, 0xF9, 0xF3, 0xA0, 0x18, 0xE9, 0xF2, 0xB0, 0x19, 0xDB, 0x27, 0x20, 0x1A, 0xCC, 0x77, 0xB0, +0x1B, 0xBC, 0x84, 0xD0, 0x1C, 0xAC, 0x75, 0xD0, 0x1D, 0x9C, 0x66, 0xD0, 0x1E, 0x8C, 0x57, 0xD0, +0x1F, 0x7C, 0x48, 0xD0, 0x20, 0x6C, 0x39, 0xD0, 0x21, 0x5C, 0x2A, 0xD0, 0x22, 0x4C, 0x1B, 0xD0, +0x23, 0x3C, 0x0C, 0xD0, 0x24, 0x2B, 0xFD, 0xD0, 0x25, 0x1B, 0xEE, 0xD0, 0x26, 0x0B, 0xDF, 0xD0, +0x27, 0x05, 0x0B, 0x50, 0x27, 0xF4, 0xFC, 0x50, 0x28, 0xE4, 0xFB, 0x60, 0x29, 0x78, 0xA3, 0x60, +0x29, 0xD4, 0xDE, 0x50, 0x2A, 0xC4, 0xCF, 0x50, 0x2B, 0xB4, 0xC0, 0x50, 0x2C, 0xA4, 0xB1, 0x50, +0x2D, 0x94, 0xA2, 0x50, 0x2E, 0x84, 0x93, 0x50, 0x2F, 0x74, 0x84, 0x50, 0x30, 0x64, 0x75, 0x50, +0x31, 0x5D, 0xA0, 0xD0, 0x32, 0x72, 0x7B, 0xD0, 0x33, 0x3D, 0x82, 0xD0, 0x34, 0x52, 0x5D, 0xD0, +0x35, 0x1D, 0x64, 0xD0, 0x36, 0x32, 0x3F, 0xD0, 0x36, 0xFD, 0x46, 0xD0, 0x38, 0x1B, 0x6A, 0x60, +0x38, 0xDD, 0x36, 0xE0, 0x39, 0xFB, 0x4C, 0x60, 0x3A, 0xBD, 0x18, 0xE0, 0x3B, 0xDB, 0x2E, 0x60, +0x3C, 0xA6, 0x35, 0x60, 0x3D, 0xBB, 0x10, 0x60, 0x3E, 0x86, 0x17, 0x60, 0x3F, 0x9A, 0xF2, 0x60, +0x40, 0x65, 0xF9, 0x60, 0x41, 0x84, 0x0E, 0xE0, 0x7F, 0xFF, 0xFF, 0xFF, 0x00, 0x01, 0x02, 0x03, +0x04, 0x02, 0x04, 0x02, 0x04, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, +0x06, 0x05, 0x07, 0x08, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, +0x05, 0x06, 0x05, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x05, 0x05, +0x00, 0x00, 0x30, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, +0x00, 0x08, 0x00, 0x00, 0x54, 0x60, 0x00, 0x0C, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0C, 0x00, 0x00, +0x46, 0x50, 0x00, 0x08, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0C, 0x00, 0x00, 0x46, 0x50, 0x01, 0x08, +0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, +0x2B, 0x30, 0x34, 0x00, 0x2B, 0x30, 0x35, 0x00, 0x2B, 0x30, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +#ifdef TIMELIB_SUPPORTS_V2DATA +0x54, 0x5A, 0x69, 0x66, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x10, 0xF8, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xAA, 0x19, 0x93, 0x50, 0xFF, 0xFF, 0xFF, 0xFF, +0xB5, 0xA3, 0xFD, 0x40, 0x00, 0x00, 0x00, 0x00, 0x16, 0x18, 0xCE, 0x30, 0x00, 0x00, 0x00, 0x00, +0x17, 0x08, 0xB1, 0x20, 0x00, 0x00, 0x00, 0x00, 0x17, 0xF9, 0xF3, 0xA0, 0x00, 0x00, 0x00, 0x00, +0x18, 0xE9, 0xF2, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x19, 0xDB, 0x27, 0x20, 0x00, 0x00, 0x00, 0x00, +0x1A, 0xCC, 0x77, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x1B, 0xBC, 0x84, 0xD0, 0x00, 0x00, 0x00, 0x00, +0x1C, 0xAC, 0x75, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x1D, 0x9C, 0x66, 0xD0, 0x00, 0x00, 0x00, 0x00, +0x1E, 0x8C, 0x57, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x7C, 0x48, 0xD0, 0x00, 0x00, 0x00, 0x00, +0x20, 0x6C, 0x39, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x21, 0x5C, 0x2A, 0xD0, 0x00, 0x00, 0x00, 0x00, +0x22, 0x4C, 0x1B, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x23, 0x3C, 0x0C, 0xD0, 0x00, 0x00, 0x00, 0x00, +0x24, 0x2B, 0xFD, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x25, 0x1B, 0xEE, 0xD0, 0x00, 0x00, 0x00, 0x00, +0x26, 0x0B, 0xDF, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x27, 0x05, 0x0B, 0x50, 0x00, 0x00, 0x00, 0x00, +0x27, 0xF4, 0xFC, 0x50, 0x00, 0x00, 0x00, 0x00, 0x28, 0xE4, 0xFB, 0x60, 0x00, 0x00, 0x00, 0x00, +0x29, 0x78, 0xA3, 0x60, 0x00, 0x00, 0x00, 0x00, 0x29, 0xD4, 0xDE, 0x50, 0x00, 0x00, 0x00, 0x00, +0x2A, 0xC4, 0xCF, 0x50, 0x00, 0x00, 0x00, 0x00, 0x2B, 0xB4, 0xC0, 0x50, 0x00, 0x00, 0x00, 0x00, +0x2C, 0xA4, 0xB1, 0x50, 0x00, 0x00, 0x00, 0x00, 0x2D, 0x94, 0xA2, 0x50, 0x00, 0x00, 0x00, 0x00, +0x2E, 0x84, 0x93, 0x50, 0x00, 0x00, 0x00, 0x00, 0x2F, 0x74, 0x84, 0x50, 0x00, 0x00, 0x00, 0x00, +0x30, 0x64, 0x75, 0x50, 0x00, 0x00, 0x00, 0x00, 0x31, 0x5D, 0xA0, 0xD0, 0x00, 0x00, 0x00, 0x00, +0x32, 0x72, 0x7B, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x33, 0x3D, 0x82, 0xD0, 0x00, 0x00, 0x00, 0x00, +0x34, 0x52, 0x5D, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x35, 0x1D, 0x64, 0xD0, 0x00, 0x00, 0x00, 0x00, +0x36, 0x32, 0x3F, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x36, 0xFD, 0x46, 0xD0, 0x00, 0x00, 0x00, 0x00, +0x38, 0x1B, 0x6A, 0x60, 0x00, 0x00, 0x00, 0x00, 0x38, 0xDD, 0x36, 0xE0, 0x00, 0x00, 0x00, 0x00, +0x39, 0xFB, 0x4C, 0x60, 0x00, 0x00, 0x00, 0x00, 0x3A, 0xBD, 0x18, 0xE0, 0x00, 0x00, 0x00, 0x00, +0x3B, 0xDB, 0x2E, 0x60, 0x00, 0x00, 0x00, 0x00, 0x3C, 0xA6, 0x35, 0x60, 0x00, 0x00, 0x00, 0x00, +0x3D, 0xBB, 0x10, 0x60, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x86, 0x17, 0x60, 0x00, 0x00, 0x00, 0x00, +0x3F, 0x9A, 0xF2, 0x60, 0x00, 0x00, 0x00, 0x00, 0x40, 0x65, 0xF9, 0x60, 0x00, 0x00, 0x00, 0x00, +0x41, 0x84, 0x0E, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0x00, 0x01, 0x02, 0x03, +0x04, 0x02, 0x04, 0x02, 0x04, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, +0x06, 0x05, 0x07, 0x08, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, 0x05, 0x06, +0x05, 0x06, 0x05, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x05, 0x05, +0x00, 0x00, 0x30, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, +0x00, 0x08, 0x00, 0x00, 0x54, 0x60, 0x00, 0x0C, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0C, 0x00, 0x00, +0x46, 0x50, 0x00, 0x08, 0x00, 0x00, 0x54, 0x60, 0x01, 0x0C, 0x00, 0x00, 0x46, 0x50, 0x01, 0x08, +0x00, 0x00, 0x38, 0x40, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, +0x2B, 0x30, 0x34, 0x00, 0x2B, 0x30, 0x35, 0x00, 0x2B, 0x30, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x0A, 0x3C, 0x2B, 0x30, 0x35, 0x3E, 0x2D, 0x35, 0x0A, +#endif +0x00, 0xD1, 0x39, 0x32, 0x01, 0x61, 0xE6, 0xF5, 0x00, 0x00, 0x00, 0x15, 0x41, 0x74, 0x79, 0x72, +0x61, 0x75, 0x2F, 0x41, 0x74, 0x69, 0x72, 0x61, 0x75, 0x2F, 0x47, 0x75, 0x72, 0x27, 0x79, 0x65, +0x76, + /* Asia/Baghdad */ 0x50, 0x48, 0x50, 0x32, 0x01, 0x49, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, @@ -20233,8 +20305,8 @@ const unsigned char timelib_timezone_db_data_builtin[272303] = { /* Asia/Gaza */ 0x50, 0x48, 0x50, 0x32, 0x01, 0x50, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x15, 0x80, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x15, 0x80, 0x00, 0x00, 0x00, 0xC8, 0x59, 0xB2, 0xE0, 0xCC, 0xE5, 0xC1, 0x50, 0xCD, 0xAC, 0xFE, 0x00, 0xCE, 0xC6, 0xF4, 0xD0, 0xCF, 0x8F, 0x66, 0xE0, 0xD0, 0xA9, 0x79, 0xD0, 0xD1, 0x84, 0x60, 0xE0, 0xD2, 0x8A, 0xC9, 0x70, 0xD3, 0x65, 0xB0, 0x80, 0xD4, 0x6B, 0xE0, 0xD0, 0xE8, 0x36, 0x63, 0x60, 0xE8, 0xF4, 0x2D, 0x50, @@ -20271,24 +20343,24 @@ const unsigned char timelib_timezone_db_data_builtin[272303] = { 0x75, 0x0F, 0x92, 0x70, 0x76, 0x2D, 0x99, 0xE0, 0x76, 0xEF, 0x74, 0x70, 0x78, 0x0D, 0x7B, 0xE0, 0x78, 0xCF, 0x56, 0x70, 0x79, 0xED, 0x5D, 0xE0, 0x7A, 0xB8, 0x72, 0xF0, 0x7B, 0xCD, 0x3F, 0xE0, 0x7C, 0x98, 0x54, 0xF0, 0x7D, 0xAD, 0x21, 0xE0, 0x7E, 0x78, 0x36, 0xF0, 0x7F, 0x96, 0x3E, 0x60, -0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x02, 0x03, 0x06, 0x03, 0x06, -0x03, 0x06, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, +0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, +0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x02, 0x01, 0x05, 0x01, 0x05, +0x01, 0x05, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, -0x20, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x08, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x0D, 0x00, -0x00, 0x1C, 0x20, 0x00, 0x11, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x45, -0x45, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x49, 0x44, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x0D, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x11, 0x00, +0x00, 0x1C, 0x20, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, +0x54, 0x00, 0x49, 0x44, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, #ifdef TIMELIB_SUPPORTS_V2DATA 0x54, 0x5A, 0x69, 0x66, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x15, 0xF8, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x15, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x7D, 0xBD, 0x4A, 0xB0, 0xFF, 0xFF, 0xFF, 0xFF, 0xC8, 0x59, 0xB2, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0xCC, 0xE5, 0xC1, 0x50, 0xFF, 0xFF, 0xFF, 0xFF, 0xCD, 0xAC, 0xFE, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xCE, 0xC6, 0xF4, 0xD0, 0xFF, 0xFF, 0xFF, 0xFF, @@ -20362,22 +20434,22 @@ const unsigned char timelib_timezone_db_data_builtin[272303] = { 0x7A, 0xB8, 0x72, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x7B, 0xCD, 0x3F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x98, 0x54, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x7D, 0xAD, 0x21, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x78, 0x36, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x96, 0x3E, 0x60, 0x00, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x02, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, -0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, -0x00, 0x00, 0x2A, 0x30, 0x01, 0x08, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x0D, 0x00, 0x00, 0x1C, 0x20, -0x00, 0x11, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, -0x45, 0x45, 0x53, 0x54, 0x00, 0x49, 0x44, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x45, 0x45, 0x54, 0x2D, -0x32, 0x45, 0x45, 0x53, 0x54, 0x2C, 0x4D, 0x33, 0x2E, 0x35, 0x2E, 0x36, 0x2F, 0x31, 0x2C, 0x4D, -0x31, 0x30, 0x2E, 0x35, 0x2E, 0x36, 0x2F, 0x31, 0x0A, +0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, +0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x02, 0x01, 0x05, 0x01, 0x05, 0x01, 0x05, 0x02, +0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, +0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, +0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, +0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, +0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, +0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, +0x00, 0x00, 0x2A, 0x30, 0x01, 0x0D, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x11, 0x00, 0x00, 0x1C, 0x20, +0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x49, +0x44, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0A, 0x45, 0x45, 0x54, 0x2D, 0x32, 0x45, 0x45, 0x53, 0x54, 0x2C, 0x4D, 0x33, +0x2E, 0x35, 0x2E, 0x36, 0x2F, 0x31, 0x2C, 0x4D, 0x31, 0x30, 0x2E, 0x35, 0x2E, 0x36, 0x2F, 0x31, +0x0A, #endif 0x00, 0xB9, 0x64, 0xF0, 0x01, 0x47, 0x40, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x47, 0x61, 0x7A, 0x61, 0x20, 0x53, 0x74, 0x72, 0x69, 0x70, @@ -20416,8 +20488,8 @@ const unsigned char timelib_timezone_db_data_builtin[272303] = { /* Asia/Hebron */ 0x50, 0x48, 0x50, 0x32, 0x01, 0x50, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x15, 0x80, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x93, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x15, 0x80, 0x00, 0x00, 0x00, 0xC8, 0x59, 0xB2, 0xE0, 0xCC, 0xE5, 0xC1, 0x50, 0xCD, 0xAC, 0xFE, 0x00, 0xCE, 0xC6, 0xF4, 0xD0, 0xCF, 0x8F, 0x66, 0xE0, 0xD0, 0xA9, 0x79, 0xD0, 0xD1, 0x84, 0x60, 0xE0, 0xD2, 0x8A, 0xC9, 0x70, 0xD3, 0x65, 0xB0, 0x80, 0xD4, 0x6B, 0xE0, 0xD0, 0xE8, 0x36, 0x63, 0x60, 0xE8, 0xF4, 0x2D, 0x50, @@ -20455,24 +20527,23 @@ const unsigned char timelib_timezone_db_data_builtin[272303] = { 0x76, 0xEF, 0x74, 0x70, 0x78, 0x0D, 0x7B, 0xE0, 0x78, 0xCF, 0x56, 0x70, 0x79, 0xED, 0x5D, 0xE0, 0x7A, 0xB8, 0x72, 0xF0, 0x7B, 0xCD, 0x3F, 0xE0, 0x7C, 0x98, 0x54, 0xF0, 0x7D, 0xAD, 0x21, 0xE0, 0x7E, 0x78, 0x36, 0xF0, 0x7F, 0x96, 0x3E, 0x60, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, -0x02, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, -0x05, 0x04, 0x05, 0x02, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, -0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x20, 0xE7, 0x00, -0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x00, 0x00, 0x2A, -0x30, 0x01, 0x08, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x0D, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x11, 0x00, -0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x45, 0x45, 0x53, -0x54, 0x00, 0x49, 0x44, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, +0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, +0x04, 0x03, 0x04, 0x02, 0x01, 0x05, 0x01, 0x05, 0x01, 0x05, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x20, 0xE7, 0x00, +0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, +0x30, 0x01, 0x0D, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x11, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x4C, +0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x49, 0x44, 0x54, 0x00, +0x49, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, #ifdef TIMELIB_SUPPORTS_V2DATA 0x54, 0x5A, 0x69, 0x66, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x15, 0xF8, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x15, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x7D, 0xBD, 0x4A, 0x19, 0xFF, 0xFF, 0xFF, 0xFF, 0xC8, 0x59, 0xB2, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0xCC, 0xE5, 0xC1, 0x50, 0xFF, 0xFF, 0xFF, 0xFF, 0xCD, 0xAC, 0xFE, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xCE, 0xC6, 0xF4, 0xD0, 0xFF, 0xFF, 0xFF, 0xFF, @@ -20547,22 +20618,22 @@ const unsigned char timelib_timezone_db_data_builtin[272303] = { 0x7A, 0xB8, 0x72, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x7B, 0xCD, 0x3F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x98, 0x54, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x7D, 0xAD, 0x21, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x78, 0x36, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x96, 0x3E, 0x60, 0x00, 0x02, 0x01, 0x02, -0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, -0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x02, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, -0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, +0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, +0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, +0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x02, 0x01, 0x05, 0x01, 0x05, 0x01, 0x05, 0x02, +0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, +0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, +0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, +0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, +0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x20, 0xE7, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, -0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x08, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x0D, 0x00, 0x00, -0x1C, 0x20, 0x00, 0x11, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x45, -0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x49, 0x44, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x45, 0x45, -0x54, 0x2D, 0x32, 0x45, 0x45, 0x53, 0x54, 0x2C, 0x4D, 0x33, 0x2E, 0x35, 0x2E, 0x36, 0x2F, 0x31, -0x2C, 0x4D, 0x31, 0x30, 0x2E, 0x35, 0x2E, 0x36, 0x2F, 0x31, 0x0A, +0x00, 0x09, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x0D, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x11, 0x00, 0x00, +0x1C, 0x20, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, +0x00, 0x49, 0x44, 0x54, 0x00, 0x49, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x45, 0x45, 0x54, 0x2D, 0x32, 0x45, 0x45, 0x53, 0x54, 0x2C, +0x4D, 0x33, 0x2E, 0x35, 0x2E, 0x36, 0x2F, 0x31, 0x2C, 0x4D, 0x31, 0x30, 0x2E, 0x35, 0x2E, 0x36, +0x2F, 0x31, 0x0A, #endif 0x00, 0xB9, 0x71, 0xF5, 0x01, 0x48, 0x35, 0x7C, 0x00, 0x00, 0x00, 0x09, 0x57, 0x65, 0x73, 0x74, 0x20, 0x42, 0x61, 0x6E, 0x6B, @@ -22253,7 +22324,7 @@ const unsigned char timelib_timezone_db_data_builtin[272303] = { 0x37, 0x0A, #endif 0x00, 0xDD, 0x4D, 0xA5, 0x01, 0x91, 0x2D, 0xD2, 0x00, 0x00, 0x00, 0x14, 0x4D, 0x53, 0x4B, 0x2B, -0x30, 0x33, 0x20, 0x2D, 0x20, 0x4E, 0x6F, 0x76, 0x6F, 0x73, 0x69, 0x62, 0x69, 0x72, 0x73, 0x6B, +0x30, 0x34, 0x20, 0x2D, 0x20, 0x4E, 0x6F, 0x76, 0x6F, 0x73, 0x69, 0x62, 0x69, 0x72, 0x73, 0x6B, /* Asia/Omsk */ @@ -38639,6 +38710,87 @@ const unsigned char timelib_timezone_db_data_builtin[272303] = { #endif 0x00, 0xCC, 0x43, 0xAA, 0x01, 0x2E, 0xC2, 0x82, 0x00, 0x00, 0x00, 0x00, +/* Europe/Saratov */ +0x50, 0x48, 0x50, 0x32, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x10, 0x80, 0x00, 0x00, 0x00, +0xA1, 0x00, 0x39, 0x80, 0xB5, 0xA4, 0x0B, 0x50, 0x15, 0x27, 0x99, 0xC0, 0x16, 0x18, 0xCE, 0x30, +0x17, 0x08, 0xCD, 0x40, 0x17, 0xFA, 0x01, 0xB0, 0x18, 0xEA, 0x00, 0xC0, 0x19, 0xDB, 0x35, 0x30, +0x1A, 0xCC, 0x85, 0xC0, 0x1B, 0xBC, 0x92, 0xE0, 0x1C, 0xAC, 0x83, 0xE0, 0x1D, 0x9C, 0x74, 0xE0, +0x1E, 0x8C, 0x65, 0xE0, 0x1F, 0x7C, 0x56, 0xE0, 0x20, 0x6C, 0x47, 0xE0, 0x21, 0x5C, 0x38, 0xE0, +0x22, 0x4C, 0x29, 0xE0, 0x23, 0x3C, 0x28, 0xF0, 0x24, 0x2C, 0x19, 0xF0, 0x25, 0x1C, 0x0A, 0xF0, +0x26, 0x0B, 0xFB, 0xF0, 0x27, 0x05, 0x27, 0x70, 0x27, 0xF5, 0x18, 0x70, 0x29, 0xD4, 0xEC, 0x60, +0x2A, 0xC4, 0xEB, 0x70, 0x2B, 0xB4, 0xDC, 0x70, 0x2C, 0xA4, 0xCD, 0x70, 0x2D, 0x94, 0xBE, 0x70, +0x2E, 0x84, 0xAF, 0x70, 0x2F, 0x74, 0xA0, 0x70, 0x30, 0x64, 0x91, 0x70, 0x31, 0x5D, 0xBC, 0xF0, +0x32, 0x72, 0x97, 0xF0, 0x33, 0x3D, 0x9E, 0xF0, 0x34, 0x52, 0x79, 0xF0, 0x35, 0x1D, 0x80, 0xF0, +0x36, 0x32, 0x5B, 0xF0, 0x36, 0xFD, 0x62, 0xF0, 0x38, 0x1B, 0x78, 0x70, 0x38, 0xDD, 0x44, 0xF0, +0x39, 0xFB, 0x5A, 0x70, 0x3A, 0xBD, 0x26, 0xF0, 0x3B, 0xDB, 0x3C, 0x70, 0x3C, 0xA6, 0x43, 0x70, +0x3D, 0xBB, 0x1E, 0x70, 0x3E, 0x86, 0x25, 0x70, 0x3F, 0x9B, 0x00, 0x70, 0x40, 0x66, 0x07, 0x70, +0x41, 0x84, 0x1C, 0xF0, 0x42, 0x45, 0xE9, 0x70, 0x43, 0x63, 0xFE, 0xF0, 0x44, 0x25, 0xCB, 0x70, +0x45, 0x43, 0xE0, 0xF0, 0x46, 0x05, 0xAD, 0x70, 0x47, 0x23, 0xC2, 0xF0, 0x47, 0xEE, 0xC9, 0xF0, +0x49, 0x03, 0xA4, 0xF0, 0x49, 0xCE, 0xAB, 0xF0, 0x4A, 0xE3, 0x86, 0xF0, 0x4B, 0xAE, 0x8D, 0xF0, +0x4C, 0xCC, 0xA3, 0x70, 0x4D, 0x8E, 0x6F, 0xF0, 0x54, 0x4C, 0x1D, 0x60, 0x58, 0x43, 0x4E, 0x70, +0x7F, 0xFF, 0xFF, 0xFF, 0x00, 0x01, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, +0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x04, 0x06, 0x07, 0x06, 0x07, +0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, +0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, +0x06, 0x07, 0x04, 0x07, 0x04, 0x04, 0x00, 0x00, 0x2B, 0x32, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, +0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x01, 0x08, 0x00, 0x00, 0x38, 0x40, 0x00, 0x0C, 0x00, 0x00, +0x38, 0x40, 0x00, 0x0C, 0x00, 0x00, 0x46, 0x50, 0x01, 0x08, 0x00, 0x00, 0x38, 0x40, 0x01, 0x0C, +0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x38, 0x40, 0x00, 0x0C, 0x4C, 0x4D, 0x54, 0x00, +0x2B, 0x30, 0x33, 0x00, 0x2B, 0x30, 0x35, 0x00, 0x2B, 0x30, 0x34, 0x00, 0x00, 0x01, 0x00, 0x00, +0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +#ifdef TIMELIB_SUPPORTS_V2DATA +0x54, 0x5A, 0x69, 0x66, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x10, 0xF8, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xA1, 0x00, 0x39, 0x80, 0xFF, 0xFF, 0xFF, 0xFF, +0xB5, 0xA4, 0x0B, 0x50, 0x00, 0x00, 0x00, 0x00, 0x15, 0x27, 0x99, 0xC0, 0x00, 0x00, 0x00, 0x00, +0x16, 0x18, 0xCE, 0x30, 0x00, 0x00, 0x00, 0x00, 0x17, 0x08, 0xCD, 0x40, 0x00, 0x00, 0x00, 0x00, +0x17, 0xFA, 0x01, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x18, 0xEA, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, +0x19, 0xDB, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x1A, 0xCC, 0x85, 0xC0, 0x00, 0x00, 0x00, 0x00, +0x1B, 0xBC, 0x92, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x1C, 0xAC, 0x83, 0xE0, 0x00, 0x00, 0x00, 0x00, +0x1D, 0x9C, 0x74, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x8C, 0x65, 0xE0, 0x00, 0x00, 0x00, 0x00, +0x1F, 0x7C, 0x56, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x20, 0x6C, 0x47, 0xE0, 0x00, 0x00, 0x00, 0x00, +0x21, 0x5C, 0x38, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x22, 0x4C, 0x29, 0xE0, 0x00, 0x00, 0x00, 0x00, +0x23, 0x3C, 0x28, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x24, 0x2C, 0x19, 0xF0, 0x00, 0x00, 0x00, 0x00, +0x25, 0x1C, 0x0A, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x26, 0x0B, 0xFB, 0xF0, 0x00, 0x00, 0x00, 0x00, +0x27, 0x05, 0x27, 0x70, 0x00, 0x00, 0x00, 0x00, 0x27, 0xF5, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00, +0x29, 0xD4, 0xEC, 0x60, 0x00, 0x00, 0x00, 0x00, 0x2A, 0xC4, 0xEB, 0x70, 0x00, 0x00, 0x00, 0x00, +0x2B, 0xB4, 0xDC, 0x70, 0x00, 0x00, 0x00, 0x00, 0x2C, 0xA4, 0xCD, 0x70, 0x00, 0x00, 0x00, 0x00, +0x2D, 0x94, 0xBE, 0x70, 0x00, 0x00, 0x00, 0x00, 0x2E, 0x84, 0xAF, 0x70, 0x00, 0x00, 0x00, 0x00, +0x2F, 0x74, 0xA0, 0x70, 0x00, 0x00, 0x00, 0x00, 0x30, 0x64, 0x91, 0x70, 0x00, 0x00, 0x00, 0x00, +0x31, 0x5D, 0xBC, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x32, 0x72, 0x97, 0xF0, 0x00, 0x00, 0x00, 0x00, +0x33, 0x3D, 0x9E, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x34, 0x52, 0x79, 0xF0, 0x00, 0x00, 0x00, 0x00, +0x35, 0x1D, 0x80, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x36, 0x32, 0x5B, 0xF0, 0x00, 0x00, 0x00, 0x00, +0x36, 0xFD, 0x62, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x38, 0x1B, 0x78, 0x70, 0x00, 0x00, 0x00, 0x00, +0x38, 0xDD, 0x44, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x39, 0xFB, 0x5A, 0x70, 0x00, 0x00, 0x00, 0x00, +0x3A, 0xBD, 0x26, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x3B, 0xDB, 0x3C, 0x70, 0x00, 0x00, 0x00, 0x00, +0x3C, 0xA6, 0x43, 0x70, 0x00, 0x00, 0x00, 0x00, 0x3D, 0xBB, 0x1E, 0x70, 0x00, 0x00, 0x00, 0x00, +0x3E, 0x86, 0x25, 0x70, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x9B, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, +0x40, 0x66, 0x07, 0x70, 0x00, 0x00, 0x00, 0x00, 0x41, 0x84, 0x1C, 0xF0, 0x00, 0x00, 0x00, 0x00, +0x42, 0x45, 0xE9, 0x70, 0x00, 0x00, 0x00, 0x00, 0x43, 0x63, 0xFE, 0xF0, 0x00, 0x00, 0x00, 0x00, +0x44, 0x25, 0xCB, 0x70, 0x00, 0x00, 0x00, 0x00, 0x45, 0x43, 0xE0, 0xF0, 0x00, 0x00, 0x00, 0x00, +0x46, 0x05, 0xAD, 0x70, 0x00, 0x00, 0x00, 0x00, 0x47, 0x23, 0xC2, 0xF0, 0x00, 0x00, 0x00, 0x00, +0x47, 0xEE, 0xC9, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x49, 0x03, 0xA4, 0xF0, 0x00, 0x00, 0x00, 0x00, +0x49, 0xCE, 0xAB, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x4A, 0xE3, 0x86, 0xF0, 0x00, 0x00, 0x00, 0x00, +0x4B, 0xAE, 0x8D, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x4C, 0xCC, 0xA3, 0x70, 0x00, 0x00, 0x00, 0x00, +0x4D, 0x8E, 0x6F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x54, 0x4C, 0x1D, 0x60, 0x00, 0x00, 0x00, 0x00, +0x58, 0x43, 0x4E, 0x70, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0x00, 0x01, 0x03, 0x02, +0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x04, 0x05, 0x04, 0x05, 0x04, 0x05, 0x04, 0x06, 0x07, 0x06, +0x07, 0x06, 0x07, 0x04, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, +0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, +0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x04, 0x07, 0x04, 0x04, 0x00, 0x00, +0x2B, 0x32, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x46, 0x50, 0x01, 0x08, +0x00, 0x00, 0x38, 0x40, 0x00, 0x0C, 0x00, 0x00, 0x38, 0x40, 0x00, 0x0C, 0x00, 0x00, 0x46, 0x50, +0x01, 0x08, 0x00, 0x00, 0x38, 0x40, 0x01, 0x0C, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, +0x38, 0x40, 0x00, 0x0C, 0x4C, 0x4D, 0x54, 0x00, 0x2B, 0x30, 0x33, 0x00, 0x2B, 0x30, 0x35, 0x00, +0x2B, 0x30, 0x34, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x3C, 0x2B, 0x30, 0x34, 0x3E, 0x2D, 0x34, 0x0A, +#endif +0x00, 0xD8, 0x03, 0x7A, 0x01, 0x58, 0xE6, 0x45, 0x00, 0x00, 0x00, 0x10, 0x4D, 0x53, 0x4B, 0x2B, +0x30, 0x31, 0x20, 0x2D, 0x20, 0x53, 0x61, 0x72, 0x61, 0x74, 0x6F, 0x76, + /* Europe/Simferopol */ 0x50, 0x48, 0x50, 0x32, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, @@ -40464,9 +40616,8 @@ const unsigned char timelib_timezone_db_data_builtin[272303] = { 0x00, 0x2B, 0x30, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x3C, 0x2B, 0x30, 0x33, 0x3E, 0x2D, 0x33, 0x0A, #endif -0x00, 0xD3, 0xB0, 0xB5, 0x01, 0x56, 0x6E, 0xC2, 0x00, 0x00, 0x00, 0x1B, 0x4D, 0x53, 0x4B, 0x2B, -0x30, 0x30, 0x20, 0x2D, 0x20, 0x56, 0x6F, 0x6C, 0x67, 0x6F, 0x67, 0x72, 0x61, 0x64, 0x2C, 0x20, -0x53, 0x61, 0x72, 0x61, 0x74, 0x6F, 0x76, +0x00, 0xD3, 0xB0, 0xB5, 0x01, 0x56, 0x6E, 0xC2, 0x00, 0x00, 0x00, 0x12, 0x4D, 0x53, 0x4B, 0x2B, +0x30, 0x30, 0x20, 0x2D, 0x20, 0x56, 0x6F, 0x6C, 0x67, 0x6F, 0x67, 0x72, 0x61, 0x64, /* Europe/Warsaw */ 0x50, 0x48, 0x50, 0x32, 0x01, 0x50, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -47815,4 +47966,4 @@ const unsigned char timelib_timezone_db_data_builtin[272303] = { #endif 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00,}; -const timelib_tzdb timezonedb_builtin = { "2016.9", 591, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; +const timelib_tzdb timezonedb_builtin = { "2016.10", 593, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index b6dc791d3d..9984356c30 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -1075,7 +1075,7 @@ static dom_object* dom_objects_set_class(zend_class_entry *class_type, zend_bool dom_object *intern = ecalloc(1, sizeof(dom_object) + zend_object_properties_size(class_type)); zend_class_entry *base_class = class_type; - while (base_class->type != ZEND_INTERNAL_CLASS && base_class->parent != NULL) { + while ((base_class->type != ZEND_INTERNAL_CLASS || base_class->info.internal.module->module_number != dom_module_entry.module_number) && base_class->parent != NULL) { base_class = base_class->parent; } diff --git a/ext/fileinfo/tests/bug57547.phpt b/ext/fileinfo/tests/bug57547.phpt new file mode 100644 index 0000000000..512d4c030a --- /dev/null +++ b/ext/fileinfo/tests/bug57547.phpt @@ -0,0 +1,27 @@ +--TEST-- +Bug #57547 Settings options on file doesn't give same result as constructor options +--SKIPIF-- +<?php +if (!class_exists('finfo')) + die('skip no fileinfo extension'); +--FILE-- +<?php + +$filenames = array("..", __FILE__); + +foreach ($filenames as $filename) { + $finfo = new finfo(FILEINFO_MIME); + var_dump($finfo->file($filename)); + + $finfo2 = new finfo(); + var_dump($finfo2->file($filename, FILEINFO_MIME)); +} + +?> +===DONE=== +--EXPECT-- +string(9) "directory" +string(9) "directory" +string(28) "text/x-php; charset=us-ascii" +string(28) "text/x-php; charset=us-ascii" +===DONE=== diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 2aa03a9551..88c90487f5 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -1036,7 +1036,7 @@ void php_gd_error_method(int type, const char *format, va_list args) default: type = E_ERROR; } - php_verror(NULL, "", type, format, args TSRMLS_CC); + php_verror(NULL, "", type, format, args); } /* }}} */ #endif @@ -3040,7 +3040,7 @@ PHP_FUNCTION(imagegammacorrect) } if ( input <= 0.0 || output <= 0.0 ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Gamma values should be positive"); + php_error_docref(NULL, E_WARNING, "Gamma values should be positive"); RETURN_FALSE; } @@ -4668,7 +4668,7 @@ PHP_FUNCTION(imagecropauto) case GD_CROP_THRESHOLD: if (color < 0 || (!gdImageTrueColor(im) && color >= gdImageColorsTotal(im))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Color argument missing with threshold mode"); + php_error_docref(NULL, E_WARNING, "Color argument missing with threshold mode"); RETURN_FALSE; } im_crop = gdImageCropThreshold(im, color, (float) threshold); diff --git a/ext/gd/gd_ctx.c b/ext/gd/gd_ctx.c index da825671d6..206e4554f8 100644 --- a/ext/gd/gd_ctx.c +++ b/ext/gd/gd_ctx.c @@ -58,6 +58,16 @@ static int _php_image_stream_putbuf(struct gdIOCtx *ctx, const void* buf, int l) static void _php_image_stream_ctxfree(struct gdIOCtx *ctx) /* {{{ */ { + if(ctx->data) { + ctx->data = NULL; + } + if(ctx) { + efree(ctx); + } +} /* }}} */ + +static void _php_image_stream_ctxfreeandclose(struct gdIOCtx *ctx) /* {{{ */ +{ if(ctx->data) { php_stream_close((php_stream *) ctx->data); @@ -82,6 +92,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type, gdIOCtx *ctx = NULL; zval *to_zval = NULL; php_stream *stream; + int close_stream = 1; /* The third (quality) parameter for Wbmp stands for the threshold when called from image2wbmp(). * The third (quality) parameter for Wbmp and Xbm stands for the foreground color index when called @@ -120,6 +131,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type, if (stream == NULL) { RETURN_FALSE; } + close_stream = 0; } else if (Z_TYPE_P(to_zval) == IS_STRING) { if (CHECK_ZVAL_NULL_PATH(to_zval)) { php_error_docref(NULL, E_WARNING, "Invalid 2nd parameter, filename must not contain null bytes"); @@ -156,7 +168,11 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type, ctx = emalloc(sizeof(gdIOCtx)); ctx->putC = _php_image_stream_putc; ctx->putBuf = _php_image_stream_putbuf; - ctx->gd_free = _php_image_stream_ctxfree; + if (close_stream) { + ctx->gd_free = _php_image_stream_ctxfreeandclose; + } else { + ctx->gd_free = _php_image_stream_ctxfree; + } ctx->data = (void *)stream; } diff --git a/ext/gd/tests/bug73549.phpt b/ext/gd/tests/bug73549.phpt new file mode 100644 index 0000000000..e0cc6cf42e --- /dev/null +++ b/ext/gd/tests/bug73549.phpt @@ -0,0 +1,22 @@ +--TEST-- +Bug #73549 (Use after free when stream is passed to imagepng) +--SKIPIF-- +<?php +if (!extension_loaded('gd')) die('skip gd extension not available'); +?> +--FILE-- +<?php +$stream = fopen(__DIR__ . DIRECTORY_SEPARATOR . 'bug73549.png', 'w'); +$im = imagecreatetruecolor(8, 8); +var_dump(imagepng($im, $stream)); +var_dump($stream); +?> +===DONE=== +--EXPECTF-- +bool(true) +resource(%d) of type (stream) +===DONE=== +--CLEAN-- +<?php +unlink(__DIR__ . DIRECTORY_SEPARATOR . 'bug73549.png'); +?> diff --git a/ext/gd/tests/imagettftext_charmap_order.phpt b/ext/gd/tests/imagettftext_charmap_order.phpt index 2be20b7697..221e6b851a 100644 --- a/ext/gd/tests/imagettftext_charmap_order.phpt +++ b/ext/gd/tests/imagettftext_charmap_order.phpt @@ -4,6 +4,7 @@ Font charmap order is deterministic based on order in the font, use the selected <?php if(!extension_loaded('gd')){ die('skip gd extension not available'); } if(!function_exists('imagettftext')) die('skip imagettftext() not available'); + if(gd_info()['JIS-mapped Japanese Font Support']) die('skip JIS-mapped Japanese Font Support not supported'); ?> --FILE-- <?php diff --git a/ext/intl/grapheme/grapheme_string.c b/ext/intl/grapheme/grapheme_string.c index 5687e3e260..f69500429d 100644 --- a/ext/intl/grapheme/grapheme_string.c +++ b/ext/intl/grapheme/grapheme_string.c @@ -676,8 +676,10 @@ PHP_FUNCTION(grapheme_stristr) static inline int32_t grapheme_extract_charcount_iter(UBreakIterator *bi, int32_t csize, unsigned char *pstr, int32_t str_len) { - int pos = 0, prev_pos = 0; - int ret_pos = 0, prev_ret_pos = 0; + int pos = 0; + int ret_pos = 0; + int break_pos, prev_break_pos; + int count = 0; while ( 1 ) { pos = ubrk_next(bi); @@ -686,23 +688,24 @@ grapheme_extract_charcount_iter(UBreakIterator *bi, int32_t csize, unsigned char break; } - /* if we are beyond our limit, then the loop is done */ - if ( pos > csize ) { - break; - } + for ( break_pos = ret_pos; break_pos < pos; ) { + count++; + prev_break_pos = break_pos; + U8_FWD_1(pstr, break_pos, str_len); - /* update our pointer in the original UTF-8 buffer by as many characters - as ubrk_next iterated over */ - - prev_ret_pos = ret_pos; - U8_FWD_N(pstr, ret_pos, str_len, pos - prev_pos); + if ( prev_break_pos == break_pos ) { + /* something wrong - malformed utf8? */ + csize = 0; + break; + } + } - if ( prev_ret_pos == ret_pos ) { - /* something wrong - malformed utf8? */ + /* if we are beyond our limit, then the loop is done */ + if ( count > csize ) { break; } - prev_pos = pos; + ret_pos = break_pos; } return ret_pos; @@ -713,8 +716,8 @@ grapheme_extract_charcount_iter(UBreakIterator *bi, int32_t csize, unsigned char static inline int32_t grapheme_extract_bytecount_iter(UBreakIterator *bi, int32_t bsize, unsigned char *pstr, int32_t str_len) { - int pos = 0, prev_pos = 0; - int ret_pos = 0, prev_ret_pos = 0; + int pos = 0; + int ret_pos = 0; while ( 1 ) { pos = ubrk_next(bi); @@ -723,20 +726,11 @@ grapheme_extract_bytecount_iter(UBreakIterator *bi, int32_t bsize, unsigned char break; } - prev_ret_pos = ret_pos; - U8_FWD_N(pstr, ret_pos, str_len, pos - prev_pos); - - if ( ret_pos > bsize ) { - ret_pos = prev_ret_pos; - break; - } - - if ( prev_ret_pos == ret_pos ) { - /* something wrong - malformed utf8? */ + if ( pos > bsize ) { break; } - prev_pos = pos; + ret_pos = pos; } return ret_pos; @@ -747,7 +741,7 @@ grapheme_extract_bytecount_iter(UBreakIterator *bi, int32_t bsize, unsigned char static inline int32_t grapheme_extract_count_iter(UBreakIterator *bi, int32_t size, unsigned char *pstr, int32_t str_len) { - int pos = 0, next_pos = 0; + int next_pos = 0; int ret_pos = 0; while ( size ) { @@ -756,16 +750,10 @@ grapheme_extract_count_iter(UBreakIterator *bi, int32_t size, unsigned char *pst if ( UBRK_DONE == next_pos ) { break; } - pos = next_pos; + ret_pos = next_pos; size--; } - /* pos is one past the last UChar - and represent the number of code units to - advance in the utf-8 buffer - */ - - U8_FWD_N(pstr, ret_pos, str_len, pos); - return ret_pos; } /* }}} */ @@ -785,9 +773,8 @@ static grapheme_extract_iter grapheme_extract_iters[] = { PHP_FUNCTION(grapheme_extract) { char *str, *pstr; - UChar *ustr; + UText ut = UTEXT_INITIALIZER; size_t str_len; - int32_t ustr_len; zend_long size; /* maximum number of grapheme clusters, bytes, or characters (based on extract_type) to return */ zend_long lstart = 0; /* starting position in str in bytes */ int32_t start = 0; @@ -871,21 +858,15 @@ PHP_FUNCTION(grapheme_extract) RETURN_STRINGL(pstr, nsize); } - /* convert the strings to UTF-16. */ - ustr = NULL; - ustr_len = 0; status = U_ZERO_ERROR; - intl_convert_utf8_to_utf16(&ustr, &ustr_len, pstr, str_len, &status ); + utext_openUTF8(&ut, pstr, str_len, &status); if ( U_FAILURE( status ) ) { /* Set global error code. */ intl_error_set_code( NULL, status ); /* Set error messages. */ - intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 ); - - if ( NULL != ustr ) - efree( ustr ); + intl_error_set_custom_msg( NULL, "Error opening UTF-8 text", 0 ); RETURN_FALSE; } @@ -894,8 +875,7 @@ PHP_FUNCTION(grapheme_extract) status = U_ZERO_ERROR; bi = grapheme_get_break_iterator(u_break_iterator_buffer, &status ); - ubrk_setText(bi, ustr, ustr_len, &status); - + ubrk_setUText(bi, &ut, &status); /* if the caller put us in the middle of a grapheme, we can't detect it in all cases since we can't back up. So, we will not do anything. */ @@ -903,9 +883,7 @@ PHP_FUNCTION(grapheme_extract) /* it's ok to convert str_len to in32_t since if it were too big intl_convert_utf8_to_utf16 above would fail */ ret_pos = (*grapheme_extract_iters[extract_type])(bi, size, (unsigned char *)pstr, (int32_t)str_len); - if (ustr) { - efree(ustr); - } + utext_close(&ut); ubrk_close(bi); if ( NULL != next ) { diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c index 12cf6c1ce3..247262ad19 100644 --- a/ext/intl/locale/locale_methods.c +++ b/ext/intl/locale/locale_methods.c @@ -1628,7 +1628,7 @@ PHP_FUNCTION(locale_accept_from_http) len = end ? end-start : http_accept_len-(start-http_accept); if(len > ULOC_FULLNAME_CAPACITY) { intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, - "locale_accept_from_http: locale string too long", 0 TSRMLS_CC ); + "locale_accept_from_http: locale string too long", 0 ); RETURN_FALSE; } if(end) { diff --git a/ext/intl/tests/bug68447.phpt b/ext/intl/tests/bug68447.phpt new file mode 100644 index 0000000000..f320276df2 --- /dev/null +++ b/ext/intl/tests/bug68447.phpt @@ -0,0 +1,28 @@ +--TEST-- +Bug #68447: grapheme_extract take an extra trailing character +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +--FILE-- +<?php +$katsushikaku = "è‘›ó „飾区"; +echo grapheme_extract($katsushikaku, 1) . "\n"; + +$haiyore = "é€™ó „€ã„よれ"; +echo grapheme_extract($haiyore, 1, GRAPHEME_EXTR_COUNT) . "\n"; +echo grapheme_extract($haiyore, 2, GRAPHEME_EXTR_COUNT) . "\n"; +echo grapheme_extract($haiyore, 6, GRAPHEME_EXTR_MAXBYTES) . "\n"; +echo grapheme_extract($haiyore, 9, GRAPHEME_EXTR_MAXBYTES) . "\n"; +echo grapheme_extract($haiyore, 12, GRAPHEME_EXTR_MAXBYTES) . "\n"; +echo grapheme_extract($haiyore, 1, GRAPHEME_EXTR_MAXCHARS) . "\n"; +echo grapheme_extract($haiyore, 2, GRAPHEME_EXTR_MAXCHARS) . "\n"; +echo grapheme_extract($haiyore, 3, GRAPHEME_EXTR_MAXCHARS) . "\n"; +--EXPECT-- +è‘›ó „ +é€™ó „€ +é€™ó „€ã„ + +é€™ó „€ +é€™ó „€ã„ + +é€™ó „€ +é€™ó „€ã„ diff --git a/ext/json/json.c b/ext/json/json.c index 61445ee114..01319d5f5b 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -148,7 +148,7 @@ static PHP_GINIT_FUNCTION(json) #endif json_globals->encoder_depth = 0; json_globals->error_code = 0; - json_globals->encode_max_depth = 0; + json_globals->encode_max_depth = PHP_JSON_PARSER_DEFAULT_DEPTH; } /* }}} */ @@ -261,12 +261,12 @@ static PHP_FUNCTION(json_decode) } if (depth <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Depth must be greater than zero"); + php_error_docref(NULL, E_WARNING, "Depth must be greater than zero"); RETURN_NULL(); } if (depth > INT_MAX) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Depth must be lower than %d", INT_MAX); + php_error_docref(NULL, E_WARNING, "Depth must be lower than %d", INT_MAX); RETURN_NULL(); } diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_memory_device.c b/ext/mbstring/libmbfl/mbfl/mbfl_memory_device.c index 29782f5931..eae05953b2 100644 --- a/ext/mbstring/libmbfl/mbfl/mbfl_memory_device.c +++ b/ext/mbstring/libmbfl/mbfl/mbfl_memory_device.c @@ -146,6 +146,10 @@ mbfl_memory_device_output(int c, void *data) unsigned char *tmp; newlen = device->length + device->allocsz; + if (newlen <= 0) { + /* overflow */ + return -1; + } tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, newlen*sizeof(unsigned char)); if (tmp == NULL) { return -1; @@ -169,6 +173,10 @@ mbfl_memory_device_output2(int c, void *data) unsigned char *tmp; newlen = device->length + device->allocsz; + if (newlen <= 0) { + /* overflow */ + return -1; + } tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, newlen*sizeof(unsigned char)); if (tmp == NULL) { return -1; @@ -194,6 +202,10 @@ mbfl_memory_device_output4(int c, void* data) unsigned char *tmp; newlen = device->length + device->allocsz; + if (newlen <= 0) { + /* overflow */ + return -1; + } tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, newlen*sizeof(unsigned char)); if (tmp == NULL) { return -1; @@ -227,7 +239,12 @@ mbfl_memory_device_strcat(mbfl_memory_device *device, const char *psrc) if ((device->pos + len) >= device->length) { /* reallocate buffer */ int newlen = device->length + (len + MBFL_MEMORY_DEVICE_ALLOC_SIZE)*sizeof(unsigned char); - unsigned char *tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, newlen*sizeof(unsigned char)); + unsigned char *tmp; + if (newlen <= 0) { + /* overflow */ + return -1; + } + tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, newlen*sizeof(unsigned char)); if (tmp == NULL) { return -1; } @@ -254,7 +271,12 @@ mbfl_memory_device_strncat(mbfl_memory_device *device, const char *psrc, int len if ((device->pos + len) >= device->length) { /* reallocate buffer */ int newlen = device->length + len + MBFL_MEMORY_DEVICE_ALLOC_SIZE; - unsigned char *tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, newlen*sizeof(unsigned char)); + unsigned char *tmp; + if (newlen <= 0) { + /* overflow */ + return -1; + } + tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, newlen*sizeof(unsigned char)); if (tmp == NULL) { return -1; } @@ -281,7 +303,12 @@ mbfl_memory_device_devcat(mbfl_memory_device *dest, mbfl_memory_device *src) if ((dest->pos + src->pos) >= dest->length) { /* reallocate buffer */ int newlen = dest->length + src->pos + MBFL_MEMORY_DEVICE_ALLOC_SIZE; - unsigned char *tmp = (unsigned char *)mbfl_realloc((void *)dest->buffer, newlen*sizeof(unsigned char)); + unsigned char *tmp; + if (newlen <= 0) { + /* overflow */ + return -1; + } + tmp = (unsigned char *)mbfl_realloc((void *)dest->buffer, newlen*sizeof(unsigned char)); if (tmp == NULL) { return -1; } @@ -336,6 +363,10 @@ mbfl_wchar_device_output(int c, void *data) unsigned int *tmp; newlen = device->length + device->allocsz; + if (newlen <= 0) { + /* overflow */ + return -1; + } tmp = (unsigned int *)mbfl_realloc((void *)device->buffer, newlen*sizeof(int)); if (tmp == NULL) { return -1; diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 7ae96f597a..d5af96a5a1 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -3825,7 +3825,7 @@ detect_end: if (elist != NULL) { efree((void *)elist); } - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot handle recursive references"); + php_error_docref(NULL, E_WARNING, "Cannot handle recursive references"); RETURN_FALSE; } efree(stack); @@ -3942,7 +3942,7 @@ conv_end: } } efree(stack); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot handle recursive references"); + php_error_docref(NULL, E_WARNING, "Cannot handle recursive references"); RETURN_FALSE; } efree(stack); diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c index e7bdd43c9b..aa0abbd879 100644 --- a/ext/mcrypt/mcrypt.c +++ b/ext/mcrypt/mcrypt.c @@ -642,7 +642,7 @@ PHP_FUNCTION(mcrypt_generic) block_size = mcrypt_enc_get_block_size(pm->td); data_size = ((((int)data_len - 1) / block_size) + 1) * block_size; if (data_size <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Integer overflow in data size"); + php_error_docref(NULL, E_WARNING, "Integer overflow in data size"); RETURN_FALSE; } data_str = zend_string_alloc(data_size, 0); @@ -696,7 +696,7 @@ PHP_FUNCTION(mdecrypt_generic) block_size = mcrypt_enc_get_block_size(pm->td); data_size = ((((int)data_len - 1) / block_size) + 1) * block_size; if (data_size <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Integer overflow in data size"); + php_error_docref(NULL, E_WARNING, "Integer overflow in data size"); RETURN_FALSE; } data_s = emalloc((size_t)data_size + 1); diff --git a/ext/mysqli/tests/bug68077.phpt b/ext/mysqli/tests/bug68077.phpt index 3b6fa92ae3..0652e68c9b 100644 --- a/ext/mysqli/tests/bug68077.phpt +++ b/ext/mysqli/tests/bug68077.phpt @@ -41,7 +41,7 @@ open_basedir= if (!$link->query("SELECT 1 FROM DUAL")) printf("[005] [%d] %s\n", $link->errno, $link->error); - if (!$link->query("LOAD DATA LOCAL INFILE '" . __DIR__ . "/bug53503.data' INTO TABLE test")) { + if (!$link->query("LOAD DATA LOCAL INFILE '" . str_replace("\\", "/", __DIR__) . "/bug53503.data' INTO TABLE test")) { printf("[006] [%d] %s\n", $link->errno, $link->error); echo "bug\n"; } else { diff --git a/ext/mysqli/tests/bug_bits.phpt b/ext/mysqli/tests/bug_bits.phpt new file mode 100644 index 0000000000..8a56469772 --- /dev/null +++ b/ext/mysqli/tests/bug_bits.phpt @@ -0,0 +1,101 @@ +--TEST-- +Bug (Incorrectly decoding bit values / Malformed server packet. Field length pointing) +--SKIPIF-- +<?php +require_once('skipif.inc'); +require_once('skipifconnectfailure.inc'); +?> +--FILE-- +<?php + +require_once("connect.inc"); +if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) { + printf("[001] Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); +} + +if (!$link->query("DROP TABLE IF EXISTS bug_bits")) { + printf("[002] [%d] %s\n", $link->errno, $link->error); +} + +if (!$link->query("CREATE TABLE `bug_bits` (`inty` bigint(20) unsigned NOT NULL DEFAULT '0', `bitty` bit(64) NOT NULL DEFAULT b'0')")) { + printf("[003] [%d] %s\n", $link->errno, $link->error); +} + +$insertQuery = "INSERT INTO `bug_bits` VALUES (18446744073709551615, 18446744073709551615)". + ",(18446744073709551614, 18446744073709551614)". + ",(4294967296, 4294967296)". + ",(4294967295, 4294967295)". + ",(2147483648, 2147483648)". + ",(2147483647, 2147483647)". + ",(1, 1)"; +if (!$link->query($insertQuery)) { + printf("[004] [%d] %s\n", $link->errno, $link->error); +} + +if (!($res = $link->query("SELECT * FROM `bug_bits`"))) { + printf("[005] [%d] %s\n", $link->errno, $link->error); +} + +while ($row = $res->fetch_assoc()) { + var_dump($row); +} + +$link->close(); + +echo "Done\n"; +?> +--CLEAN-- +<?php +require_once("connect.inc"); +if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) + printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); + +if (!mysqli_query($link, "DROP TABLE IF EXISTS bug_bits")) + printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + +mysqli_close($link); +?> +--EXPECT-- +array(2) { + ["inty"]=> + string(20) "18446744073709551615" + ["bitty"]=> + string(20) "18446744073709551615" +} +array(2) { + ["inty"]=> + string(20) "18446744073709551614" + ["bitty"]=> + string(20) "18446744073709551614" +} +array(2) { + ["inty"]=> + string(10) "4294967296" + ["bitty"]=> + string(10) "4294967296" +} +array(2) { + ["inty"]=> + string(10) "4294967295" + ["bitty"]=> + string(10) "4294967295" +} +array(2) { + ["inty"]=> + string(10) "2147483648" + ["bitty"]=> + string(10) "2147483648" +} +array(2) { + ["inty"]=> + string(10) "2147483647" + ["bitty"]=> + string(10) "2147483647" +} +array(2) { + ["inty"]=> + string(1) "1" + ["bitty"]=> + string(1) "1" +} +Done diff --git a/ext/mysqli/tests/mysqli_expire_password.phpt b/ext/mysqli/tests/mysqli_expire_password.phpt index 4fdf902c79..6ce5eeaacc 100644 --- a/ext/mysqli/tests/mysqli_expire_password.phpt +++ b/ext/mysqli/tests/mysqli_expire_password.phpt @@ -127,10 +127,10 @@ if (!mysqli_query($link, sprintf("GRANT SELECT ON TABLE %s.test TO expiretest@'% ?> --EXPECTF-- -Warning: mysqli_real_connect(): (HY000/1862): %s in %s on line %d +Warning: mysqli%sconnect(): (HY000/1862): %s in %s on line %d [001] Cannot connect [1862] %s -Warning: mysqli_real_connect(): (HY000/1862): %s in %s on line %d +Warning: mysqli%sconnect(): (HY000/1862): %s in %s on line %d [003] Cannot connect [1862] %s [006] Connect allowed, query fail, [1820] %s [008] Connect allowed, pw set, [0%A diff --git a/ext/mysqlnd/mysqlnd_ps_codec.c b/ext/mysqlnd/mysqlnd_ps_codec.c index e0b6c5630f..da2436310e 100644 --- a/ext/mysqlnd/mysqlnd_ps_codec.c +++ b/ext/mysqlnd/mysqlnd_ps_codec.c @@ -88,6 +88,7 @@ ps_fetch_from_1_to_8_bytes(zval * zv, const MYSQLND_FIELD * const field, unsigne } else { DBG_INF("stringify"); tmp_len = sprintf((char *)&tmp, MYSQLND_LLU_SPEC, uval); + DBG_INF_FMT("value=%s", tmp); } } } else { diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c index 5871c3c346..9f2aafab2e 100644 --- a/ext/mysqlnd/mysqlnd_wireprotocol.c +++ b/ext/mysqlnd/mysqlnd_wireprotocol.c @@ -1607,7 +1607,8 @@ php_mysqlnd_rowp_read_text_protocol_aux(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval *current_field, *end_field, *start_field; zend_uchar * p = row_buffer->ptr; size_t data_size = row_buffer->app; - zend_uchar * bit_area = (zend_uchar*) row_buffer->ptr + data_size + 1; /* we allocate from here */ + /* we allocate from here. In pre-7.0 it was +1, as there was an additional \0 for the last string in the packet - because of the zval optimizations - using no-copy */ + zend_uchar * bit_area = (zend_uchar*) row_buffer->ptr + data_size; const zend_uchar * const packet_end = (zend_uchar*) row_buffer->ptr + data_size; DBG_ENTER("php_mysqlnd_rowp_read_text_protocol_aux"); @@ -1734,9 +1735,25 @@ php_mysqlnd_rowp_read_text_protocol_aux(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, */ p -= len; if (Z_TYPE_P(current_field) == IS_LONG) { + /* + Andrey : See below. No need of bit_area, as we can use on stack for this. + The bit area should be removed - the `prealloc_more_bytes` in php_mysqlnd_read_row_ex() + + char tmp[22]; + const size_t tmp_len = sprintf((char *)&tmp, MYSQLND_LLU_SPEC, Z_LVAL_P(current_field)); + ZVAL_STRINGL(current_field, tmp, tmp_len); + */ bit_area += 1 + sprintf((char *)start, ZEND_LONG_FMT, Z_LVAL_P(current_field)); ZVAL_STRINGL(current_field, (char *) start, bit_area - start - 1); - } else if (Z_TYPE_P(current_field) == IS_STRING){ + } else if (Z_TYPE_P(current_field) == IS_STRING) { + /* + Andrey : This is totally sensless, but I am not gonna remove it in a production version. + This copies the data from the zval to the bit area. The destroys the original value + and creates the same one from the bit area. No need. It was making sense in pre-7.0 + when we used zval IS_STRING with no-copy that referred to the bit area. + The bit area has no sense in both the case of IS_LONG and IS_STRING as 7.0 zval + IS_STRING always copies. + */ memcpy(bit_area, Z_STRVAL_P(current_field), Z_STRLEN_P(current_field)); bit_area += Z_STRLEN_P(current_field); *bit_area++ = '\0'; @@ -1815,7 +1832,15 @@ php_mysqlnd_rowp_read(void * _packet, MYSQLND_CONN_DATA * conn) packet_type_to_statistic_packet_count[PROT_ROW_PACKET], 1); - /* packet->row_buffer->ptr is of size 'data_size + 1' */ + /* + packet->row_buffer->ptr is of size 'data_size' + in pre-7.0 it was really 'data_size + 1' although it was counted as 'data_size' + The +1 was for the additional byte needed to \0 terminate the last string in the row. + This was needed as the zvals of pre-7.0 could use external memory (no copy param to ZVAL_STRINGL). + However, in 7.0+ the strings always copy. Thus this +1 byte was removed. Also the optimization or \0 + terminating every string, which did overwrite the lengths from the packet. For this reason we needed + to keep (and copy) the lengths externally. + */ packet->header.size = data_size; packet->row_buffer->app = data_size; diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 1491c88097..676e3939a8 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -582,7 +582,7 @@ static void accel_use_shm_interned_strings(void) for (j = 0; j < ce->constants_table.nNumUsed; j++) { q = ce->constants_table.arData + j; - if (!Z_TYPE(q->val) == IS_UNDEF) continue; + if (Z_TYPE(q->val) == IS_UNDEF) continue; if (q->key) { q->key = accel_new_interned_string(q->key); } @@ -592,7 +592,7 @@ static void accel_use_shm_interned_strings(void) /* constant hash keys */ for (idx = 0; idx < EG(zend_constants)->nNumUsed; idx++) { p = EG(zend_constants)->arData + idx; - if (!Z_TYPE(p->val) == IS_UNDEF) continue; + if (Z_TYPE(p->val) == IS_UNDEF) continue; if (p->key) { p->key = accel_new_interned_string(p->key); } @@ -1769,10 +1769,10 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type) file_handle->type == ZEND_HANDLE_FILENAME && UNEXPECTED(access(ZSTR_VAL(persistent_script->full_path), R_OK) != 0)) { if (type == ZEND_REQUIRE) { - zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename TSRMLS_CC); + zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename); zend_bailout(); } else { - zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename TSRMLS_CC); + zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename); } return NULL; } diff --git a/ext/opcache/tests/php_cli_server.inc b/ext/opcache/tests/php_cli_server.inc index 0878bfafc0..ca6854f553 100644 --- a/ext/opcache/tests/php_cli_server.inc +++ b/ext/opcache/tests/php_cli_server.inc @@ -20,28 +20,43 @@ function php_cli_server_start($ini = "") { $cmd = "exec {$php_executable} -t {$doc_root} $ini -S " . PHP_CLI_SERVER_ADDRESS . " 2>/dev/null"; $handle = proc_open($cmd, $descriptorspec, $pipes, $doc_root); } - + // note: even when server prints 'Listening on localhost:8964...Press Ctrl-C to quit.' // it might not be listening yet...need to wait until fsockopen() call returns - $i = 0; - while (($i++ < 30) && !($fp = @fsockopen(PHP_CLI_SERVER_HOSTNAME, PHP_CLI_SERVER_PORT))) { - usleep(10000); - } + $error = "Unable to connect to servers\n"; + for ($i=0; $i < 60; $i++) { + usleep(25000); // 25ms per try + $status = proc_get_status($handle); + $fp = @fsockopen(PHP_CLI_SERVER_HOSTNAME, PHP_CLI_SERVER_PORT); + // Failure, the server is no longer running + if (!($status && $status['running'])) { + $error = "Server is not running\n"; + break; + } + // Success, Connected to servers + if ($fp) { + $error = ''; + break; + } + } - if ($fp) { - fclose($fp); - } + if ($fp) { + fclose($fp); + } + + if ($error) { + echo $error; + proc_terminate($handle); + exit(1); + } register_shutdown_function( function($handle) { proc_terminate($handle); }, - $handle - ); - // don't bother sleeping, server is already up - // server can take a variable amount of time to be up, so just sleeping a guessed amount of time - // does not work. this is why tests sometimes pass and sometimes fail. to get a reliable pass - // sleeping doesn't work. + $handle + ); + } ?> diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index b6c8e13fd8..cbc3f24583 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -107,8 +107,6 @@ static ZEND_INI_MH(OnUpdateMemoryConsumption) #else char *base = (char *) ts_resource(*((int *) mh_arg2)); #endif - zend_long megabyte, overflow; - double dummy; /* keep the compiler happy */ (void)entry; (void)mh_arg2; (void)mh_arg3; (void)stage; @@ -132,10 +130,10 @@ static ZEND_INI_MH(OnUpdateMemoryConsumption) ini_entry->value = zend_string_init(new_new_value, 1, 1); } - megabyte = 1024 * 1024; - ZEND_SIGNED_MULTIPLY_LONG(memsize, megabyte, *p, dummy, overflow); - if (UNEXPECTED(overflow)) { + if (UNEXPECTED(memsize > ZEND_ULONG_MAX / (1024 * 1024))) { *p = ZEND_ULONG_MAX; + } else { + *p = memsize * (1024 * 1024); } return SUCCESS; } diff --git a/ext/openssl/tests/ServerClientTestCase.inc b/ext/openssl/tests/ServerClientTestCase.inc index 03e0c2de87..fe46300389 100644 --- a/ext/openssl/tests/ServerClientTestCase.inc +++ b/ext/openssl/tests/ServerClientTestCase.inc @@ -48,8 +48,12 @@ class ServerClientTestCase private function spawnWorkerProcess($code) { - $cmd = sprintf('%s "%s" %s', PHP_BINARY, __FILE__, WORKER_ARGV_VALUE); - + if (defined("PHP_WINDOWS_VERSION_MAJOR")) { + $ini = php_ini_loaded_file(); + $cmd = sprintf('%s %s "%s" %s', PHP_BINARY, $ini ? "-n -c $ini" : "", __FILE__, WORKER_ARGV_VALUE); + } else { + $cmd = sprintf('%s "%s" %s', PHP_BINARY, __FILE__, WORKER_ARGV_VALUE); + } $this->workerHandle = proc_open($cmd, [['pipe', 'r'], ['pipe', 'w'], STDERR], $pipes); $this->workerStdIn = $pipes[0]; $this->workerStdOut = $pipes[1]; diff --git a/ext/openssl/tests/openssl_pkey_new_basic.phpt b/ext/openssl/tests/openssl_pkey_new_basic.phpt index b0fd530975..b73b1f580c 100644 --- a/ext/openssl/tests/openssl_pkey_new_basic.phpt +++ b/ext/openssl/tests/openssl_pkey_new_basic.phpt @@ -89,7 +89,7 @@ var_dump($dh_details['g']); var_dump(strlen($dh_details['pub_key'])); var_dump(strlen($dh_details['priv_key'])); ?> ---EXPECT-- +--EXPECTF-- int(0) int(0) int(0) @@ -98,9 +98,9 @@ int(0) int(0) int(0) int(0) -int(20) -int(128) +int(%d) +int(%d) int(0) string(1) "2" -int(128) -int(128) +int(%d) +int(%d) diff --git a/ext/openssl/tests/openssl_x509_parse_basic.phpt b/ext/openssl/tests/openssl_x509_parse_basic.phpt index 00e32c3b60..9c2669e73b 100644 --- a/ext/openssl/tests/openssl_x509_parse_basic.phpt +++ b/ext/openssl/tests/openssl_x509_parse_basic.phpt @@ -3,6 +3,14 @@ openssl_x509_parse() tests --SKIPIF-- <?php if (!extension_loaded("openssl")) print "skip"; if (OPENSSL_VERSION_NUMBER < 0x10000000) die("skip Output requires OpenSSL 1.0"); +if(substr(PHP_OS, 0, 3) == 'WIN') { + $exp = "W. Europe Standard Time"; + $cmd = "powershell -command [System.TimeZoneInfo]::Local.Id"; + $r = trim(shell_exec($cmd)); + if ($exp !== $r) { + die("skip expect '$exp', got '$r'"); + } +} ?> --FILE-- <?php diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index 208aafcd7b..f9697d0483 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -1599,8 +1599,8 @@ int php_openssl_setup_crypto(php_stream *stream, if (sslsock->is_client) { SSL_CTX_set_alpn_protos(sslsock->ctx, alpn, alpn_len); } else { - sslsock->alpn_ctx = (php_openssl_alpn_ctx *) emalloc(sizeof(php_openssl_alpn_ctx)); - sslsock->alpn_ctx->data = (unsigned char*)estrndup((const char*)alpn, alpn_len); + sslsock->alpn_ctx = (php_openssl_alpn_ctx *) pemalloc(sizeof(php_openssl_alpn_ctx), php_stream_is_persistent(stream)); + sslsock->alpn_ctx->data = (unsigned char *) pestrndup((const char*)alpn, alpn_len, php_stream_is_persistent(stream)); sslsock->alpn_ctx->len = alpn_len; SSL_CTX_set_alpn_select_cb(sslsock->ctx, server_alpn_callback, sslsock); } @@ -1632,6 +1632,13 @@ int php_openssl_setup_crypto(php_stream *stream, php_error_docref(NULL, E_WARNING, "SSL handle creation failure"); SSL_CTX_free(sslsock->ctx); sslsock->ctx = NULL; +#ifdef HAVE_TLS_ALPN + if (sslsock->alpn_ctx) { + pefree(sslsock->alpn_ctx->data, php_stream_is_persistent(stream)); + pefree(sslsock->alpn_ctx, php_stream_is_persistent(stream)); + sslsock->alpn_ctx = NULL; + } +#endif return FAILURE; } else { SSL_set_ex_data(sslsock->ssl_handle, php_openssl_get_ssl_stream_data_index(), stream); @@ -2137,6 +2144,12 @@ static int php_openssl_sockop_close(php_stream *stream, int close_handle) /* {{{ SSL_CTX_free(sslsock->ctx); sslsock->ctx = NULL; } +#ifdef HAVE_TLS_ALPN + if (sslsock->alpn_ctx) { + pefree(sslsock->alpn_ctx->data, php_stream_is_persistent(stream)); + pefree(sslsock->alpn_ctx, php_stream_is_persistent(stream)); + } +#endif #ifdef PHP_WIN32 if (sslsock->s.socket == -1) sslsock->s.socket = SOCK_ERR; diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index b1ffe7f228..af1916aa45 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -114,9 +114,6 @@ static void php_free_pcre_cache(zval *data) /* {{{ */ } #if HAVE_SETLOCALE if ((void*)pce->tables) pefree((void*)pce->tables, 1); - if (pce->locale) { - zend_string_release(pce->locale); - } #endif pefree(pce, 1); } @@ -320,27 +317,30 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex) pcre_cache_entry *pce; pcre_cache_entry new_entry; int rc; + zend_string *key; + +#if HAVE_SETLOCALE + if (BG(locale_string) && + (ZSTR_LEN(BG(locale_string)) != 1 && ZSTR_VAL(BG(locale_string))[0] != 'C')) { + key = zend_string_alloc(ZSTR_LEN(regex) + ZSTR_LEN(BG(locale_string)) + 1, 0); + memcpy(ZSTR_VAL(key), ZSTR_VAL(BG(locale_string)), ZSTR_LEN(BG(locale_string)) + 1); + memcpy(ZSTR_VAL(key) + ZSTR_LEN(BG(locale_string)), ZSTR_VAL(regex), ZSTR_LEN(regex) + 1); + } else +#endif + { + key = regex; + } /* Try to lookup the cached regex entry, and if successful, just pass back the compiled pattern, otherwise go on and compile it. */ - pce = zend_hash_find_ptr(&PCRE_G(pcre_cache), regex); + pce = zend_hash_find_ptr(&PCRE_G(pcre_cache), key); if (pce) { #if HAVE_SETLOCALE - if (pce->locale == BG(locale_string) || - (pce->locale && BG(locale_string) && - ZSTR_LEN(pce->locale) == ZSTR_LEN(BG(locale_string)) && - !memcmp(ZSTR_VAL(pce->locale), ZSTR_VAL(BG(locale_string)), ZSTR_LEN(pce->locale))) || - (!pce->locale && - ZSTR_LEN(BG(locale_string)) == 1 && - ZSTR_VAL(BG(locale_string))[0] == 'C') || - (!BG(locale_string) && - ZSTR_LEN(pce->locale) == 1 && - ZSTR_VAL(pce->locale)[0] == 'C')) { - return pce; + if (key != regex) { + zend_string_release(key); } -#else - return pce; #endif + return pce; } p = ZSTR_VAL(regex); @@ -349,6 +349,11 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex) get to the end without encountering a delimiter. */ while (isspace((int)*(unsigned char *)p)) p++; if (*p == 0) { +#if HAVE_SETLOCALE + if (key != regex) { + zend_string_release(key); + } +#endif php_error_docref(NULL, E_WARNING, p < ZSTR_VAL(regex) + ZSTR_LEN(regex) ? "Null byte in regex" : "Empty regular expression"); return NULL; @@ -358,6 +363,11 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex) or a backslash. */ delimiter = *p++; if (isalnum((int)*(unsigned char *)&delimiter) || delimiter == '\\') { +#if HAVE_SETLOCALE + if (key != regex) { + zend_string_release(key); + } +#endif php_error_docref(NULL,E_WARNING, "Delimiter must not be alphanumeric or backslash"); return NULL; } @@ -397,6 +407,11 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex) } if (*pp == 0) { +#if HAVE_SETLOCALE + if (key != regex) { + zend_string_release(key); + } +#endif if (pp < ZSTR_VAL(regex) + ZSTR_LEN(regex)) { php_error_docref(NULL,E_WARNING, "Null byte in regex"); } else if (start_delimiter == end_delimiter) { @@ -453,13 +468,17 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex) php_error_docref(NULL,E_WARNING, "Null byte in regex"); } efree(pattern); +#if HAVE_SETLOCALE + if (key != regex) { + zend_string_release(key); + } +#endif return NULL; } } #if HAVE_SETLOCALE - if (BG(locale_string) && - (ZSTR_LEN(BG(locale_string)) != 1 || ZSTR_VAL(BG(locale_string))[0] != 'C')) { + if (key != regex) { tables = pcre_maketables(); } #endif @@ -472,6 +491,11 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex) tables); if (re == NULL) { +#if HAVE_SETLOCALE + if (key != regex) { + zend_string_release(key); + } +#endif php_error_docref(NULL,E_WARNING, "Compilation failed: %s at offset %d", error, erroffset); efree(pattern); if (tables) { @@ -516,7 +540,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex) * these are supposedly the oldest ones (but not necessarily the least used * ones). */ - if (zend_hash_num_elements(&PCRE_G(pcre_cache)) == PCRE_CACHE_SIZE) { + if (!pce && zend_hash_num_elements(&PCRE_G(pcre_cache)) == PCRE_CACHE_SIZE) { int num_clean = PCRE_CACHE_SIZE / 8; zend_hash_apply_with_argument(&PCRE_G(pcre_cache), pcre_clean_cache, &num_clean); } @@ -527,23 +551,29 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex) new_entry.preg_options = poptions; new_entry.compile_options = coptions; #if HAVE_SETLOCALE - new_entry.locale = BG(locale_string) ? - ((GC_FLAGS(BG(locale_string)) & IS_STR_PERSISTENT) ? - zend_string_copy(BG(locale_string)) : - zend_string_init(ZSTR_VAL(BG(locale_string)), ZSTR_LEN(BG(locale_string)), 1)) : - NULL; + new_entry.locale = NULL; new_entry.tables = tables; #endif new_entry.refcount = 0; rc = pcre_fullinfo(re, extra, PCRE_INFO_CAPTURECOUNT, &new_entry.capture_count); if (rc < 0) { +#if HAVE_SETLOCALE + if (key != regex) { + zend_string_release(key); + } +#endif php_error_docref(NULL, E_WARNING, "Internal pcre_fullinfo() error %d", rc); return NULL; } rc = pcre_fullinfo(re, extra, PCRE_INFO_NAMECOUNT, &new_entry.name_count); if (rc < 0) { +#if HAVE_SETLOCALE + if (key != regex) { + zend_string_release(key); + } +#endif php_error_docref(NULL, E_WARNING, "Internal pcre_fullinfo() error %d", rc); return NULL; } @@ -556,15 +586,18 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex) * as hash keys especually for this table. * See bug #63180 */ - if (!ZSTR_IS_INTERNED(regex) || !(GC_FLAGS(regex) & IS_STR_PERMANENT)) { - zend_string *str = zend_string_init(ZSTR_VAL(regex), ZSTR_LEN(regex), 1); - GC_REFCOUNT(str) = 0; /* will be incremented by zend_hash_update_mem() */ - ZSTR_H(str) = ZSTR_H(regex); - regex = str; + if (!ZSTR_IS_INTERNED(key) || !(GC_FLAGS(key) & IS_STR_PERMANENT)) { + pce = zend_hash_str_update_mem(&PCRE_G(pcre_cache), + ZSTR_VAL(key), ZSTR_LEN(key), &new_entry, sizeof(pcre_cache_entry)); +#if HAVE_SETLOCALE + if (key != regex) { + zend_string_release(key); + } +#endif + } else { + pce = zend_hash_update_mem(&PCRE_G(pcre_cache), key, &new_entry, sizeof(pcre_cache_entry)); } - pce = zend_hash_update_mem(&PCRE_G(pcre_cache), regex, &new_entry, sizeof(pcre_cache_entry)); - return pce; } /* }}} */ @@ -693,7 +726,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec /* Overwrite the passed-in value for subpatterns with an empty array. */ if (subpats != NULL) { - zval_dtor(subpats); + zval_ptr_dtor(subpats); array_init(subpats); } @@ -1559,7 +1592,7 @@ static PHP_FUNCTION(preg_replace) replace_count = preg_replace_impl(return_value, regex, replace, subject, limit, 0, 0); if (zcount) { - zval_dtor(zcount); + zval_ptr_dtor(zcount); ZVAL_LONG(zcount, replace_count); } } @@ -1594,7 +1627,7 @@ static PHP_FUNCTION(preg_replace_callback) replace_count = preg_replace_impl(return_value, regex, replace, subject, limit, 1, 0); if (zcount) { - zval_dtor(zcount); + zval_ptr_dtor(zcount); ZVAL_LONG(zcount, replace_count); } } @@ -1656,7 +1689,7 @@ static PHP_FUNCTION(preg_replace_callback_array) } ZEND_HASH_FOREACH_END(); if (zcount) { - zval_dtor(zcount); + zval_ptr_dtor(zcount); ZVAL_LONG(zcount, replace_count); } } @@ -1687,7 +1720,7 @@ static PHP_FUNCTION(preg_filter) replace_count = preg_replace_impl(return_value, regex, replace, subject, limit, 0, 1); if (zcount) { - zval_dtor(zcount); + zval_ptr_dtor(zcount); ZVAL_LONG(zcount, replace_count); } } diff --git a/ext/pcre/tests/bug73483.phpt b/ext/pcre/tests/bug73483.phpt new file mode 100644 index 0000000000..fd10702527 --- /dev/null +++ b/ext/pcre/tests/bug73483.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #73483 (Segmentation fault on pcre_replace_callback) +--FILE-- +<?php +$regex = "#dummy#"; +setlocale(LC_ALL, "C"); +var_dump(preg_replace_callback($regex, function (array $matches) use($regex) { + setlocale(LC_ALL, "en_US"); + $ret = preg_replace($regex, "okey", $matches[0]); + setlocale(LC_ALL, "C"); + return $ret; +}, "dummy")); +?> +--EXPECT-- +string(4) "okey" diff --git a/ext/pcre/tests/bug73612.phpt b/ext/pcre/tests/bug73612.phpt new file mode 100644 index 0000000000..707e10bce6 --- /dev/null +++ b/ext/pcre/tests/bug73612.phpt @@ -0,0 +1,27 @@ +--TEST--
+Bug #73612 (preg_*() may leak memory)
+--FILE--
+<?php
+$obj = new stdClass;
+$obj->obj = $obj;
+preg_match('/./', 'x', $obj);
+
+$obj = new stdClass;
+$obj->obj = $obj;
+preg_replace('/./', '', 'x', -1, $obj);
+
+$obj = new stdClass;
+$obj->obj = $obj;
+preg_replace_callback('/./', 'count', 'x', -1, $obj);
+
+$obj = new stdClass;
+$obj->obj = $obj;
+preg_replace_callback_array(['/./' => 'count'], 'x', -1, $obj);
+
+$obj = new stdClass;
+$obj->obj = $obj;
+preg_filter('/./', '', 'x', -1, $obj);
+?>
+===DONE===
+--EXPECT--
+===DONE===
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 0ff8a04000..a33bc2158c 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -2568,7 +2568,7 @@ static int row_prop_exists(zval *object, zval *member, int check_empty, void **c int res; zval val; - fetch_value(stmt, &val, colno, NULL TSRMLS_CC); + fetch_value(stmt, &val, colno, NULL); res = check_empty ? i_zend_is_true(&val) : Z_TYPE(val) != IS_NULL; zval_dtor(&val); diff --git a/ext/pdo/tests/bug_60665.phpt b/ext/pdo/tests/bug_60665.phpt index 28c1482154..bae3d603d7 100644 --- a/ext/pdo/tests/bug_60665.phpt +++ b/ext/pdo/tests/bug_60665.phpt @@ -13,8 +13,12 @@ PDOTest::skip(); if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; $db = PDOTest::factory(); - -$statement = $db->prepare("SELECT NULL AS null_value, 0 AS zero, 1 AS one"); +switch ($db->getAttribute(PDO::ATTR_DRIVER_NAME)) { + case 'oci': $from = 'from dual'; break; + case 'firebird': $from = 'from rdb$database'; break; + default: $from = ''; break; +} +$statement = $db->prepare("SELECT NULL AS null_value, 0 AS zero, 1 AS one $from"); $statement->execute(); $row = $statement->fetch(PDO::FETCH_LAZY); var_dump( diff --git a/ext/pdo_firebird/firebird_driver.c b/ext/pdo_firebird/firebird_driver.c index b26939ccd2..91cd3593ea 100644 --- a/ext/pdo_firebird/firebird_driver.c +++ b/ext/pdo_firebird/firebird_driver.c @@ -238,14 +238,16 @@ static zend_long firebird_handle_doer(pdo_dbh_t *dbh, const char *sql, size_t sq /* execute the statement */ if (isc_dsql_execute2(H->isc_status, &H->tr, &stmt, PDO_FB_SQLDA_VERSION, &in_sqlda, &out_sqlda)) { RECORD_ERROR(dbh); - return -1; + ret = -1; + goto free_statement; } /* find out how many rows were affected */ if (isc_dsql_sql_info(H->isc_status, &stmt, sizeof(info_count), const_cast(info_count), sizeof(result), result)) { RECORD_ERROR(dbh); - return -1; + ret = -1; + goto free_statement; } if (result[0] == isc_info_sql_records) { @@ -265,6 +267,12 @@ static zend_long firebird_handle_doer(pdo_dbh_t *dbh, const char *sql, size_t sq RECORD_ERROR(dbh); } +free_statement: + + if (isc_dsql_free_statement(H->isc_status, &stmt, DSQL_drop)) { + RECORD_ERROR(dbh); + } + return ret; } /* }}} */ diff --git a/ext/pdo_firebird/firebird_statement.c b/ext/pdo_firebird/firebird_statement.c index 994e92864c..64968428bd 100644 --- a/ext/pdo_firebird/firebird_statement.c +++ b/ext/pdo_firebird/firebird_statement.c @@ -98,9 +98,22 @@ static int firebird_stmt_execute(pdo_stmt_t *stmt) /* {{{ */ break; } S->cursor_open = 0; - /* assume all params have been bound */ - if (isc_dsql_execute(H->isc_status, &H->tr, &S->stmt, PDO_FB_SQLDA_VERSION, S->in_sqlda)) { + /* allocate storage for the output data */ + if (S->out_sqlda.sqld) { + unsigned int i; + for (i = 0; i < S->out_sqlda.sqld; i++) { + XSQLVAR *var = &S->out_sqlda.sqlvar[i]; + var->sqlind = (void*)ecalloc(1, var->sqllen + 2 * sizeof(short)); + var->sqldata = &((char*)var->sqlind)[sizeof(short)]; + } + } + + if (S->statement_type == isc_info_sql_stmt_exec_procedure) { + if (isc_dsql_execute2(H->isc_status, &H->tr, &S->stmt, PDO_FB_SQLDA_VERSION, S->in_sqlda, &S->out_sqlda)) { + break; + } + } else if (isc_dsql_execute(H->isc_status, &H->tr, &S->stmt, PDO_FB_SQLDA_VERSION, S->in_sqlda)) { break; } @@ -139,8 +152,8 @@ static int firebird_stmt_execute(pdo_stmt_t *stmt) /* {{{ */ } *S->name = 0; - S->cursor_open = (S->out_sqlda.sqln > 0); /* A cursor is opened, when more than zero columns returned */ - S->exhausted = !S->cursor_open; + S->cursor_open = S->out_sqlda.sqln && (S->statement_type != isc_info_sql_stmt_exec_procedure); + S->exhausted = !S->out_sqlda.sqln; /* There are data to fetch */ return 1; } while (0); @@ -162,6 +175,11 @@ static int firebird_stmt_fetch(pdo_stmt_t *stmt, /* {{{ */ strcpy(stmt->error_code, "HY000"); H->last_app_error = "Cannot fetch from a closed cursor"; } else if (!S->exhausted) { + if (S->statement_type == isc_info_sql_stmt_exec_procedure) { + stmt->row_count = 1; + S->exhausted = 1; + return 1; + } if (isc_dsql_fetch(H->isc_status, &S->stmt, PDO_FB_SQLDA_VERSION, &S->out_sqlda)) { if (H->isc_status[0] && H->isc_status[1]) { RECORD_ERROR(stmt); @@ -169,9 +187,6 @@ static int firebird_stmt_fetch(pdo_stmt_t *stmt, /* {{{ */ S->exhausted = 1; return 0; } - if (S->statement_type == isc_info_sql_stmt_exec_procedure) { - S->exhausted = 1; - } stmt->row_count++; return 1; } @@ -188,10 +203,6 @@ static int firebird_stmt_describe(pdo_stmt_t *stmt, int colno) /* {{{ */ int colname_len; char *cp; - /* allocate storage for the column */ - var->sqlind = (void*)ecalloc(1, var->sqllen + 2*sizeof(short)); - var->sqldata = &((char*)var->sqlind)[sizeof(short)]; - colname_len = (S->H->fetch_table_names && var->relname_length) ? (var->aliasname_length + var->relname_length + 1) : (var->aliasname_length); diff --git a/ext/pdo_firebird/tests/bug_72931.phpt b/ext/pdo_firebird/tests/bug_72931.phpt new file mode 100644 index 0000000000..ecbde6a109 --- /dev/null +++ b/ext/pdo_firebird/tests/bug_72931.phpt @@ -0,0 +1,24 @@ +--TEST-- +PDO_Firebird: Bug 72931 Insert returning fails on Firebird 3 +--SKIPIF-- +<?php if (!extension_loaded('interbase') || !extension_loaded('pdo_firebird')) die('skip'); ?> +--FILE-- +<?php +require 'testdb.inc'; +$C = new PDO('firebird:dbname='.$test_base, $user, $password) or die; +$C->exec('create table tablea (id integer)'); +$S = $C->prepare('insert into tablea (id) values (1) returning id'); +$S->execute(); +$D = $S->fetch(PDO::FETCH_NUM); +echo $D[0][0]; +unset($S); +unset($C); +?> +--CLEAN-- +<?php +require 'testdb.inc'; +$C = new PDO('firebird:dbname='.$test_base, $user, $password) or die; +$C->exec('DROP table tablea'); +?> +--EXPECT-- +1 diff --git a/ext/pdo_firebird/tests/bug_aaa.phpt b/ext/pdo_firebird/tests/bug_aaa.phpt new file mode 100644 index 0000000000..821d59afd2 --- /dev/null +++ b/ext/pdo_firebird/tests/bug_aaa.phpt @@ -0,0 +1,19 @@ +--TEST-- +PDO_Firebird: cursor should not be marked as opened on singleton statements +--SKIPIF-- +<?php if (!extension_loaded('interbase') || !extension_loaded('pdo_firebird')) die('skip'); ?> +--FILE-- +<?php +require 'testdb.inc'; +$C = new PDO('firebird:dbname='.$test_base, $user, $password, [PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING]) or die; +@$C->exec('drop table ta_table'); +$C->exec('create table ta_table (id integer)'); +$S = $C->prepare('insert into ta_table (id) values (:id) returning id'); +$S->execute(['id' => 1]); +$S->execute(['id' => 2]); +unset($S); +unset($C); +echo 'OK'; +?> +--EXPECT-- +OK
\ No newline at end of file diff --git a/ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt b/ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt index ebf22ef61b..38b49b6efa 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt @@ -16,6 +16,17 @@ if (count($tmp) < 2) if (($tmp[1] !== 'localhost') && ($tmp[1] !== '127.0.0.1')) die("skip Test cannot be run against remote database server"); +$stmt = $db->query("SHOW VARIABLES LIKE 'secure_file_priv'"); +if (($row = $stmt->fetch(PDO::FETCH_ASSOC)) && ($row['value'] != '')) { + if (!is_writable($row['value'])) + die("skip secure_file_priv directory not writable: {$row['value']}"); + + $filename = $row['value'] . DIRECTORY_SEPARATOR . "pdo_mysql_exec_load_data.csv"; + + if (file_exists($filename) && !is_writable($filename)) + die("skip {$filename} not writable"); +} + ?> --FILE-- <?php diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_load_data.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_load_data.phpt index 37d9cbdb77..9b07ac2479 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_prepare_load_data.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_load_data.phpt @@ -16,6 +16,17 @@ if (count($tmp) < 2) if (($tmp[1] !== 'localhost') && ($tmp[1] !== '127.0.0.1')) die("skip Test cannot be run against remote database server"); +$stmt = $db->query("SHOW VARIABLES LIKE 'secure_file_priv'"); +if (($row = $stmt->fetch(PDO::FETCH_ASSOC)) && ($row['value'] != '')) { + if (!is_writable($row['value'])) + die("skip secure_file_priv directory not writable: {$row['value']}"); + + $filename = $row['value'] . DIRECTORY_SEPARATOR . "pdo_mysql_exec_load_data.csv"; + + if (file_exists($filename) && !is_writable($filename)) + die("skip {$filename} not writable"); +} + ?> --FILE-- <?php @@ -115,4 +126,4 @@ Warning: PDOStatement::execute(): SQLSTATE[HY000]: General error: %s in %s on li 1 => %d, 2 => %s, ) -done!
\ No newline at end of file +done! diff --git a/ext/pdo_pgsql/tests/getnotify.phpt b/ext/pdo_pgsql/tests/getnotify.phpt index c54a31604d..27eef9d740 100644 --- a/ext/pdo_pgsql/tests/getnotify.phpt +++ b/ext/pdo_pgsql/tests/getnotify.phpt @@ -71,7 +71,7 @@ var_dump($db->pgsqlGetNotify()); $t = microtime(1); $notify = $db->pgsqlGetNotify(PDO::FETCH_ASSOC, 1000); $diff = microtime(1) - $t; -var_dump($diff >= 1 || 1 - abs($diff) < .01); +var_dump($diff >= 1 || 1 - abs($diff) < .05); var_dump($notify); // Test second parameter, should return immediately because a notify is queued @@ -79,7 +79,7 @@ $db->exec("NOTIFY notifies_phpt"); $t = microtime(1); $notify = $db->pgsqlGetNotify(PDO::FETCH_ASSOC, 5000); $diff = microtime(1) - $t; -var_dump($diff < 1 || abs(1 - abs($diff)) < .01); +var_dump($diff < 1 || abs(1 - abs($diff)) < .05); var_dump(count($notify)); ?> diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 570e9ec735..46cf2fa262 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -4096,7 +4096,7 @@ PHP_FUNCTION(pg_copy_to) free_pg_null = 1; } - spprintf(&query, 0, "COPY %s TO STDOUT DELIMITERS E'%c' WITH NULL AS E'%s'", table_name, *pg_delim, pg_null_as); + spprintf(&query, 0, "COPY %s TO STDOUT DELIMITER E'%c' NULL AS E'%s'", table_name, *pg_delim, pg_null_as); while ((pgsql_result = PQgetResult(pgsql))) { PQclear(pgsql_result); @@ -4229,7 +4229,7 @@ PHP_FUNCTION(pg_copy_from) pg_null_as_free = 1; } - spprintf(&query, 0, "COPY %s FROM STDIN DELIMITERS E'%c' WITH NULL AS E'%s'", table_name, *pg_delim, pg_null_as); + spprintf(&query, 0, "COPY %s FROM STDIN DELIMITER E'%c' NULL AS E'%s'", table_name, *pg_delim, pg_null_as); while ((pgsql_result = PQgetResult(pgsql))) { PQclear(pgsql_result); } diff --git a/ext/pgsql/tests/01createdb.phpt b/ext/pgsql/tests/01createdb.phpt index 8f7a262841..aa2e43748f 100644 --- a/ext/pgsql/tests/01createdb.phpt +++ b/ext/pgsql/tests/01createdb.phpt @@ -29,6 +29,9 @@ else { echo pg_last_error()."\n"; } +// Create view here +pg_query($db,$view_def); + pg_close($db); echo "OK"; diff --git a/ext/pgsql/tests/06_bug73498.phpt b/ext/pgsql/tests/06_bug73498.phpt new file mode 100644 index 0000000000..fdb2af2f97 --- /dev/null +++ b/ext/pgsql/tests/06_bug73498.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug 73498 Incorrect DELIMITER syntax for pg_copy_to() +--SKIPIF-- +<?php include("skipif.inc"); ?> +--FILE-- +<?php + +include('config.inc'); + +$db = pg_connect($conn_str); + +$rows = pg_copy_to($db, "(select * from {$view_name})"); + +var_dump(gettype($rows)); +var_dump(count($rows) > 0); + +?> +--EXPECT-- +string(5) "array" +bool(true) diff --git a/ext/pgsql/tests/9999dropdb.phpt b/ext/pgsql/tests/9999dropdb.phpt index 8cb178b2bf..80502e54b6 100644 --- a/ext/pgsql/tests/9999dropdb.phpt +++ b/ext/pgsql/tests/9999dropdb.phpt @@ -9,6 +9,7 @@ PostgreSQL drop db include('config.inc'); $db = pg_connect($conn_str); +pg_query($db, "DROP VIEW {$view_name}"); pg_query($db, "DROP TABLE ".$table_name); @pg_query($db, "DROP TABLE ".$table_name_92); diff --git a/ext/pgsql/tests/config.inc b/ext/pgsql/tests/config.inc index 7be1e242ad..fbe58588a2 100644 --- a/ext/pgsql/tests/config.inc +++ b/ext/pgsql/tests/config.inc @@ -11,6 +11,10 @@ $table_name = "php_pgsql_test"; // test table that will be created $table_name_92 = "php_pgsql_test_92"; // test table that will be created $num_test_record = 1000; // Number of records to create +// Test view +$view_name = "php_pgsql_viewtest"; +$view_def = "CREATE VIEW {$view_name} AS SELECT * FROM {$table_name};"; + // Test table $table_def = "CREATE TABLE ${table_name} (num int, str text, bin bytea);"; $table_def_92 = "CREATE TABLE ${table_name_92} (textary text[], jsn json);"; diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 860f5132d4..d4ec1c7977 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -3287,19 +3287,33 @@ static zend_op_array *phar_compile_file(zend_file_handle *file_handle, int type) /* zip or tar-based phar */ spprintf(&name, 4096, "phar://%s/%s", file_handle->filename, ".phar/stub.php"); - if (SUCCESS == phar_orig_zend_open((const char *)name, file_handle)) { + if (SUCCESS == phar_orig_zend_open((const char *)name, &f)) { + efree(name); name = NULL; - file_handle->filename = f.filename; - if (file_handle->opened_path) { - efree(file_handle->opened_path); + + f.filename = file_handle->filename; + if (f.opened_path) { + efree(f.opened_path); + } + f.opened_path = file_handle->opened_path; + f.free_filename = file_handle->free_filename; + + switch (file_handle->type) { + case ZEND_HANDLE_STREAM: + case ZEND_HANDLE_MAPPED: + if (file_handle->handle.stream.closer && file_handle->handle.stream.handle) { + file_handle->handle.stream.closer(file_handle->handle.stream.handle); + } + file_handle->handle.stream.handle = NULL; + break; + default: + break; } - file_handle->opened_path = f.opened_path; - file_handle->free_filename = f.free_filename; - } else { *file_handle = f; } } else if (phar->flags & PHAR_FILE_COMPRESSION_MASK) { + zend_file_handle_dtor(file_handle); /* compressed phar */ file_handle->type = ZEND_HANDLE_STREAM; /* we do our own reading directly from the phar, don't change the next line */ diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index c57bdef3c6..fc31a7e536 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -61,8 +61,8 @@ static void phar_mung_server_vars(char *fname, char *entry, int entry_len, char HashTable *_SERVER; zval *stuff; char *path_info; - int basename_len = strlen(basename); - int code; + size_t basename_len = strlen(basename); + size_t code; zval temp; /* "tweak" $_SERVER variables requested in earlier call to Phar::mungServer() */ @@ -150,7 +150,7 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char sapi_header_line ctr = {0}; size_t got; zval dummy; - int name_len; + size_t name_len; zend_file_handle file_handle; zend_op_array *new_op_array; zval result; @@ -162,9 +162,9 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char efree(basename); /* highlight source */ if (entry[0] == '/') { - name_len = spprintf(&name, 4096, "phar://%s%s", arch, entry); + spprintf(&name, 4096, "phar://%s%s", arch, entry); } else { - name_len = spprintf(&name, 4096, "phar://%s/%s", arch, entry); + spprintf(&name, 4096, "phar://%s/%s", arch, entry); } php_get_highlight_struct(&syntax_highlighter_ini); @@ -248,10 +248,10 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char PHAR_G(cwd_len) = 0; PHAR_G(cwd) = NULL; } else if (entry[0] == '/') { - PHAR_G(cwd_len) = cwd - (entry + 1); + PHAR_G(cwd_len) = (int)(cwd - (entry + 1)); PHAR_G(cwd) = estrndup(entry + 1, PHAR_G(cwd_len)); } else { - PHAR_G(cwd_len) = cwd - entry; + PHAR_G(cwd_len) = (int)(cwd - entry); PHAR_G(cwd) = estrndup(entry, PHAR_G(cwd_len)); } } @@ -322,7 +322,7 @@ static void phar_do_403(char *entry, int entry_len) /* {{{ */ } /* }}} */ -static void phar_do_404(phar_archive_data *phar, char *fname, int fname_len, char *f404, size_t f404_len, char *entry, size_t entry_len) /* {{{ */ +static void phar_do_404(phar_archive_data *phar, char *fname, int fname_len, char *f404, int f404_len, char *entry, size_t entry_len) /* {{{ */ { sapi_header_line ctr = {0}; phar_entry_info *info; @@ -398,7 +398,7 @@ static void phar_postprocess_ru_web(char *fname, int fname_len, char **entry, in } u[0] = '\0'; - u_len = strlen(u + 1); + u_len = (int)strlen(u + 1); e_len -= u_len + 1; if (e_len < 0) { @@ -426,7 +426,7 @@ PHP_METHOD(Phar, running) } fname = (char*)zend_get_executed_filename(); - fname_len = strlen(fname); + fname_len = (int)strlen(fname); if (fname_len > 7 && !memcmp(fname, "phar://", 7) && SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0)) { efree(entry); @@ -463,8 +463,12 @@ PHP_METHOD(Phar, mount) return; } + if (ZEND_SIZE_T_INT_OVFL(path_len) || ZEND_SIZE_T_INT_OVFL(actual_len)) { + RETURN_FALSE; + } + fname = (char*)zend_get_executed_filename(); - fname_len = strlen(fname); + fname_len = (int)strlen(fname); #ifdef PHP_WIN32 phar_unixify_path_separators(fname, fname_len); @@ -495,7 +499,7 @@ carry_on2: return; } carry_on: - if (SUCCESS != phar_mount_entry(pphar, actual, actual_len, path, path_len)) { + if (SUCCESS != phar_mount_entry(pphar, actual, (int)actual_len, path, (int)path_len)) { zend_throw_exception_ex(phar_ce_PharException, 0, "Mounting of %s to %s within phar %s failed", path, actual, arch); if (path && path == entry) { efree(entry); @@ -525,7 +529,7 @@ carry_on: } goto carry_on; - } else if (SUCCESS == phar_split_fname(path, path_len, &arch, &arch_len, &entry, &entry_len, 2, 0)) { + } else if (SUCCESS == phar_split_fname(path, (int)path_len, &arch, &arch_len, &entry, &entry_len, 2, 0)) { path = entry; path_len = entry_len; goto carry_on2; @@ -564,7 +568,12 @@ PHP_METHOD(Phar, webPhar) fname = (char*)zend_get_executed_filename(); fname_len = strlen(fname); - if (phar_open_executed_filename(alias, alias_len, &error) != SUCCESS) { + if (ZEND_SIZE_T_INT_OVFL(alias_len) + || ZEND_SIZE_T_INT_OVFL(f404_len) || ZEND_SIZE_T_INT_OVFL(index_php_len)) { + RETURN_FALSE; + } + + if (phar_open_executed_filename(alias, (int)alias_len, &error) != SUCCESS) { if (error) { zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error); efree(error); @@ -605,7 +614,7 @@ PHP_METHOD(Phar, webPhar) if (NULL != (z_path_info = zend_hash_str_find(_server, "PATH_INFO", sizeof("PATH_INFO")-1)) && IS_STRING == Z_TYPE_P(z_path_info)) { - entry_len = Z_STRLEN_P(z_path_info); + entry_len = (int)Z_STRLEN_P(z_path_info); entry = estrndup(Z_STRVAL_P(z_path_info), entry_len); path_info = emalloc(Z_STRLEN_P(z_script_name) + entry_len + 1); memcpy(path_info, Z_STRVAL_P(z_script_name), Z_STRLEN_P(z_script_name)); @@ -632,7 +641,7 @@ PHP_METHOD(Phar, webPhar) if (path_info) { entry = path_info; - entry_len = strlen(entry); + entry_len = (int)strlen(entry); spprintf(&path_info, 0, "%s%s", testit, path_info); free_pathinfo = 1; } else { @@ -653,7 +662,7 @@ PHP_METHOD(Phar, webPhar) return; } - entry_len = strlen(path_info); + entry_len = (int)strlen(path_info); entry_len -= (pt - path_info) + (fname_len - (basename - fname)); entry = estrndup(pt + (fname_len - (basename - fname)), entry_len); @@ -706,8 +715,12 @@ PHP_METHOD(Phar, webPhar) switch (Z_TYPE(retval)) { case IS_STRING: efree(entry); + if (ZEND_SIZE_T_INT_OVFL(Z_STRLEN_P(fci.retval))) { + zend_throw_exception_ex(phar_ce_PharException, 0, "phar error: rewrite callback returned oversized value"); + return; + } entry = estrndup(Z_STRVAL_P(fci.retval), Z_STRLEN_P(fci.retval)); - entry_len = Z_STRLEN_P(fci.retval); + entry_len = (int)Z_STRLEN_P(fci.retval); break; case IS_TRUE: case IS_FALSE: @@ -730,7 +743,7 @@ PHP_METHOD(Phar, webPhar) } if (entry_len) { - phar_postprocess_ru_web(fname, fname_len, &entry, &entry_len, &ru, &ru_len); + phar_postprocess_ru_web(fname, (int)fname_len, &entry, &entry_len, &ru, &ru_len); } if (!entry_len || (entry_len == 1 && entry[0] == '/')) { @@ -738,7 +751,7 @@ PHP_METHOD(Phar, webPhar) /* direct request */ if (index_php_len) { entry = index_php; - entry_len = index_php_len; + entry_len = (int)index_php_len; if (entry[0] != '/') { spprintf(&entry, 0, "/%s", index_php); ++entry_len; @@ -749,9 +762,9 @@ PHP_METHOD(Phar, webPhar) entry_len = sizeof("/index.php")-1; } - if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, NULL) || + if (FAILURE == phar_get_archive(&phar, fname, (int)fname_len, NULL, 0, NULL) || (info = phar_get_entry_info(phar, entry, entry_len, NULL, 0)) == NULL) { - phar_do_404(phar, fname, fname_len, f404, f404_len, entry, entry_len); + phar_do_404(phar, fname, (int)fname_len, f404, (int)f404_len, entry, entry_len); if (free_pathinfo) { efree(path_info); @@ -795,9 +808,9 @@ PHP_METHOD(Phar, webPhar) } } - if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, NULL) || + if (FAILURE == phar_get_archive(&phar, fname, (int)fname_len, NULL, 0, NULL) || (info = phar_get_entry_info(phar, entry, entry_len, NULL, 0)) == NULL) { - phar_do_404(phar, fname, fname_len, f404, f404_len, entry, entry_len); + phar_do_404(phar, fname, (int)fname_len, f404, (int)f404_len, entry, entry_len); #ifdef PHP_WIN32 efree(fname); #endif @@ -816,7 +829,7 @@ PHP_METHOD(Phar, webPhar) case IS_LONG: if (Z_LVAL_P(val) == PHAR_MIME_PHP || Z_LVAL_P(val) == PHAR_MIME_PHPS) { mime_type = ""; - code = Z_LVAL_P(val); + code = (int)Z_LVAL_P(val); } else { zend_throw_exception_ex(phar_ce_PharException, 0, "Unknown mime type specifier used, only Phar::PHP, Phar::PHPS and a mime type string are allowed"); if (free_pathinfo) { @@ -965,9 +978,12 @@ PHP_METHOD(Phar, mapPhar) return; } + if (ZEND_SIZE_T_INT_OVFL(alias_len)) { + RETURN_FALSE; + } phar_request_initialize(); - RETVAL_BOOL(phar_open_executed_filename(alias, alias_len, &error) == SUCCESS); + RETVAL_BOOL(phar_open_executed_filename(alias, (int)alias_len, &error) == SUCCESS); if (error) { zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error); @@ -986,9 +1002,12 @@ PHP_METHOD(Phar, loadPhar) return; } + if (ZEND_SIZE_T_INT_OVFL(alias_len) || ZEND_SIZE_T_INT_OVFL(fname_len)) { + RETURN_FALSE; + } phar_request_initialize(); - RETVAL_BOOL(phar_open_from_filename(fname, fname_len, alias, alias_len, REPORT_ERRORS, NULL, &error) == SUCCESS); + RETVAL_BOOL(phar_open_from_filename(fname, (int)fname_len, alias, (int)alias_len, REPORT_ERRORS, NULL, &error) == SUCCESS); if (error) { zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error); @@ -1066,8 +1085,12 @@ PHP_METHOD(Phar, isValidPharFilename) return; } + if (ZEND_SIZE_T_INT_OVFL(fname_len)) { + RETURN_FALSE; + } + is_executable = executable; - RETVAL_BOOL(phar_detect_phar_fname_ext(fname, fname_len, &ext_str, &ext_len, is_executable, 2, 1) == SUCCESS); + RETVAL_BOOL(phar_detect_phar_fname_ext(fname, (int)fname_len, &ext_str, &ext_len, is_executable, 2, 1) == SUCCESS); } /* }}} */ @@ -1143,6 +1166,9 @@ PHP_METHOD(Phar, __construct) } } + if (ZEND_SIZE_T_INT_OVFL(alias_len) || ZEND_SIZE_T_INT_OVFL(fname_len)) { + RETURN_FALSE; + } if (phar_obj->archive) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot call constructor twice"); return; @@ -1166,7 +1192,7 @@ PHP_METHOD(Phar, __construct) #endif } - if (phar_open_or_create_filename(fname, fname_len, alias, alias_len, is_data, REPORT_ERRORS, &phar_data, &error) == FAILURE) { + if (phar_open_or_create_filename(fname, (int)fname_len, alias, (int)alias_len, is_data, REPORT_ERRORS, &phar_data, &error) == FAILURE) { if (fname == arch && fname != save_fname) { efree(arch); @@ -1311,12 +1337,15 @@ PHP_METHOD(Phar, unlinkArchive) RETURN_FALSE; } + if (ZEND_SIZE_T_INT_OVFL(fname_len)) { + RETURN_FALSE; + } if (!fname_len) { zend_throw_exception_ex(phar_ce_PharException, 0, "Unknown phar archive \"\""); return; } - if (FAILURE == phar_open_from_filename(fname, fname_len, NULL, 0, REPORT_ERRORS, &phar, &error)) { + if (FAILURE == phar_open_from_filename(fname, (int)fname_len, NULL, 0, REPORT_ERRORS, &phar, &error)) { if (error) { zend_throw_exception_ex(phar_ce_PharException, 0, "Unknown phar archive \"%s\": %s", fname, error); efree(error); @@ -1327,7 +1356,7 @@ PHP_METHOD(Phar, unlinkArchive) } zname = (char*)zend_get_executed_filename(); - zname_len = strlen(zname); + zname_len = (int)strlen(zname); if (zname_len > 7 && !memcmp(zname, "phar://", 7) && SUCCESS == phar_split_fname(zname, zname_len, &arch, &arch_len, &entry, &entry_len, 2, 0)) { if (arch_len == fname_len && !memcmp(arch, fname, arch_len)) { @@ -1403,9 +1432,10 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */ zval *value; zend_bool close_fp = 1; struct _phar_t *p_obj = (struct _phar_t*) puser; - uint str_key_len, base_len = p_obj->l, fname_len; + uint base_len = p_obj->l, str_key_len; phar_entry_data *data; php_stream *fp; + php_stat_len fname_len; size_t contents_len; char *fname, *error = NULL, *base = p_obj->b, *save = NULL, *temp = NULL; zend_string *opened; @@ -1450,7 +1480,13 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */ return ZEND_HASH_APPLY_STOP; } - str_key_len = Z_STRLEN(key); + if (ZEND_SIZE_T_INT_OVFL(Z_STRLEN(key))) { + zval_dtor(&key); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned an invalid key (too long)", ZSTR_VAL(ce->name)); + return ZEND_HASH_APPLY_STOP; + } + + str_key_len = (int)Z_STRLEN(key); str_key = estrndup(Z_STRVAL(key), str_key_len); save = str_key; @@ -1477,7 +1513,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */ switch (intern->type) { case SPL_FS_DIR: test = spl_filesystem_object_get_path(intern, NULL); - fname_len = spprintf(&fname, 0, "%s%c%s", test, DEFAULT_SLASH, intern->u.dir.entry.d_name); + fname_len = (php_stat_len)spprintf(&fname, 0, "%s%c%s", test, DEFAULT_SLASH, intern->u.dir.entry.d_name); php_stat(fname, fname_len, FS_IS_DIR, &dummy); if (Z_TYPE(dummy) == IS_TRUE) { @@ -1491,7 +1527,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */ if (test) { fname = test; - fname_len = strlen(fname); + fname_len = (php_stat_len)strlen(fname); } else { zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Could not resolve file path"); return ZEND_HASH_APPLY_STOP; @@ -1507,7 +1543,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */ return ZEND_HASH_APPLY_STOP; } - fname_len = strlen(fname); + fname_len = (php_stat_len)strlen(fname); save = fname; goto phar_spl_fileinfo; } @@ -1519,7 +1555,7 @@ static int phar_build(zend_object_iterator *iter, void *puser) /* {{{ */ } fname = Z_STRVAL_P(value); - fname_len = Z_STRLEN_P(value); + fname_len = (php_stat_len)Z_STRLEN_P(value); phar_spl_fileinfo: if (base_len) { @@ -1533,7 +1569,7 @@ phar_spl_fileinfo: } base = temp; - base_len = strlen(base); + base_len = (int)strlen(base); if (strstr(fname, base)) { str_key_len = fname_len - base_len; @@ -1578,7 +1614,13 @@ phar_spl_fileinfo: return ZEND_HASH_APPLY_STOP; } - str_key_len = Z_STRLEN(key); + if (ZEND_SIZE_T_INT_OVFL(Z_STRLEN(key))) { + zval_dtor(&key); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned an invalid key (too long)", ZSTR_VAL(ce->name)); + return ZEND_HASH_APPLY_STOP; + } + + str_key_len = (int)Z_STRLEN(key); str_key = estrndup(Z_STRVAL(key), str_key_len); save = str_key; @@ -1743,6 +1785,10 @@ PHP_METHOD(Phar, buildFromDirectory) RETURN_FALSE; } + if (ZEND_SIZE_T_UINT_OVFL(dir_len)) { + RETURN_FALSE; + } + if (SUCCESS != object_init_ex(&iter, spl_ce_RecursiveDirectoryIterator)) { zval_ptr_dtor(&iter); zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to instantiate directory iterator for %s", phar_obj->archive->fname); @@ -1801,7 +1847,7 @@ PHP_METHOD(Phar, buildFromDirectory) pass.c = apply_reg ? Z_OBJCE(regexiter) : Z_OBJCE(iteriter); pass.p = phar_obj; pass.b = dir; - pass.l = dir_len; + pass.l = (uint)dir_len; pass.count = 0; pass.ret = return_value; pass.fp = php_stream_fopen_tmpfile(); @@ -1875,6 +1921,10 @@ PHP_METHOD(Phar, buildFromIterator) RETURN_FALSE; } + if (ZEND_SIZE_T_UINT_OVFL(base_len)) { + RETURN_FALSE; + } + if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); return; @@ -1885,7 +1935,7 @@ PHP_METHOD(Phar, buildFromIterator) pass.c = Z_OBJCE_P(obj); pass.p = phar_obj; pass.b = base; - pass.l = base_len; + pass.l = (uint)base_len; pass.ret = return_value; pass.count = 0; pass.fp = php_stream_fopen_tmpfile(); @@ -2008,7 +2058,7 @@ static zend_object *phar_rename_archive(phar_archive_data **sphar, char *ext, ze char *error; const char *pcr_error; int ext_len = ext ? strlen(ext) : 0; - int oldname_len; + size_t new_len, oldname_len; phar_archive_data *pphar = NULL; php_stream_statbuf ssb; @@ -2084,10 +2134,16 @@ static zend_object *phar_rename_archive(phar_archive_data **sphar, char *ext, ze spprintf(&newname, 0, "%s.%s", strtok(basename, "."), ext); efree(basename); - - basepath = estrndup(oldpath, (strlen(oldpath) - oldname_len)); - phar->fname_len = spprintf(&newpath, 0, "%s%s", basepath, newname); + new_len = spprintf(&newpath, 0, "%s%s", basepath, newname); + if (ZEND_SIZE_T_INT_OVFL(new_len)) { + efree(oldpath); + efree(basepath); + efree(newpath); + zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "New name is too long"); + return NULL; + } + phar->fname_len = (int)new_len; phar->fname = newpath; phar->ext = newpath + phar->fname_len - strlen(ext) - 1; efree(basepath); @@ -2140,7 +2196,7 @@ its_ok: phar->alias_len = 0; } else { phar->alias = estrndup(newpath, strlen(newpath)); - phar->alias_len = strlen(newpath); + phar->alias_len = (int)strlen(newpath); phar->is_temporary_alias = 1; zend_hash_str_update_ptr(&(PHAR_G(phar_alias_map)), newpath, phar->fname_len, phar); } @@ -2403,7 +2459,7 @@ PHP_METHOD(Phar, convertToExecutable) is_data = phar_obj->archive->is_data; phar_obj->archive->is_data = 0; - ret = phar_convert_to_other(phar_obj->archive, format, ext, flags); + ret = phar_convert_to_other(phar_obj->archive, (int)format, ext, flags); phar_obj->archive->is_data = is_data; if (ret) { @@ -2506,7 +2562,7 @@ PHP_METHOD(Phar, convertToData) is_data = phar_obj->archive->is_data; phar_obj->archive->is_data = 1; - ret = phar_convert_to_other(phar_obj->archive, format, ext, flags); + ret = phar_convert_to_other(phar_obj->archive, (int)format, ext, flags); phar_obj->archive->is_data = is_data; if (ret) { @@ -2687,12 +2743,15 @@ PHP_METHOD(Phar, setAlias) } if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &alias, &alias_len) == SUCCESS) { + if (ZEND_SIZE_T_INT_OVFL(alias_len)) { + RETURN_FALSE; + } if (alias_len == phar_obj->archive->alias_len && memcmp(phar_obj->archive->alias, alias, alias_len) == 0) { RETURN_TRUE; } if (alias_len && NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map)), alias, alias_len))) { spprintf(&error, 0, "alias \"%s\" is already used for archive \"%s\" and cannot be used for other archives", alias, fd_ptr->fname); - if (SUCCESS == phar_free_alias(fd_ptr, alias, alias_len)) { + if (SUCCESS == phar_free_alias(fd_ptr, alias, (int)alias_len)) { efree(error); goto valid_alias; } @@ -2700,7 +2759,7 @@ PHP_METHOD(Phar, setAlias) efree(error); RETURN_FALSE; } - if (!phar_validate_alias(alias, alias_len)) { + if (!phar_validate_alias(alias, (int)alias_len)) { zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Invalid alias \"%s\" specified for phar \"%s\"", alias, phar_obj->archive->fname); RETURN_FALSE; @@ -2725,13 +2784,13 @@ valid_alias: phar_obj->archive->alias = NULL; } - phar_obj->archive->alias_len = alias_len; + phar_obj->archive->alias_len = (int)alias_len; phar_obj->archive->is_temporary_alias = 0; phar_flush(phar_obj->archive, NULL, 0, 0, &error); if (error) { phar_obj->archive->alias = oldalias; - phar_obj->archive->alias_len = oldalias_len; + phar_obj->archive->alias_len = (int)oldalias_len; phar_obj->archive->is_temporary_alias = old_temp; zend_throw_exception_ex(phar_ce_PharException, 0, "%s", error); if (readd) { @@ -3003,6 +3062,11 @@ PHP_METHOD(Phar, setSignatureAlgorithm) if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "l|s", &algo, &key, &key_len) != SUCCESS) { return; } + if (ZEND_SIZE_T_INT_OVFL(key_len)) { + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, + "Cannot set signature algorithm, key too long"); + return; + } switch (algo) { case PHAR_SIG_SHA256: @@ -3019,10 +3083,10 @@ PHP_METHOD(Phar, setSignatureAlgorithm) zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); return; } - phar_obj->archive->sig_flags = algo; + phar_obj->archive->sig_flags = (php_uint32)algo; phar_obj->archive->is_modified = 1; PHAR_G(openssl_privatekey) = key; - PHAR_G(openssl_privatekey_len) = key_len; + PHAR_G(openssl_privatekey_len) = (int)key_len; phar_flush(phar_obj->archive, 0, 0, 0, &error); if (error) { @@ -3403,7 +3467,9 @@ PHP_METHOD(Phar, copy) if (zend_parse_parameters(ZEND_NUM_ARGS(), "pp", &oldfile, &oldfile_len, &newfile, &newfile_len) == FAILURE) { return; } - + if (ZEND_SIZE_T_INT_OVFL(newfile_len)) { + RETURN_FALSE; + } if (PHAR_G(readonly) && !phar_obj->archive->is_data) { zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Cannot copy \"%s\" to \"%s\", phar is read-only", oldfile, newfile); @@ -3463,7 +3529,7 @@ PHP_METHOD(Phar, copy) } newentry.filename = estrndup(newfile, newfile_len); - newentry.filename_len = newfile_len; + newentry.filename_len = (int)newfile_len; newentry.fp_refcount = 0; if (oldentry->fp_type != PHAR_FP) { @@ -3503,6 +3569,9 @@ PHP_METHOD(Phar, offsetExists) if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &fname, &fname_len) == FAILURE) { return; } + if (ZEND_SIZE_T_INT_OVFL(fname_len)) { + RETURN_FALSE; + } if (zend_hash_str_exists(&phar_obj->archive->manifest, fname, (uint) fname_len)) { if (NULL != (entry = zend_hash_str_find_ptr(&phar_obj->archive->manifest, fname, (uint) fname_len))) { @@ -3542,8 +3611,12 @@ PHP_METHOD(Phar, offsetGet) return; } + if (ZEND_SIZE_T_INT_OVFL(fname_len)) { + RETURN_FALSE; + } + /* security is 0 here so that we can get a better error message than "entry doesn't exist" */ - if (!(entry = phar_get_entry_info_dir(phar_obj->archive, fname, fname_len, 1, &error, 0))) { + if (!(entry = phar_get_entry_info_dir(phar_obj->archive, fname, (int)fname_len, 1, &error, 0))) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Entry %s does not exist%s%s", fname, error?", ":"", error?error:""); } else { if (fname_len == sizeof(".phar/stub.php")-1 && !memcmp(fname, ".phar/stub.php", sizeof(".phar/stub.php")-1)) { @@ -3689,7 +3762,9 @@ PHP_METHOD(Phar, offsetSet) && zend_parse_parameters(ZEND_NUM_ARGS(), "ps", &fname, &fname_len, &cont_str, &cont_len) == FAILURE) { return; } - + if (ZEND_SIZE_T_INT_OVFL(fname_len)) { + RETURN_FALSE; + } if (fname_len == sizeof(".phar/stub.php")-1 && !memcmp(fname, ".phar/stub.php", sizeof(".phar/stub.php")-1)) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot set stub \".phar/stub.php\" directly in phar \"%s\", use setStub", phar_obj->archive->fname); return; @@ -3705,7 +3780,7 @@ PHP_METHOD(Phar, offsetSet) return; } - phar_add_file(&(phar_obj->archive), fname, fname_len, cont_str, cont_len, zresource); + phar_add_file(&(phar_obj->archive), fname, (int)fname_len, cont_str, cont_len, zresource); } /* }}} */ @@ -3727,6 +3802,9 @@ PHP_METHOD(Phar, offsetUnset) if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &fname, &fname_len) == FAILURE) { return; } + if (ZEND_SIZE_T_INT_OVFL(fname_len)) { + RETURN_FALSE; + } if (zend_hash_str_exists(&phar_obj->archive->manifest, fname, (uint) fname_len)) { if (NULL != (entry = zend_hash_str_find_ptr(&phar_obj->archive->manifest, fname, (uint) fname_len))) { @@ -3774,13 +3852,16 @@ PHP_METHOD(Phar, addEmptyDir) if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &dirname, &dirname_len) == FAILURE) { return; } + if (ZEND_SIZE_T_INT_OVFL(dirname_len)) { + RETURN_FALSE; + } if (dirname_len >= sizeof(".phar")-1 && !memcmp(dirname, ".phar", sizeof(".phar")-1)) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot create a directory in magic \".phar\" directory"); return; } - phar_mkdir(&phar_obj->archive, dirname, dirname_len); + phar_mkdir(&phar_obj->archive, dirname, (int)dirname_len); } /* }}} */ @@ -3799,6 +3880,9 @@ PHP_METHOD(Phar, addFile) if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|s", &fname, &fname_len, &localname, &localname_len) == FAILURE) { return; } + if (ZEND_SIZE_T_INT_OVFL(fname_len)) { + RETURN_FALSE; + } #if PHP_API_VERSION < 20100412 if (PG(safe_mode) && (!php_checkuid(fname, NULL, CHECKUID_ALLOW_ONLY_FILE))) { @@ -3823,7 +3907,7 @@ PHP_METHOD(Phar, addFile) } php_stream_to_zval(resource, &zresource); - phar_add_file(&(phar_obj->archive), fname, fname_len, NULL, 0, &zresource); + phar_add_file(&(phar_obj->archive), fname, (int)fname_len, NULL, 0, &zresource); zval_ptr_dtor(&zresource); } /* }}} */ @@ -3841,8 +3925,11 @@ PHP_METHOD(Phar, addFromString) if (zend_parse_parameters(ZEND_NUM_ARGS(), "ps", &localname, &localname_len, &cont_str, &cont_len) == FAILURE) { return; } + if (ZEND_SIZE_T_INT_OVFL(localname_len)) { + RETURN_FALSE; + } - phar_add_file(&(phar_obj->archive), localname, localname_len, cont_str, cont_len, NULL); + phar_add_file(&(phar_obj->archive), localname, (int)localname_len, cont_str, cont_len, NULL); } /* }}} */ @@ -4063,7 +4150,7 @@ PHP_METHOD(Phar, delMetadata) static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char *dest, int dest_len, char **error) /* {{{ */ { php_stream_statbuf ssb; - int len; + size_t len; php_stream *fp; char *fullpath; const char *slash; @@ -4333,7 +4420,7 @@ PHP_METHOD(Phar, extractTo) zend_throw_exception_ex(phar_ce_PharException, 0, "Phar Error: attempted to extract non-existent file \"%s\" from phar \"%s\"", Z_STRVAL_P(zval_file), phar_obj->archive->fname); } - if (FAILURE == phar_extract_file(overwrite, entry, pathto, pathto_len, &error)) { + if (FAILURE == phar_extract_file(overwrite, entry, pathto, (int)pathto_len, &error)) { zend_throw_exception_ex(phar_ce_PharException, 0, "Extraction from phar \"%s\" failed: %s", phar_obj->archive->fname, error); efree(error); @@ -4354,7 +4441,7 @@ PHP_METHOD(Phar, extractTo) return; } - if (FAILURE == phar_extract_file(overwrite, entry, pathto, pathto_len, &error)) { + if (FAILURE == phar_extract_file(overwrite, entry, pathto, (int)pathto_len, &error)) { zend_throw_exception_ex(phar_ce_PharException, 0, "Extraction from phar \"%s\" failed: %s", phar_obj->archive->fname, error); efree(error); @@ -4370,7 +4457,7 @@ all_files: } ZEND_HASH_FOREACH_PTR(&phar->manifest, entry) { - if (FAILURE == phar_extract_file(overwrite, entry, pathto, pathto_len, &error)) { + if (FAILURE == phar_extract_file(overwrite, entry, pathto, (int)pathto_len, &error)) { zend_throw_exception_ex(phar_ce_PharException, 0, "Extraction from phar \"%s\" failed: %s", phar->fname, error); efree(error); diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index b24f9c691d..1c13aa5090 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -344,6 +344,15 @@ static void reflection_free_objects_storage(zend_object *object) /* {{{ */ } /* }}} */ +static HashTable *reflection_get_gc(zval *obj, zval **gc_data, int *gc_data_count) /* {{{ */ +{ + reflection_object *intern = Z_REFLECTION_P(obj); + *gc_data = &intern->obj; + *gc_data_count = 1; + return zend_std_get_properties(obj); +} +/* }}} */ + static zend_object *reflection_objects_new(zend_class_entry *class_type) /* {{{ */ { reflection_object *intern; @@ -6524,6 +6533,7 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */ reflection_object_handlers.free_obj = reflection_free_objects_storage; reflection_object_handlers.clone_obj = NULL; reflection_object_handlers.write_property = _reflection_write_property; + reflection_object_handlers.get_gc = reflection_get_gc; INIT_CLASS_ENTRY(_reflection_entry, "ReflectionException", reflection_exception_functions); reflection_exception_ptr = zend_register_internal_class_ex(&_reflection_entry, zend_ce_exception); diff --git a/ext/reflection/tests/bug46103.phpt b/ext/reflection/tests/bug46103.phpt new file mode 100644 index 0000000000..978a9c2c46 --- /dev/null +++ b/ext/reflection/tests/bug46103.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #46103: ReflectionObject memory leak +--FILE-- +<?php + +$obj = new stdClass; +$obj->r = new ReflectionObject($obj); +var_dump($obj); + +?> +--EXPECT-- +object(stdClass)#1 (1) { + ["r"]=> + object(ReflectionObject)#2 (1) { + ["name"]=> + string(8) "stdClass" + } +} diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c index b33f07e69e..7c25657616 100644 --- a/ext/session/mod_files.c +++ b/ext/session/mod_files.c @@ -175,7 +175,7 @@ static void ps_files_open(ps_files *data, const char *key) } if (!ps_files_path_create(buf, sizeof(buf), data, key)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to create session data file path. Too short session ID, invalid save_path or path lentgth exceeds MAXPATHLEN(%d)", MAXPATHLEN); + php_error_docref(NULL, E_WARNING, "Failed to create session data file path. Too short session ID, invalid save_path or path lentgth exceeds MAXPATHLEN(%d)", MAXPATHLEN); return; } @@ -200,7 +200,7 @@ static void ps_files_open(ps_files *data, const char *key) if (fstat(data->fd, &sbuf) || (sbuf.st_uid != 0 && sbuf.st_uid != getuid() && sbuf.st_uid != geteuid())) { close(data->fd); data->fd = -1; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Session data file is not created by your uid"); + php_error_docref(NULL, E_WARNING, "Session data file is not created by your uid"); return; } #endif diff --git a/ext/session/tests/bug66481-win32.phpt b/ext/session/tests/bug66481-win32.phpt deleted file mode 100644 index cf06cb6b95..0000000000 --- a/ext/session/tests/bug66481-win32.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Bug #66481: Calls to session_name() segfault when session.name is null, Windows. ---INI-- -session.name= ---SKIPIF-- -<?php include('skipif.inc'); ?> -<?php if(substr(PHP_OS, 0, 3) != "WIN") die("skip Windows only"); ?> ---FILE-- -<?php - -var_dump(session_name("foo")); -var_dump(session_name("bar")); ---EXPECTF-- -Warning: PHP Startup: session.name cannot be a numeric or empty '' in Unknown on line 0 -string(9) "PHPSESSID" -string(3) "foo" -PHP Warning: PHP Startup: session.name cannot be a numeric or empty '' in Unknown on line 0 diff --git a/ext/session/tests/bug66481.phpt b/ext/session/tests/bug66481.phpt index 5525ae8a38..cf6ad6a8d6 100644 --- a/ext/session/tests/bug66481.phpt +++ b/ext/session/tests/bug66481.phpt @@ -4,7 +4,6 @@ Bug #66481: Calls to session_name() segfault when session.name is null. session.name= --SKIPIF-- <?php include('skipif.inc'); ?> -<?php if(substr(PHP_OS, 0, 3) == "WIN") die("skip Not for Windows"); ?> --FILE-- <?php diff --git a/ext/session/tests/rfc1867_invalid_settings-win.phpt b/ext/session/tests/rfc1867_invalid_settings-win.phpt deleted file mode 100644 index ed854e8898..0000000000 --- a/ext/session/tests/rfc1867_invalid_settings-win.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -session rfc1867 invalid settings ---INI-- -session.upload_progress.freq=-1 -error_log= ---SKIPIF-- -<?php -include('skipif.inc'); -if(substr(PHP_OS, 0, 3) != "WIN") - die("skip windows only test"); -?> ---FILE-- -<?php -var_dump(ini_get("session.upload_progress.freq")); -?> ---EXPECTF-- -Warning: PHP Startup: session.upload_progress.freq must be greater than or equal to zero in %s -string(2) "1%" -PHP Warning: PHP Startup: session.upload_progress.freq must be greater than or equal to zero in %s diff --git a/ext/session/tests/rfc1867_invalid_settings.phpt b/ext/session/tests/rfc1867_invalid_settings.phpt index 640c4d2436..1a989e979b 100644 --- a/ext/session/tests/rfc1867_invalid_settings.phpt +++ b/ext/session/tests/rfc1867_invalid_settings.phpt @@ -6,8 +6,6 @@ error_log= --SKIPIF-- <?php include('skipif.inc'); -if(substr(PHP_OS, 0, 3) == "WIN") - die("skip Not for Windows"); ?> --FILE-- <?php diff --git a/ext/session/tests/rfc1867_invalid_settings_2-win.phpt b/ext/session/tests/rfc1867_invalid_settings_2-win.phpt deleted file mode 100644 index f8e6b6d208..0000000000 --- a/ext/session/tests/rfc1867_invalid_settings_2-win.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -session rfc1867 invalid settings 2 ---INI-- -session.upload_progress.freq=200% -error_log= ---SKIPIF-- -<?php -include('skipif.inc'); -if(substr(PHP_OS, 0, 3) != "WIN") - die("skip windows only test"); -?> ---FILE-- -<?php -var_dump(ini_get("session.upload_progress.freq")); -?> ---EXPECTF-- -Warning: PHP Startup: session.upload_progress.freq cannot be over 100% in %s -string(2) "1%" -PHP Warning: PHP Startup: session.upload_progress.freq cannot be over 100% in %s diff --git a/ext/session/tests/rfc1867_invalid_settings_2.phpt b/ext/session/tests/rfc1867_invalid_settings_2.phpt index c2a0c6ac4e..9246e1dbbc 100644 --- a/ext/session/tests/rfc1867_invalid_settings_2.phpt +++ b/ext/session/tests/rfc1867_invalid_settings_2.phpt @@ -6,8 +6,6 @@ error_log= --SKIPIF-- <?php include('skipif.inc'); -if(substr(PHP_OS, 0, 3) == "WIN") - die("skip Not for Windows"); ?> --FILE-- <?php diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index 63e8095ed7..2cfb345a24 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -2071,11 +2071,11 @@ static int php_snmp_has_property(zval *object, zval *member, int has_set_exists, } /* }}} */ -static HashTable *php_snmp_get_gc(zval *object, zval ***gc_data, int *gc_data_count TSRMLS_DC) /* {{{ */ +static HashTable *php_snmp_get_gc(zval *object, zval ***gc_data, int *gc_data_count) /* {{{ */ { *gc_data = NULL; *gc_data_count = 0; - return zend_std_get_properties(object TSRMLS_CC); + return zend_std_get_properties(object); } /* }}} */ diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 7947b4cea3..245f1b3e61 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -283,6 +283,16 @@ static encodePtr find_encoder_by_type_name(sdlPtr sdl, const char *type) return NULL; } +static zval *soap_hash_str_find_deref(HashTable *ht, const char *str, size_t len) { + zval *zv = zend_hash_str_find(ht, str, len); + if (!zv) { + return NULL; + } + + ZVAL_DEREF(zv); + return zv; +} + static zend_bool soap_check_zval_ref(zval *data, xmlNodePtr node) { xmlNodePtr node_ptr; @@ -380,6 +390,10 @@ static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xml xmlNodePtr node = NULL; int add_type = 0; + if (data) { + ZVAL_DEREF(data); + } + /* Special handling of class SoapVar */ if (data && Z_TYPE_P(data) == IS_OBJECT && @@ -388,14 +402,14 @@ static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xml encodePtr enc = NULL; HashTable *ht = Z_OBJPROP_P(data); - if ((ztype = zend_hash_str_find(ht, "enc_type", sizeof("enc_type")-1)) == NULL || + if ((ztype = soap_hash_str_find_deref(ht, "enc_type", sizeof("enc_type")-1)) == NULL || Z_TYPE_P(ztype) != IS_LONG) { soap_error0(E_ERROR, "Encoding: SoapVar has no 'enc_type' property"); } - if ((zstype = zend_hash_str_find(ht, "enc_stype", sizeof("enc_stype")-1)) != NULL && + if ((zstype = soap_hash_str_find_deref(ht, "enc_stype", sizeof("enc_stype")-1)) != NULL && Z_TYPE_P(zstype) == IS_STRING) { - if ((zns = zend_hash_str_find(ht, "enc_ns", sizeof("enc_ns")-1)) != NULL && + if ((zns = soap_hash_str_find_deref(ht, "enc_ns", sizeof("enc_ns")-1)) != NULL && Z_TYPE_P(zns) == IS_STRING) { enc = get_encoder(SOAP_GLOBAL(sdl), Z_STRVAL_P(zns), Z_STRVAL_P(zstype)); } else { @@ -422,13 +436,13 @@ static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xml enc = encode; } - zdata = zend_hash_str_find(ht, "enc_value", sizeof("enc_value")-1); + zdata = soap_hash_str_find_deref(ht, "enc_value", sizeof("enc_value")-1); node = master_to_xml(enc, zdata, style, parent); if (style == SOAP_ENCODED || (SOAP_GLOBAL(sdl) && encode != enc)) { - if ((zstype = zend_hash_str_find(ht, "enc_stype", sizeof("enc_stype")-1)) != NULL && + if ((zstype = soap_hash_str_find_deref(ht, "enc_stype", sizeof("enc_stype")-1)) != NULL && Z_TYPE_P(zstype) == IS_STRING) { - if ((zns = zend_hash_str_find(ht, "enc_ns", sizeof("enc_ns")-1)) != NULL && + if ((zns = soap_hash_str_find_deref(ht, "enc_ns", sizeof("enc_ns")-1)) != NULL && Z_TYPE_P(zns) == IS_STRING) { set_ns_and_type_ex(node, Z_STRVAL_P(zns), Z_STRVAL_P(zstype)); } else { @@ -437,11 +451,11 @@ static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xml } } - if ((zname = zend_hash_str_find(ht, "enc_name", sizeof("enc_name")-1)) != NULL && + if ((zname = soap_hash_str_find_deref(ht, "enc_name", sizeof("enc_name")-1)) != NULL && Z_TYPE_P(zname) == IS_STRING) { xmlNodeSetName(node, BAD_CAST(Z_STRVAL_P(zname))); } - if ((znamens = zend_hash_str_find(ht, "enc_namens", sizeof("enc_namens")-1)) != NULL && + if ((znamens = soap_hash_str_find_deref(ht, "enc_namens", sizeof("enc_namens")-1)) != NULL && Z_TYPE_P(znamens) == IS_STRING) { xmlNsPtr nsp = encode_add_ns(node, Z_STRVAL_P(znamens)); xmlSetNs(node, nsp); @@ -455,6 +469,7 @@ static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xml zend_string *type_name; ZEND_HASH_FOREACH_STR_KEY_VAL(SOAP_GLOBAL(class_map), type_name, tmp) { + ZVAL_DEREF(tmp); if (Z_TYPE_P(tmp) == IS_STRING && ZSTR_LEN(ce->name) == Z_STRLEN_P(tmp) && zend_binary_strncasecmp(ZSTR_VAL(ce->name), ZSTR_LEN(ce->name), Z_STRVAL_P(tmp), ZSTR_LEN(ce->name), ZSTR_LEN(ce->name)) == 0 && @@ -1193,6 +1208,7 @@ static zval* get_zval_property(zval* object, char* name, zval *rv) if (property_info != ZEND_WRONG_PROPERTY_INFO && property_info && zend_hash_exists(Z_OBJPROP_P(object), property_info->name)) { zval_ptr_dtor(&member); + ZVAL_DEREF(data); return data; } zval_ptr_dtor(&member); @@ -1200,13 +1216,10 @@ static zval* get_zval_property(zval* object, char* name, zval *rv) } zval_ptr_dtor(&member); EG(scope) = old_scope; + ZVAL_DEREF(data); return data; } else if (Z_TYPE_P(object) == IS_ARRAY) { - zval *data_ptr; - - if ((data_ptr = zend_hash_str_find(Z_ARRVAL_P(object), name, strlen(name))) != NULL) { - return data_ptr; - } + return soap_hash_str_find_deref(Z_ARRVAL_P(object), name, strlen(name)); } return NULL; } @@ -1421,7 +1434,7 @@ static zval *to_zval_object_ex(zval *ret, encodeTypePtr type, xmlNodePtr data, z zval *classname; zend_class_entry *tmp; - if ((classname = zend_hash_str_find(SOAP_GLOBAL(class_map), type->type_str, strlen(type->type_str))) != NULL && + if ((classname = soap_hash_str_find_deref(SOAP_GLOBAL(class_map), type->type_str, strlen(type->type_str))) != NULL && Z_TYPE_P(classname) == IS_STRING && (tmp = zend_fetch_class(Z_STR_P(classname), ZEND_FETCH_CLASS_AUTO)) != NULL) { ce = tmp; @@ -1642,6 +1655,7 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval * zval *val; ZEND_HASH_FOREACH_VAL(ht, val) { + ZVAL_DEREF(val); if (Z_TYPE_P(val) == IS_NULL && model->u.element->nillable) { property = xmlNewNode(NULL, BAD_CAST("BOGUS")); xmlAddChild(node, property); @@ -1896,6 +1910,7 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo ZEND_HASH_FOREACH_VAL(prop, val) { xmlNodePtr property; + ZVAL_DEREF(val); if (Z_TYPE_P(val) == IS_NULL && array_el->nillable) { property = xmlNewNode(NULL, BAD_CAST("BOGUS")); xmlAddChild(xmlParam, property); @@ -2327,6 +2342,7 @@ iterator_done: ZEND_HASH_FOREACH_VAL_IND(Z_ARRVAL_P(el), el) { break; } ZEND_HASH_FOREACH_END(); + ZVAL_DEREF(el); if (Z_TYPE_P(el) == IS_ARRAY) { dims[i] = zend_hash_num_elements(Z_ARRVAL_P(el)); } else { @@ -3520,20 +3536,20 @@ static encodePtr get_array_type(xmlNodePtr node, zval *array, smart_str *type) Z_OBJCE_P(tmp) == soap_var_class_entry) { zval *ztype; - if ((ztype = zend_hash_str_find(Z_OBJPROP_P(tmp), "enc_type", sizeof("enc_type")-1)) == NULL || + if ((ztype = soap_hash_str_find_deref(Z_OBJPROP_P(tmp), "enc_type", sizeof("enc_type")-1)) == NULL || Z_TYPE_P(ztype) != IS_LONG) { soap_error0(E_ERROR, "Encoding: SoapVar has no 'enc_type' property"); } cur_type = Z_LVAL_P(ztype); - if ((ztype = zend_hash_str_find(Z_OBJPROP_P(tmp), "enc_stype", sizeof("enc_stype")-1)) != NULL && + if ((ztype = soap_hash_str_find_deref(Z_OBJPROP_P(tmp), "enc_stype", sizeof("enc_stype")-1)) != NULL && Z_TYPE_P(ztype) == IS_STRING) { cur_stype = Z_STRVAL_P(ztype); } else { cur_stype = NULL; } - if ((ztype = zend_hash_str_find(Z_OBJPROP_P(tmp), "enc_ns", sizeof("enc_ns")-1)) != NULL && + if ((ztype = soap_hash_str_find_deref(Z_OBJPROP_P(tmp), "enc_ns", sizeof("enc_ns")-1)) != NULL && Z_TYPE_P(ztype) == IS_STRING) { cur_ns = Z_STRVAL_P(ztype); } else { diff --git a/ext/soap/soap.c b/ext/soap/soap.c index a2170283c8..ffa988472c 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -3209,12 +3209,8 @@ PHP_METHOD(SoapClient, __setSoapHeaders) if (headers == NULL || Z_TYPE_P(headers) == IS_NULL) { zend_hash_str_del(Z_OBJPROP_P(this_ptr), "__default_headers", sizeof("__default_headers")-1); } else if (Z_TYPE_P(headers) == IS_ARRAY) { - zval *default_headers; - verify_soap_headers_array(Z_ARRVAL_P(headers)); - if ((default_headers = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "__default_headers", sizeof("__default_headers")-1)) == NULL) { - add_property_zval(this_ptr, "__default_headers", headers); - } + add_property_zval(this_ptr, "__default_headers", headers); } else if (Z_TYPE_P(headers) == IS_OBJECT && instanceof_function(Z_OBJCE_P(headers), soap_header_class_entry)) { zval default_headers; diff --git a/ext/soap/tests/bug73452.phpt b/ext/soap/tests/bug73452.phpt new file mode 100644 index 0000000000..75f8c27016 --- /dev/null +++ b/ext/soap/tests/bug73452.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #73452 Segfault (Regression for #69152) +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php + +$data = 'O:9:"SoapFault":4:{s:9:"faultcode";i:4298448493;s:11:"faultstring";i:4298448543;s:7:"'."\0*\0".'file";i:4298447319;s:7:"'."\0*\0".'line";s:4:"ryat";}'; +echo unserialize($data); + +?> +==DONE== +--EXPECTF-- +SoapFault exception: [4298448493] 4298448543 in :0 +Stack trace: +#0 %sbug73452.php(4): unserialize('O:9:"SoapFault"...') +#1 {main}==DONE== diff --git a/ext/soap/tests/bugs/bug31422-win.phpt b/ext/soap/tests/bugs/bug31422-win.phpt deleted file mode 100644 index ba8df0726c..0000000000 --- a/ext/soap/tests/bugs/bug31422-win.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -Bug #31422 (No Error-Logging on SoapServer-Side) ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) != 'WIN') { - die('skip not valid for non windows'); -} -require_once('skipif.inc'); -?> ---INI-- -log_errors=1 ---FILE-- -<?php -function Add($x,$y) { - fopen(); - user_error("Hello", E_USER_ERROR); - return $x+$y; -} - -$server = new SoapServer(null,array('uri'=>"http://testuri.org")); -$server->addfunction("Add"); - -$HTTP_RAW_POST_DATA = <<<EOF -<?xml version="1.0" encoding="ISO-8859-1"?> -<SOAP-ENV:Envelope - SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" - xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" - xmlns:xsd="http://www.w3.org/2001/XMLSchema" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:si="http://soapinterop.org/xsd"> - <SOAP-ENV:Body> - <ns1:Add xmlns:ns1="http://testuri.org"> - <x xsi:type="xsd:int">22</x> - <y xsi:type="xsd:int">33</y> - </ns1:Add> - </SOAP-ENV:Body> -</SOAP-ENV:Envelope> -EOF; - -$server->handle($HTTP_RAW_POST_DATA); -echo "ok\n"; -?> ---EXPECTF-- -<?xml version="1.0" encoding="UTF-8"?> -<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Hello</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope> -PHP Warning: fopen() expects at least 2 parameters, 0 given in %sbug31422-win.php on line %d -PHP Fatal error: Hello in %sbug31422-win.php on line %d diff --git a/ext/soap/tests/bugs/bug31422.phpt b/ext/soap/tests/bugs/bug31422.phpt index c8ddcfe092..4889b10d8e 100644 --- a/ext/soap/tests/bugs/bug31422.phpt +++ b/ext/soap/tests/bugs/bug31422.phpt @@ -2,9 +2,6 @@ Bug #31422 (No Error-Logging on SoapServer-Side) --SKIPIF-- <?php -if (substr(PHP_OS, 0, 3) == 'WIN') { - die('skip not valid for windows'); -} require_once('skipif.inc'); ?> --INI-- diff --git a/ext/soap/tests/bugs/bug73538.phpt b/ext/soap/tests/bugs/bug73538.phpt new file mode 100644 index 0000000000..1bf0372419 --- /dev/null +++ b/ext/soap/tests/bugs/bug73538.phpt @@ -0,0 +1,35 @@ +--TEST-- +SOAP: SoapClient::__setHeaders array overrides previous headers +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php + +$client = new SoapClient(null, [ + "location" => "test://", + "uri" => "test://", + "exceptions" => false, + "trace" => true, +]); +$client->__setSoapHeaders(new \SoapHeader('ns', 'Header', ['something' => 1])); +$client->__setSoapHeaders(new \SoapHeader('ns', 'Header', ['something' => 2])); +$client->test(); +echo $client->__getLastRequest(); + +$client = new SoapClient(null, [ + "location" => "test://", + "uri" => "test://", + "exceptions" => false, + "trace" => true, +]); +$client->__setSoapHeaders([new \SoapHeader('ns', 'Header', ['something' => 1])]); +$client->__setSoapHeaders([new \SoapHeader('ns', 'Header', ['something' => 2])]); +$client->test(); +echo $client->__getLastRequest(); + +?> +--EXPECT-- +<?xml version="1.0" encoding="UTF-8"?> +<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="test://" xmlns:ns2="ns" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header><ns2:Header><item><key>something</key><value>2</value></item></ns2:Header></SOAP-ENV:Header><SOAP-ENV:Body><ns1:test/></SOAP-ENV:Body></SOAP-ENV:Envelope> +<?xml version="1.0" encoding="UTF-8"?> +<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="test://" xmlns:ns2="ns" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header><ns2:Header><item><key>something</key><value>2</value></item></ns2:Header></SOAP-ENV:Header><SOAP-ENV:Body><ns1:test/></SOAP-ENV:Body></SOAP-ENV:Envelope> diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index 63674c50d7..78c7652349 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -2370,7 +2370,7 @@ PHP_FUNCTION(socket_export_stream) char *protocol = NULL; size_t protocollen = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zsocket) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zsocket) == FAILURE) { return; } if ((socket = (php_socket *) zend_fetch_resource(Z_RES_P(zsocket), le_socket_name, le_socket)) == NULL) { diff --git a/ext/spl/tests/observer_010.phpt b/ext/spl/tests/observer_010.phpt new file mode 100644 index 0000000000..5cedff8c7c --- /dev/null +++ b/ext/spl/tests/observer_010.phpt @@ -0,0 +1,15 @@ +--TEST-- +SPL: SplObjectStorage null coalescing operator memory leak +--FILE-- +<?php +// In maintainer zts mode, this should no longer +// detect memory leaks for the objects +$a = new stdClass(); +$b = new stdClass(); +$map = new SplObjectStorage(); +$map[$a] = 'foo'; +var_dump($map[$b] ?? null); +var_dump($map[$a] ?? null); +--EXPECTF-- +NULL +string(3) "foo" diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index b3f0a29f5c..23d0b97b43 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -2167,6 +2167,9 @@ static void php_sqlite3_result_object_free_storage(zend_object *object) /* {{{ * } if (!Z_ISNULL(intern->stmt_obj_zval)) { + if (intern->stmt_obj && intern->stmt_obj->initialised) { + sqlite3_reset(intern->stmt_obj->stmt); + } zval_ptr_dtor(&intern->stmt_obj_zval); } diff --git a/ext/standard/dns.c b/ext/standard/dns.c index de40649e69..de277a3035 100644 --- a/ext/standard/dns.c +++ b/ext/standard/dns.c @@ -761,7 +761,7 @@ static u_char *php_parserr(u_char *cp, u_char *end, querybuf *answer, int type_t } /* }}} */ -/* {{{ proto array|false dns_get_record(string hostname [, int type[, array authns, array addtl]]) +/* {{{ proto array|false dns_get_record(string hostname [, int type[, array &authns[, array &addtl[, bool raw]]]]) Get any Resource Record corresponding to a given Internet host name */ PHP_FUNCTION(dns_get_record) { @@ -785,7 +785,7 @@ PHP_FUNCTION(dns_get_record) int type, first_query = 1, store_results = 1; zend_bool raw = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|lz!z!b", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|lz/!z/!b", &hostname, &hostname_len, &type_param, &authns, &addtl, &raw) == FAILURE) { return; } diff --git a/ext/standard/dns_win32.c b/ext/standard/dns_win32.c index f28977ab6a..d63bfd6a66 100644 --- a/ext/standard/dns_win32.c +++ b/ext/standard/dns_win32.c @@ -341,18 +341,18 @@ static void php_parserr(PDNS_RECORD pRec, int type_to_fetch, int store, int raw, } /* }}} */ -/* {{{ proto array|false dns_get_record(string hostname [, int type[, array authns, array addtl]]) +/* {{{ proto array|false dns_get_record(string hostname [, int type[, array &authns[, array &addtl[, bool raw]]]]) Get any Resource Record corresponding to a given Internet host name */ PHP_FUNCTION(dns_get_record) { char *hostname; size_t hostname_len; - long type_param = PHP_DNS_ANY; + zend_long type_param = PHP_DNS_ANY; zval *authns = NULL, *addtl = NULL; int type, type_to_fetch, first_query = 1, store_results = 1; zend_bool raw = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|lz!z!b", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|lz/!z/!b", &hostname, &hostname_len, &type_param, &authns, &addtl, &raw) == FAILURE) { return; } diff --git a/ext/standard/string.c b/ext/standard/string.c index 491e97a070..246f452913 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -20,8 +20,6 @@ /* $Id$ */ -/* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ - #include <stdio.h> #include "php.h" #include "php_rand.h" diff --git a/ext/standard/tests/file/bug47767.phpt b/ext/standard/tests/file/bug47767.phpt index 312476aa55..37db3b18fc 100644 --- a/ext/standard/tests/file/bug47767.phpt +++ b/ext/standard/tests/file/bug47767.phpt @@ -11,7 +11,9 @@ if(PHP_WINDOWS_VERSION_MAJOR < 6) { die('skip windows version 6.0+ only test'); } -$ret = exec('mklink rename_variation13tmp.lnk ' . __FILE__ .' 2>&1', $out); +$fn = "bug47767.lnk"; +$ret = exec("mklink $fn " . __FILE__ .' 2>&1', $out); +@unlink($fn); if (strpos($ret, 'privilege')) { die('skip. SeCreateSymbolicLinkPrivilege not enable for this user.'); } @@ -47,4 +49,4 @@ rmdir($junctionname); Testing include_once using file symbolic link I am included Testing include_once using directory symbolic link -Testing include_once using junction points
\ No newline at end of file +Testing include_once using junction points diff --git a/ext/standard/tests/file/rename_variation6-win32.phpt b/ext/standard/tests/file/rename_variation6-win32.phpt index 9aab0a7a83..dfb57f2e19 100644 --- a/ext/standard/tests/file/rename_variation6-win32.phpt +++ b/ext/standard/tests/file/rename_variation6-win32.phpt @@ -4,7 +4,9 @@ Test rename() function: usage variations-6 <?php if (substr(PHP_OS, 0, 3) != 'WIN') die('skip.. for Windows'); if (!function_exists("symlink")) die("skip symlinks are not supported"); -$ret = exec('mklink rename_variation13tmp.lnk ' . __FILE__ .' 2>&1', $out); +$fn = "rename_variation6tmp.lnk"; +$ret = exec("mklink $fn " . __FILE__ .' 2>&1', $out); +@unlink($fn); if (strpos($ret, 'privilege')) { die('skip. SeCreateSymbolicLinkPrivilege not enable for this user.'); } diff --git a/ext/standard/tests/filters/bug73586.phpt b/ext/standard/tests/filters/bug73586.phpt new file mode 100644 index 0000000000..3cae4662bf --- /dev/null +++ b/ext/standard/tests/filters/bug73586.phpt @@ -0,0 +1,45 @@ +--TEST-- +Bug #73586 (php_user_filter::$stream is not set to the stream the filter is working on). +--FILE-- +<?php +class append_filter extends php_user_filter { + public $stream; + function filter($in, $out, &$consumed, $closing) { + while ($bucket = stream_bucket_make_writeable($in)) { + $consumed += $bucket->datalen; + stream_bucket_append($out, $bucket); + } + if ($closing) { + $bucket = stream_bucket_new($this->stream, "FooBar\n"); + stream_bucket_append($out, $bucket); + } + return PSFS_PASS_ON; + } +} +stream_filter_register("append", "append_filter"); +$fin = fopen(__FILE__, 'rb'); +stream_filter_append($fin, 'append', STREAM_FILTER_READ); +stream_copy_to_stream($fin, STDOUT); +?> +--EXPECT-- +<?php +class append_filter extends php_user_filter { + public $stream; + function filter($in, $out, &$consumed, $closing) { + while ($bucket = stream_bucket_make_writeable($in)) { + $consumed += $bucket->datalen; + stream_bucket_append($out, $bucket); + } + if ($closing) { + $bucket = stream_bucket_new($this->stream, "FooBar\n"); + stream_bucket_append($out, $bucket); + } + return PSFS_PASS_ON; + } +} +stream_filter_register("append", "append_filter"); +$fin = fopen(__FILE__, 'rb'); +stream_filter_append($fin, 'append', STREAM_FILTER_READ); +stream_copy_to_stream($fin, STDOUT); +?> +FooBar diff --git a/ext/standard/tests/misc/get_browser_variation2.phpt b/ext/standard/tests/misc/get_browser_variation2.phpt new file mode 100644 index 0000000000..5c4d2ecd6e --- /dev/null +++ b/ext/standard/tests/misc/get_browser_variation2.phpt @@ -0,0 +1,94 @@ +--TEST-- +Test get_browser() function variation : Return data as object +--INI-- +browscap={PWD}/browscap.ini +--SKIPIF-- +<?php + /** + * Basic test, it would be pretty much coincidence if there's + * a browscap.ini on another place that isn't valid. + */ + if(! is_readable( ini_get( 'browscap' ) ) ) { + die( 'skip: browscap.ini file ' . ini_get('browscap') . " not readable" ); + } +?> +--FILE-- +<?php + +$agent = "Opera/7.11 (Windows NT 5.1; U) [en]"; +var_dump(get_browser($agent)); + +?> +--EXPECT-- +object(stdClass)#1 (35) { + ["browser_name_regex"]=> + string(41) "~^opera/7\.1.* \(windows nt 5\.1; .\).*$~" + ["browser_name_pattern"]=> + string(31) "Opera/7.1* (Windows NT 5.1; ?)*" + ["parent"]=> + string(9) "Opera 7.1" + ["platform"]=> + string(5) "WinXP" + ["win32"]=> + string(1) "1" + ["browser"]=> + string(5) "Opera" + ["version"]=> + string(3) "7.1" + ["majorver"]=> + string(1) "7" + ["minorver"]=> + string(1) "1" + ["frames"]=> + string(1) "1" + ["iframes"]=> + string(1) "1" + ["tables"]=> + string(1) "1" + ["cookies"]=> + string(1) "1" + ["backgroundsounds"]=> + string(1) "1" + ["javaapplets"]=> + string(1) "1" + ["javascript"]=> + string(1) "1" + ["css"]=> + string(1) "2" + ["cssversion"]=> + string(1) "2" + ["supportscss"]=> + string(1) "1" + ["alpha"]=> + string(0) "" + ["beta"]=> + string(0) "" + ["win16"]=> + string(0) "" + ["win64"]=> + string(0) "" + ["authenticodeupdate"]=> + string(0) "" + ["cdf"]=> + string(0) "" + ["vbscript"]=> + string(0) "" + ["activexcontrols"]=> + string(0) "" + ["stripper"]=> + string(0) "" + ["isbanned"]=> + string(0) "" + ["wap"]=> + string(0) "" + ["ismobiledevice"]=> + string(0) "" + ["issyndicationreader"]=> + string(0) "" + ["crawler"]=> + string(0) "" + ["aol"]=> + string(0) "" + ["aolversion"]=> + string(1) "0" +} diff --git a/ext/standard/tests/misc/time_sleep_until_basic.phpt b/ext/standard/tests/misc/time_sleep_until_basic.phpt index 05cc0e6de4..2be972a134 100644 --- a/ext/standard/tests/misc/time_sleep_until_basic.phpt +++ b/ext/standard/tests/misc/time_sleep_until_basic.phpt @@ -23,7 +23,9 @@ Michele Orselli mo@ideato.it // passes for up to .5 milliseconds less, fails for more than .5 milliseconds // should be fine since time_sleep_until() on Windows is accurate to the // millisecond(.5 rounded up is 1 millisecond) - $now = round($now, 3); + // In practice, on slower machines even that can fail, so giving yet 50ms or more. + $tmp = round($now, 3); + $now = $tmp >= (int)$time ? $tmp : $tmp + .05; } var_dump($now >= (int)$time); ?> diff --git a/ext/standard/tests/network/bug73594.phpt b/ext/standard/tests/network/bug73594.phpt new file mode 100644 index 0000000000..a3068360ce --- /dev/null +++ b/ext/standard/tests/network/bug73594.phpt @@ -0,0 +1,26 @@ +--TEST-- +Bug #73594 (dns_get_record() does not populate $additional out parameter) +--SKIPIF-- +<?php +if (getenv("SKIP_ONLINE_TESTS")) die("skip test requiring internet connection"); + +$out = array(); +$ret = 0; +exec("dig -tmx php.net +noall +additional 2>/dev/null", $out, $ret); + +if ($ret != 0) die("skip dig command is not present or failed to run"); + +// skip empty and header lines +$out = preg_grep("/^(?!($|;))/", $out); + +if (empty($out)) die("skip local resolver does not return additional records"); +?> +--FILE-- +<?php +$auth = array(); +$additional = array(); +dns_get_record('php.net', DNS_MX, $auth, $additional); +var_dump(empty($additional)); +?> +--EXPECT-- +bool(false) diff --git a/ext/standard/tests/network/bug73594a.phpt b/ext/standard/tests/network/bug73594a.phpt new file mode 100644 index 0000000000..a0a08e4a9e --- /dev/null +++ b/ext/standard/tests/network/bug73594a.phpt @@ -0,0 +1,25 @@ +--TEST-- +Bug #73594 (dns_get_record() does not populate $additional out parameter - $authns parameter) +--SKIPIF-- +<?php +if (getenv("SKIP_ONLINE_TESTS")) die("skip test requiring internet connection"); + +$out = array(); +$ret = 0; +exec("dig -tmx php.net +noall +authority 2>/dev/null", $out, $ret); + +if ($ret != 0) die("skip dig command is not present or failed to run"); + +// skip empty and header lines +$out = preg_grep("/^(?!($|;))/", $out); + +if (empty($out)) die("skip local resolver does not return authority records"); +?> +--FILE-- +<?php +$auth = array(); +dns_get_record('php.net', DNS_MX, $auth); +var_dump(empty($auth)); +?> +--EXPECT-- +bool(false) diff --git a/ext/standard/tests/serialize/bug70213.phpt b/ext/standard/tests/serialize/bug70213.phpt new file mode 100644 index 0000000000..c01d362be0 --- /dev/null +++ b/ext/standard/tests/serialize/bug70213.phpt @@ -0,0 +1,30 @@ +--TEST-- +Bug #70213: Unserialize context shared on double class lookup +--FILE-- +<?php + +ini_set('unserialize_callback_func', 'evil'); + +function evil() { + function __autoload($arg) { + var_dump(unserialize('R:1;')); + } +} + +var_dump(unserialize('a:2:{i:0;i:42;i:1;O:4:"evil":0:{}}')); + +?> +--EXPECTF-- +Notice: unserialize(): Error at offset 4 of 4 bytes in %s on line %d +bool(false) + +Warning: unserialize(): Function evil() hasn't defined the class it was called for in %s on line %d +array(2) { + [0]=> + int(42) + [1]=> + object(__PHP_Incomplete_Class)#1 (1) { + ["__PHP_Incomplete_Class_Name"]=> + string(4) "evil" + } +} diff --git a/ext/standard/tests/serialize/bug73154.phpt b/ext/standard/tests/serialize/bug73154.phpt new file mode 100644 index 0000000000..8d0f188bf7 --- /dev/null +++ b/ext/standard/tests/serialize/bug73154.phpt @@ -0,0 +1,16 @@ +--TEST-- +Bug #73154: serialize object with __sleep function crash +--FILE-- +<?php +class a { + public $a; + public function __sleep() { + $this->a=null; + return array(); + } +} +$s = 'a:1:{i:0;O:1:"a":1:{s:1:"a";R:2;}}'; +var_dump(serialize(unserialize($s))); +?> +--EXPECT-- +string(22) "a:1:{i:0;O:1:"a":0:{}}" diff --git a/ext/standard/tests/strings/bug65769.phpt b/ext/standard/tests/strings/bug65769.phpt index 23eeda9fd1..1a81d487c9 100644 --- a/ext/standard/tests/strings/bug65769.phpt +++ b/ext/standard/tests/strings/bug65769.phpt @@ -5,6 +5,9 @@ Bug #65769 localeconv() broken in TS builds if (substr(PHP_OS, 0, 3) != 'WIN') { die('skip Windows only'); } +if (PHP_WINDOWS_VERSION_MAJOR < 10) { + die("skip for Windows 10 and above"); +} ?> --FILE-- <?php diff --git a/ext/standard/url.c b/ext/standard/url.c index 5b281c795c..05500475ce 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -104,7 +104,7 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length) ue = s + length; /* parse scheme */ - if ((e = memchr(s, ':', length)) && (e - s)) { + if ((e = memchr(s, ':', length)) && e != s) { /* validate scheme */ p = s; while (p < e) { @@ -119,10 +119,10 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length) p++; } - if (*(e + 1) == '\0') { /* only scheme is available */ + if (e + 1 == ue) { /* only scheme is available */ ret->scheme = estrndup(s, (e - s)); php_replace_controlchars_ex(ret->scheme, (e - s)); - goto end; + return ret; } /* @@ -134,46 +134,39 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length) * correctly parse things like a.com:80 */ p = e + 1; - while (isdigit(*p)) { + while (p < ue && isdigit(*p)) { p++; } - if ((*p == '\0' || *p == '/') && (p - e) < 7) { + if ((p == ue || *p == '/') && (p - e) < 7) { goto parse_port; } ret->scheme = estrndup(s, (e-s)); php_replace_controlchars_ex(ret->scheme, (e - s)); - length -= ++e - s; - s = e; + s = e + 1; goto just_path; } else { ret->scheme = estrndup(s, (e-s)); php_replace_controlchars_ex(ret->scheme, (e - s)); - if (*(e+2) == '/') { + if (e + 2 < ue && *(e + 2) == '/') { s = e + 3; if (!strncasecmp("file", ret->scheme, sizeof("file"))) { - if (*(e + 3) == '/') { + if (e + 3 < ue && *(e + 3) == '/') { /* support windows drive letters as in: file:///c:/somedir/file.txt */ - if (*(e + 5) == ':') { + if (e + 5 < ue && *(e + 5) == ':') { s = e + 4; } - goto nohost; + goto just_path; } } } else { - if (!strncasecmp("file", ret->scheme, sizeof("file"))) { - s = e + 1; - goto nohost; - } else { - length -= ++e - s; - s = e; - goto just_path; - } + s = e + 1; + goto just_path; } } } else if (e) { /* no scheme; starts with colon: look for port */ @@ -181,18 +174,18 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length) p = e + 1; pp = p; - while (pp-p < 6 && isdigit(*pp)) { + while (pp < ue && pp - p < 6 && isdigit(*pp)) { pp++; } - if (pp - p > 0 && pp - p < 6 && (*pp == '/' || *pp == '\0')) { + if (pp - p > 0 && pp - p < 6 && (pp == ue || *pp == '/')) { zend_long port; memcpy(port_buf, p, (pp - p)); port_buf[pp - p] = '\0'; port = ZEND_STRTOL(port_buf, NULL, 10); if (port > 0 && port <= 65535) { ret->port = (unsigned short) port; - if (*s == '/' && *(s + 1) == '/') { /* relative-scheme URL */ + if (s + 1 < ue && *s == '/' && *(s + 1) == '/') { /* relative-scheme URL */ s += 2; } } else { @@ -200,24 +193,32 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length) efree(ret); return NULL; } - } else if (p == pp && *pp == '\0') { + } else if (p == pp && pp == ue) { if (ret->scheme) efree(ret->scheme); efree(ret); return NULL; - } else if (*s == '/' && *(s + 1) == '/') { /* relative-scheme URL */ + } else if (s + 1 < ue && *s == '/' && *(s + 1) == '/') { /* relative-scheme URL */ s += 2; } else { goto just_path; } - } else if (*s == '/' && *(s + 1) == '/') { /* relative-scheme URL */ + } else if (s + 1 < ue && *s == '/' && *(s + 1) == '/') { /* relative-scheme URL */ s += 2; } else { - just_path: - ue = s + length; - goto nohost; + goto just_path; } - e = s + strcspn(s, "/?#"); + /* Binary-safe strcspn(s, "/?#") */ + e = ue; + if ((p = memchr(s, '/', e - s))) { + e = p; + } + if ((p = memchr(s, '?', e - s))) { + e = p; + } + if ((p = memchr(s, '#', e - s))) { + e = p; + } /* check for login and password */ if ((p = zend_memrchr(s, '@', (e-s)))) { @@ -237,18 +238,16 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length) } /* check for port */ - if (*s == '[' && *(e-1) == ']') { + if (s < ue && *s == '[' && *(e-1) == ']') { /* Short circuit portscan, we're dealing with an IPv6 embedded address */ - p = s; + p = NULL; } else { - /* memrchr is a GNU specific extension - Emulate for wide compatibility */ - for(p = e; p >= s && *p != ':'; p--); + p = zend_memrchr(s, ':', (e-s)); } - if (p >= s && *p == ':') { + if (p) { if (!ret->port) { p++; if (e-p > 5) { /* port cannot be longer then 5 characters */ @@ -296,54 +295,34 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length) s = e; - nohost: - - if ((p = memchr(s, '?', (ue - s)))) { - pp = memchr(s, '#', (ue - s)); - - if (pp && pp < p) { - if (pp - s) { - ret->path = estrndup(s, (pp-s)); - php_replace_controlchars_ex(ret->path, (pp - s)); - } - p = pp; - goto label_parse; - } + just_path: - if (p - s) { - ret->path = estrndup(s, (p-s)); - php_replace_controlchars_ex(ret->path, (p - s)); - } - - if (pp) { - if (pp - ++p) { - ret->query = estrndup(p, (pp-p)); - php_replace_controlchars_ex(ret->query, (pp - p)); - } - p = pp; - goto label_parse; - } else if (++p - ue) { - ret->query = estrndup(p, (ue-p)); - php_replace_controlchars_ex(ret->query, (ue - p)); - } - } else if ((p = memchr(s, '#', (ue - s)))) { - if (p - s) { - ret->path = estrndup(s, (p-s)); - php_replace_controlchars_ex(ret->path, (p - s)); + e = ue; + p = memchr(s, '#', (e - s)); + if (p) { + p++; + if (p < e) { + ret->fragment = estrndup(p, (e - p)); + php_replace_controlchars_ex(ret->fragment, (e - p)); } + e = p-1; + } - label_parse: + p = memchr(s, '?', (e - s)); + if (p) { p++; - - if (ue - p) { - ret->fragment = estrndup(p, (ue-p)); - php_replace_controlchars_ex(ret->fragment, (ue - p)); + if (p < e) { + ret->query = estrndup(p, (e - p)); + php_replace_controlchars_ex(ret->query, (e - p)); } - } else { - ret->path = estrndup(s, (ue-s)); - php_replace_controlchars_ex(ret->path, (ue - s)); + e = p-1; } -end: + + if (s < e || s == ue) { + ret->path = estrndup(s, (e - s)); + php_replace_controlchars_ex(ret->path, (e - s)); + } + return ret; } /* }}} */ diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c index 2da03cd276..19aff782fd 100644 --- a/ext/standard/user_filters.c +++ b/ext/standard/user_filters.c @@ -175,7 +175,7 @@ php_stream_filter_status_t userfilter_filter( return ret; } - if (!zend_hash_str_exists(Z_OBJPROP_P(obj), "stream", sizeof("stream")-1)) { + if (!zend_hash_str_exists_ind(Z_OBJPROP_P(obj), "stream", sizeof("stream")-1)) { zval tmp; /* Give the userfilter class a hook back to the stream */ diff --git a/ext/standard/var.c b/ext/standard/var.c index 88719ccb64..c04afae4dc 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -860,9 +860,6 @@ again: return; case IS_OBJECT: { - zval retval; - zval fname; - int res; zend_class_entry *ce = Z_OBJCE_P(struc); if (ce->serialize != NULL) { @@ -891,32 +888,39 @@ again: } if (ce != PHP_IC_ENTRY && zend_hash_str_exists(&ce->function_table, "__sleep", sizeof("__sleep")-1)) { + zval fname, tmp, retval; + int res; + + ZVAL_COPY(&tmp, struc); ZVAL_STRINGL(&fname, "__sleep", sizeof("__sleep") - 1); BG(serialize_lock)++; - res = call_user_function_ex(CG(function_table), struc, &fname, &retval, 0, 0, 1, NULL); + res = call_user_function_ex(CG(function_table), &tmp, &fname, &retval, 0, 0, 1, NULL); BG(serialize_lock)--; zval_dtor(&fname); if (EG(exception)) { zval_ptr_dtor(&retval); + zval_ptr_dtor(&tmp); return; } if (res == SUCCESS) { if (Z_TYPE(retval) != IS_UNDEF) { if (HASH_OF(&retval)) { - php_var_serialize_class(buf, struc, &retval, var_hash); + php_var_serialize_class(buf, &tmp, &retval, var_hash); } else { php_error_docref(NULL, E_NOTICE, "__sleep should return an array only containing the names of instance-variables to serialize"); /* we should still add element even if it's not OK, * since we already wrote the length of the array before */ smart_str_appendl(buf,"N;", 2); } - zval_ptr_dtor(&retval); } + zval_ptr_dtor(&retval); + zval_ptr_dtor(&tmp); return; } zval_ptr_dtor(&retval); + zval_ptr_dtor(&tmp); } /* fall-through */ diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c index 6b33d84bd2..d1eb7b4bb0 100644 --- a/ext/standard/var_unserializer.c +++ b/ext/standard/var_unserializer.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.7.5 */ +/* Generated by re2c 0.16 */ #line 1 "ext/standard/var_unserializer.re" /* +----------------------------------------------------------------------+ @@ -587,112 +587,510 @@ static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER) 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; - if ((YYLIMIT - YYCURSOR) < 7) YYFILL(7); yych = *YYCURSOR; switch (yych) { case 'C': - case 'O': goto yy13; + case 'O': goto yy4; case 'N': goto yy5; - case 'R': goto yy2; - case 'S': goto yy10; - case 'a': goto yy11; - case 'b': goto yy6; - case 'd': goto yy8; - case 'i': goto yy7; + case 'R': goto yy6; + case 'S': goto yy7; + case 'a': goto yy8; + case 'b': goto yy9; + case 'd': goto yy10; + case 'i': goto yy11; case 'o': goto yy12; - case 'r': goto yy4; - case 's': goto yy9; - case '}': goto yy14; - default: goto yy16; + case 'r': goto yy13; + case 's': goto yy14; + case '}': goto yy15; + default: goto yy2; } yy2: - yych = *(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy95; + ++YYCURSOR; yy3: -#line 884 "ext/standard/var_unserializer.re" +#line 922 "ext/standard/var_unserializer.re" { return 0; } -#line 580 "ext/standard/var_unserializer.c" +#line 614 "ext/standard/var_unserializer.c" yy4: yych = *(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy89; + if (yych == ':') goto yy17; goto yy3; yy5: yych = *++YYCURSOR; - if (yych == ';') goto yy87; + if (yych == ';') goto yy19; goto yy3; yy6: yych = *(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy83; + if (yych == ':') goto yy21; goto yy3; yy7: yych = *(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy77; + if (yych == ':') goto yy22; goto yy3; yy8: yych = *(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy53; + if (yych == ':') goto yy23; goto yy3; yy9: yych = *(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy46; + if (yych == ':') goto yy24; goto yy3; yy10: yych = *(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy39; + if (yych == ':') goto yy25; goto yy3; yy11: yych = *(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy32; + if (yych == ':') goto yy26; goto yy3; yy12: yych = *(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy25; + if (yych == ':') goto yy27; goto yy3; yy13: yych = *(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy17; + if (yych == ':') goto yy28; goto yy3; yy14: + yych = *(YYMARKER = ++YYCURSOR); + if (yych == ':') goto yy29; + goto yy3; +yy15: ++YYCURSOR; -#line 878 "ext/standard/var_unserializer.re" +#line 916 "ext/standard/var_unserializer.re" { /* this is the case where we have less data than planned */ php_error_docref(NULL, E_NOTICE, "Unexpected end of serialized data"); return 0; /* not sure if it should be 0 or 1 here? */ } -#line 629 "ext/standard/var_unserializer.c" -yy16: - yych = *++YYCURSOR; - goto yy3; +#line 667 "ext/standard/var_unserializer.c" yy17: yych = *++YYCURSOR; if (yybm[0+yych] & 128) { - goto yy20; + goto yy31; } - if (yych == '+') goto yy19; + if (yych == '+') goto yy30; yy18: YYCURSOR = YYMARKER; goto yy3; yy19: + ++YYCURSOR; +#line 609 "ext/standard/var_unserializer.re" + { + *p = YYCURSOR; + ZVAL_NULL(rval); + return 1; +} +#line 685 "ext/standard/var_unserializer.c" +yy21: + yych = *++YYCURSOR; + if (yych <= ',') { + if (yych == '+') goto yy33; + goto yy18; + } else { + if (yych <= '-') goto yy33; + if (yych <= '/') goto yy18; + if (yych <= '9') goto yy34; + goto yy18; + } +yy22: + yych = *++YYCURSOR; + if (yych == '+') goto yy36; + if (yych <= '/') goto yy18; + if (yych <= '9') goto yy37; + goto yy18; +yy23: + yych = *++YYCURSOR; + if (yych == '+') goto yy39; + if (yych <= '/') goto yy18; + if (yych <= '9') goto yy40; + goto yy18; +yy24: + yych = *++YYCURSOR; + if (yych <= '/') goto yy18; + if (yych <= '1') goto yy42; + goto yy18; +yy25: + yych = *++YYCURSOR; + if (yych <= '/') { + if (yych <= ',') { + if (yych == '+') goto yy43; + goto yy18; + } else { + if (yych <= '-') goto yy44; + if (yych <= '.') goto yy45; + goto yy18; + } + } else { + if (yych <= 'I') { + if (yych <= '9') goto yy46; + if (yych <= 'H') goto yy18; + goto yy48; + } else { + if (yych == 'N') goto yy49; + goto yy18; + } + } +yy26: + yych = *++YYCURSOR; + if (yych <= ',') { + if (yych == '+') goto yy50; + goto yy18; + } else { + if (yych <= '-') goto yy50; + if (yych <= '/') goto yy18; + if (yych <= '9') goto yy51; + goto yy18; + } +yy27: + yych = *++YYCURSOR; + if (yych <= ',') { + if (yych == '+') goto yy53; + goto yy18; + } else { + if (yych <= '-') goto yy53; + if (yych <= '/') goto yy18; + if (yych <= '9') goto yy54; + goto yy18; + } +yy28: + yych = *++YYCURSOR; + if (yych <= ',') { + if (yych == '+') goto yy56; + goto yy18; + } else { + if (yych <= '-') goto yy56; + if (yych <= '/') goto yy18; + if (yych <= '9') goto yy57; + goto yy18; + } +yy29: + yych = *++YYCURSOR; + if (yych == '+') goto yy59; + if (yych <= '/') goto yy18; + if (yych <= '9') goto yy60; + goto yy18; +yy30: yych = *++YYCURSOR; if (yybm[0+yych] & 128) { - goto yy20; + goto yy31; } goto yy18; -yy20: +yy31: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; if (yybm[0+yych] & 128) { - goto yy20; + goto yy31; } if (yych <= '/') goto yy18; - if (yych >= ';') goto yy18; + if (yych <= ':') goto yy62; + goto yy18; +yy33: + yych = *++YYCURSOR; + if (yych <= '/') goto yy18; + if (yych >= ':') goto yy18; +yy34: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '/') goto yy18; + if (yych <= '9') goto yy34; + if (yych == ';') goto yy63; + goto yy18; +yy36: + yych = *++YYCURSOR; + if (yych <= '/') goto yy18; + if (yych >= ':') goto yy18; +yy37: + ++YYCURSOR; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + if (yych <= '/') goto yy18; + if (yych <= '9') goto yy37; + if (yych <= ':') goto yy65; + goto yy18; +yy39: + yych = *++YYCURSOR; + if (yych <= '/') goto yy18; + if (yych >= ':') goto yy18; +yy40: + ++YYCURSOR; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + if (yych <= '/') goto yy18; + if (yych <= '9') goto yy40; + if (yych <= ':') goto yy66; + goto yy18; +yy42: + yych = *++YYCURSOR; + if (yych == ';') goto yy67; + goto yy18; +yy43: + yych = *++YYCURSOR; + if (yych == '.') goto yy45; + if (yych <= '/') goto yy18; + if (yych <= '9') goto yy46; + goto yy18; +yy44: + yych = *++YYCURSOR; + if (yych <= '/') { + if (yych != '.') goto yy18; + } else { + if (yych <= '9') goto yy46; + if (yych == 'I') goto yy48; + goto yy18; + } +yy45: + yych = *++YYCURSOR; + if (yych <= '/') goto yy18; + if (yych <= '9') goto yy69; + goto yy18; +yy46: + ++YYCURSOR; + if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4); + yych = *YYCURSOR; + if (yych <= ':') { + if (yych <= '.') { + if (yych <= '-') goto yy18; + goto yy69; + } else { + if (yych <= '/') goto yy18; + if (yych <= '9') goto yy46; + goto yy18; + } + } else { + if (yych <= 'E') { + if (yych <= ';') goto yy71; + if (yych <= 'D') goto yy18; + goto yy73; + } else { + if (yych == 'e') goto yy73; + goto yy18; + } + } +yy48: + yych = *++YYCURSOR; + if (yych == 'N') goto yy74; + goto yy18; +yy49: + yych = *++YYCURSOR; + if (yych == 'A') goto yy75; + goto yy18; +yy50: + yych = *++YYCURSOR; + if (yych <= '/') goto yy18; + if (yych >= ':') goto yy18; +yy51: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '/') goto yy18; + if (yych <= '9') goto yy51; + if (yych == ';') goto yy76; + goto yy18; +yy53: + yych = *++YYCURSOR; + if (yych <= '/') goto yy18; + if (yych >= ':') goto yy18; +yy54: + ++YYCURSOR; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + if (yych <= '/') goto yy18; + if (yych <= '9') goto yy54; + if (yych <= ':') goto yy78; + goto yy18; +yy56: + yych = *++YYCURSOR; + if (yych <= '/') goto yy18; + if (yych >= ':') goto yy18; +yy57: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '/') goto yy18; + if (yych <= '9') goto yy57; + if (yych == ';') goto yy79; + goto yy18; +yy59: + yych = *++YYCURSOR; + if (yych <= '/') goto yy18; + if (yych >= ':') goto yy18; +yy60: + ++YYCURSOR; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + if (yych <= '/') goto yy18; + if (yych <= '9') goto yy60; + if (yych <= ':') goto yy81; + goto yy18; +yy62: + yych = *++YYCURSOR; + if (yych == '"') goto yy82; + goto yy18; +yy63: + ++YYCURSOR; +#line 558 "ext/standard/var_unserializer.re" + { + zend_long id; + + *p = YYCURSOR; + if (!var_hash) return 0; + + id = parse_iv(start + 2) - 1; + if (id == -1 || (rval_ref = var_access(var_hash, id)) == NULL) { + return 0; + } + + zval_ptr_dtor(rval); + if (Z_ISUNDEF_P(rval_ref) || (Z_ISREF_P(rval_ref) && Z_ISUNDEF_P(Z_REFVAL_P(rval_ref)))) { + ZVAL_UNDEF(rval); + return 1; + } + if (Z_ISREF_P(rval_ref)) { + ZVAL_COPY(rval, rval_ref); + } else { + ZVAL_NEW_REF(rval_ref, rval_ref); + ZVAL_COPY(rval, rval_ref); + } + + return 1; +} +#line 961 "ext/standard/var_unserializer.c" +yy65: + yych = *++YYCURSOR; + if (yych == '"') goto yy84; + goto yy18; +yy66: yych = *++YYCURSOR; - if (yych != '"') goto yy18; + if (yych == '{') goto yy86; + goto yy18; +yy67: ++YYCURSOR; -#line 733 "ext/standard/var_unserializer.re" +#line 615 "ext/standard/var_unserializer.re" + { + *p = YYCURSOR; + ZVAL_BOOL(rval, parse_iv(start + 2)); + return 1; +} +#line 978 "ext/standard/var_unserializer.c" +yy69: + ++YYCURSOR; + if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4); + yych = *YYCURSOR; + if (yych <= ';') { + if (yych <= '/') goto yy18; + if (yych <= '9') goto yy69; + if (yych <= ':') goto yy18; + } else { + if (yych <= 'E') { + if (yych <= 'D') goto yy18; + goto yy73; + } else { + if (yych == 'e') goto yy73; + goto yy18; + } + } +yy71: + ++YYCURSOR; +#line 663 "ext/standard/var_unserializer.re" + { +#if SIZEOF_ZEND_LONG == 4 +use_double: +#endif + *p = YYCURSOR; + ZVAL_DOUBLE(rval, zend_strtod((const char *)start + 2, NULL)); + return 1; +} +#line 1007 "ext/standard/var_unserializer.c" +yy73: + yych = *++YYCURSOR; + if (yych <= ',') { + if (yych == '+') goto yy88; + goto yy18; + } else { + if (yych <= '-') goto yy88; + if (yych <= '/') goto yy18; + if (yych <= '9') goto yy89; + goto yy18; + } +yy74: + yych = *++YYCURSOR; + if (yych == 'F') goto yy91; + goto yy18; +yy75: + yych = *++YYCURSOR; + if (yych == 'N') goto yy91; + goto yy18; +yy76: + ++YYCURSOR; +#line 621 "ext/standard/var_unserializer.re" + { +#if SIZEOF_ZEND_LONG == 4 + int digits = YYCURSOR - start - 3; + + if (start[2] == '-' || start[2] == '+') { + digits--; + } + + /* Use double for large zend_long values that were serialized on a 64-bit system */ + if (digits >= MAX_LENGTH_OF_LONG - 1) { + if (digits == MAX_LENGTH_OF_LONG - 1) { + int cmp = strncmp((char*)YYCURSOR - MAX_LENGTH_OF_LONG, long_min_digits, MAX_LENGTH_OF_LONG - 1); + + if (!(cmp < 0 || (cmp == 0 && start[2] == '-'))) { + goto use_double; + } + } else { + goto use_double; + } + } +#endif + *p = YYCURSOR; + ZVAL_LONG(rval, parse_iv(start + 2)); + return 1; +} +#line 1055 "ext/standard/var_unserializer.c" +yy78: + yych = *++YYCURSOR; + if (yych == '"') goto yy92; + goto yy18; +yy79: + ++YYCURSOR; +#line 584 "ext/standard/var_unserializer.re" + { + zend_long id; + + *p = YYCURSOR; + if (!var_hash) return 0; + + id = parse_iv(start + 2) - 1; + if (id == -1 || (rval_ref = var_access(var_hash, id)) == NULL) { + return 0; + } + + if (rval_ref == rval) { + return 0; + } + + if (Z_ISUNDEF_P(rval_ref) || (Z_ISREF_P(rval_ref) && Z_ISUNDEF_P(Z_REFVAL_P(rval_ref)))) { + ZVAL_UNDEF(rval); + return 1; + } + + ZVAL_COPY(rval, rval_ref); + + return 1; +} +#line 1087 "ext/standard/var_unserializer.c" +yy81: + yych = *++YYCURSOR; + if (yych == '"') goto yy94; + goto yy18; +yy82: + ++YYCURSOR; +#line 769 "ext/standard/var_unserializer.re" { size_t len, len2, len3, maxlen; zend_long elements; @@ -803,11 +1201,13 @@ yy20: } /* The callback function may have defined the class */ + BG(serialize_lock)++; if ((ce = zend_lookup_class(class_name)) == NULL) { php_error_docref(NULL, E_WARNING, "Function %s() hasn't defined the class it was called for", Z_STRVAL(user_func)); incomplete_class = 1; ce = PHP_IC_ENTRY; } + BG(serialize_lock)--; zval_ptr_dtor(&user_func); zval_ptr_dtor(&args[0]); @@ -837,105 +1237,10 @@ yy20: return object_common2(UNSERIALIZE_PASSTHRU, elements); } -#line 805 "ext/standard/var_unserializer.c" -yy25: - yych = *++YYCURSOR; - if (yych <= ',') { - if (yych != '+') goto yy18; - } else { - if (yych <= '-') goto yy26; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy27; - goto yy18; - } -yy26: - yych = *++YYCURSOR; - if (yych <= '/') goto yy18; - if (yych >= ':') goto yy18; -yy27: - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy27; - if (yych >= ';') goto yy18; - yych = *++YYCURSOR; - if (yych != '"') goto yy18; - ++YYCURSOR; -#line 726 "ext/standard/var_unserializer.re" - { - if (!var_hash) return 0; - - return object_common2(UNSERIALIZE_PASSTHRU, - object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR)); -} -#line 837 "ext/standard/var_unserializer.c" -yy32: - yych = *++YYCURSOR; - if (yych == '+') goto yy33; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy34; - goto yy18; -yy33: - yych = *++YYCURSOR; - if (yych <= '/') goto yy18; - if (yych >= ':') goto yy18; -yy34: - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy34; - if (yych >= ';') goto yy18; - yych = *++YYCURSOR; - if (yych != '{') goto yy18; - ++YYCURSOR; -#line 702 "ext/standard/var_unserializer.re" - { - zend_long elements = parse_iv(start + 2); - /* use iv() not uiv() in order to check data range */ - *p = YYCURSOR; - if (!var_hash) return 0; - - if (elements < 0) { - return 0; - } - - array_init_size(rval, elements); - if (elements) { - /* we can't convert from packed to hash during unserialization, because - reference to some zvals might be keept in var_hash (to support references) */ - zend_hash_real_init(Z_ARRVAL_P(rval), 0); - } - - if (!process_nested_data(UNSERIALIZE_PASSTHRU, Z_ARRVAL_P(rval), elements, 0)) { - return 0; - } - - return finish_nested_data(UNSERIALIZE_PASSTHRU); -} -#line 882 "ext/standard/var_unserializer.c" -yy39: - yych = *++YYCURSOR; - if (yych == '+') goto yy40; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy41; - goto yy18; -yy40: - yych = *++YYCURSOR; - if (yych <= '/') goto yy18; - if (yych >= ':') goto yy18; -yy41: - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy41; - if (yych >= ';') goto yy18; - yych = *++YYCURSOR; - if (yych != '"') goto yy18; +#line 1241 "ext/standard/var_unserializer.c" +yy84: ++YYCURSOR; -#line 668 "ext/standard/var_unserializer.re" +#line 704 "ext/standard/var_unserializer.re" { size_t len, maxlen; zend_string *str; @@ -969,407 +1274,127 @@ yy41: ZVAL_STR(rval, str); return 1; } -#line 937 "ext/standard/var_unserializer.c" -yy46: - yych = *++YYCURSOR; - if (yych == '+') goto yy47; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy48; - goto yy18; -yy47: - yych = *++YYCURSOR; - if (yych <= '/') goto yy18; - if (yych >= ':') goto yy18; -yy48: - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy48; - if (yych >= ';') goto yy18; - yych = *++YYCURSOR; - if (yych != '"') goto yy18; +#line 1278 "ext/standard/var_unserializer.c" +yy86: ++YYCURSOR; -#line 636 "ext/standard/var_unserializer.re" +#line 738 "ext/standard/var_unserializer.re" { - size_t len, maxlen; - char *str; + zend_long elements = parse_iv(start + 2); + /* use iv() not uiv() in order to check data range */ + *p = YYCURSOR; + if (!var_hash) return 0; - len = parse_uiv(start + 2); - maxlen = max - YYCURSOR; - if (maxlen < len) { - *p = start + 2; + if (elements < 0) { return 0; } - str = (char*)YYCURSOR; - - YYCURSOR += len; - - if (*(YYCURSOR) != '"') { - *p = YYCURSOR; - return 0; + array_init_size(rval, elements); + if (elements) { + /* we can't convert from packed to hash during unserialization, because + reference to some zvals might be keept in var_hash (to support references) */ + zend_hash_real_init(Z_ARRVAL_P(rval), 0); } - if (*(YYCURSOR + 1) != ';') { - *p = YYCURSOR + 1; + if (!process_nested_data(UNSERIALIZE_PASSTHRU, Z_ARRVAL_P(rval), elements, 0)) { return 0; } - YYCURSOR += 2; - *p = YYCURSOR; - - ZVAL_STRINGL(rval, str, len); - return 1; -} -#line 990 "ext/standard/var_unserializer.c" -yy53: - yych = *++YYCURSOR; - if (yych <= '/') { - if (yych <= ',') { - if (yych == '+') goto yy57; - goto yy18; - } else { - if (yych <= '-') goto yy55; - if (yych <= '.') goto yy60; - goto yy18; - } - } else { - if (yych <= 'I') { - if (yych <= '9') goto yy58; - if (yych <= 'H') goto yy18; - goto yy56; - } else { - if (yych != 'N') goto yy18; - } - } - yych = *++YYCURSOR; - if (yych == 'A') goto yy76; - goto yy18; -yy55: - yych = *++YYCURSOR; - if (yych <= '/') { - if (yych == '.') goto yy60; - goto yy18; - } else { - if (yych <= '9') goto yy58; - if (yych != 'I') goto yy18; - } -yy56: - yych = *++YYCURSOR; - if (yych == 'N') goto yy72; - goto yy18; -yy57: - yych = *++YYCURSOR; - if (yych == '.') goto yy60; - if (yych <= '/') goto yy18; - if (yych >= ':') goto yy18; -yy58: - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4); - yych = *YYCURSOR; - if (yych <= ':') { - if (yych <= '.') { - if (yych <= '-') goto yy18; - goto yy70; - } else { - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy58; - goto yy18; - } - } else { - if (yych <= 'E') { - if (yych <= ';') goto yy63; - if (yych <= 'D') goto yy18; - goto yy65; - } else { - if (yych == 'e') goto yy65; - goto yy18; - } - } -yy60: - yych = *++YYCURSOR; - if (yych <= '/') goto yy18; - if (yych >= ':') goto yy18; -yy61: - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4); - yych = *YYCURSOR; - if (yych <= ';') { - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy61; - if (yych <= ':') goto yy18; - } else { - if (yych <= 'E') { - if (yych <= 'D') goto yy18; - goto yy65; - } else { - if (yych == 'e') goto yy65; - goto yy18; - } - } -yy63: - ++YYCURSOR; -#line 627 "ext/standard/var_unserializer.re" - { -#if SIZEOF_ZEND_LONG == 4 -use_double: -#endif - *p = YYCURSOR; - ZVAL_DOUBLE(rval, zend_strtod((const char *)start + 2, NULL)); - return 1; + return finish_nested_data(UNSERIALIZE_PASSTHRU); } -#line 1087 "ext/standard/var_unserializer.c" -yy65: +#line 1305 "ext/standard/var_unserializer.c" +yy88: yych = *++YYCURSOR; if (yych <= ',') { - if (yych != '+') goto yy18; - } else { - if (yych <= '-') goto yy66; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy67; - goto yy18; - } -yy66: - yych = *++YYCURSOR; - if (yych <= ',') { - if (yych == '+') goto yy69; + if (yych == '+') goto yy96; goto yy18; } else { - if (yych <= '-') goto yy69; + if (yych <= '-') goto yy96; if (yych <= '/') goto yy18; if (yych >= ':') goto yy18; } -yy67: +yy89: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '/') goto yy18; - if (yych <= '9') goto yy67; - if (yych == ';') goto yy63; + if (yych <= '9') goto yy89; + if (yych == ';') goto yy71; goto yy18; -yy69: +yy91: yych = *++YYCURSOR; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy67; + if (yych == ';') goto yy97; goto yy18; -yy70: - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4); - yych = *YYCURSOR; - if (yych <= ';') { - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy70; - if (yych <= ':') goto yy18; - goto yy63; - } else { - if (yych <= 'E') { - if (yych <= 'D') goto yy18; - goto yy65; - } else { - if (yych == 'e') goto yy65; - goto yy18; - } - } -yy72: - yych = *++YYCURSOR; - if (yych != 'F') goto yy18; -yy73: - yych = *++YYCURSOR; - if (yych != ';') goto yy18; +yy92: ++YYCURSOR; -#line 611 "ext/standard/var_unserializer.re" +#line 762 "ext/standard/var_unserializer.re" { - *p = YYCURSOR; - - if (!strncmp((char*)start + 2, "NAN", 3)) { - ZVAL_DOUBLE(rval, php_get_nan()); - } else if (!strncmp((char*)start + 2, "INF", 3)) { - ZVAL_DOUBLE(rval, php_get_inf()); - } else if (!strncmp((char*)start + 2, "-INF", 4)) { - ZVAL_DOUBLE(rval, -php_get_inf()); - } else { - ZVAL_NULL(rval); - } + if (!var_hash) return 0; - return 1; + return object_common2(UNSERIALIZE_PASSTHRU, + object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR)); } -#line 1162 "ext/standard/var_unserializer.c" -yy76: - yych = *++YYCURSOR; - if (yych == 'N') goto yy73; - goto yy18; -yy77: - yych = *++YYCURSOR; - if (yych <= ',') { - if (yych != '+') goto yy18; - } else { - if (yych <= '-') goto yy78; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy79; - goto yy18; - } -yy78: - yych = *++YYCURSOR; - if (yych <= '/') goto yy18; - if (yych >= ':') goto yy18; -yy79: +#line 1337 "ext/standard/var_unserializer.c" +yy94: ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy79; - if (yych != ';') goto yy18; - ++YYCURSOR; -#line 585 "ext/standard/var_unserializer.re" +#line 672 "ext/standard/var_unserializer.re" { -#if SIZEOF_ZEND_LONG == 4 - int digits = YYCURSOR - start - 3; + size_t len, maxlen; + char *str; - if (start[2] == '-' || start[2] == '+') { - digits--; + len = parse_uiv(start + 2); + maxlen = max - YYCURSOR; + if (maxlen < len) { + *p = start + 2; + return 0; } - /* Use double for large zend_long values that were serialized on a 64-bit system */ - if (digits >= MAX_LENGTH_OF_LONG - 1) { - if (digits == MAX_LENGTH_OF_LONG - 1) { - int cmp = strncmp((char*)YYCURSOR - MAX_LENGTH_OF_LONG, long_min_digits, MAX_LENGTH_OF_LONG - 1); - - if (!(cmp < 0 || (cmp == 0 && start[2] == '-'))) { - goto use_double; - } - } else { - goto use_double; - } - } -#endif - *p = YYCURSOR; - ZVAL_LONG(rval, parse_iv(start + 2)); - return 1; -} -#line 1215 "ext/standard/var_unserializer.c" -yy83: - yych = *++YYCURSOR; - if (yych <= '/') goto yy18; - if (yych >= '2') goto yy18; - yych = *++YYCURSOR; - if (yych != ';') goto yy18; - ++YYCURSOR; -#line 579 "ext/standard/var_unserializer.re" - { - *p = YYCURSOR; - ZVAL_BOOL(rval, parse_iv(start + 2)); - return 1; -} -#line 1229 "ext/standard/var_unserializer.c" -yy87: - ++YYCURSOR; -#line 573 "ext/standard/var_unserializer.re" - { - *p = YYCURSOR; - ZVAL_NULL(rval); - return 1; -} -#line 1238 "ext/standard/var_unserializer.c" -yy89: - yych = *++YYCURSOR; - if (yych <= ',') { - if (yych != '+') goto yy18; - } else { - if (yych <= '-') goto yy90; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy91; - goto yy18; - } -yy90: - yych = *++YYCURSOR; - if (yych <= '/') goto yy18; - if (yych >= ':') goto yy18; -yy91: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy91; - if (yych != ';') goto yy18; - ++YYCURSOR; -#line 548 "ext/standard/var_unserializer.re" - { - zend_long id; + str = (char*)YYCURSOR; - *p = YYCURSOR; - if (!var_hash) return 0; + YYCURSOR += len; - id = parse_iv(start + 2) - 1; - if (id == -1 || (rval_ref = var_access(var_hash, id)) == NULL) { + if (*(YYCURSOR) != '"') { + *p = YYCURSOR; return 0; } - if (rval_ref == rval) { + if (*(YYCURSOR + 1) != ';') { + *p = YYCURSOR + 1; return 0; } - if (Z_ISUNDEF_P(rval_ref) || (Z_ISREF_P(rval_ref) && Z_ISUNDEF_P(Z_REFVAL_P(rval_ref)))) { - ZVAL_UNDEF(rval); - return 1; - } - - ZVAL_COPY(rval, rval_ref); + YYCURSOR += 2; + *p = YYCURSOR; + ZVAL_STRINGL(rval, str, len); return 1; } -#line 1286 "ext/standard/var_unserializer.c" -yy95: - yych = *++YYCURSOR; - if (yych <= ',') { - if (yych != '+') goto yy18; - } else { - if (yych <= '-') goto yy96; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy97; - goto yy18; - } +#line 1372 "ext/standard/var_unserializer.c" yy96: yych = *++YYCURSOR; if (yych <= '/') goto yy18; - if (yych >= ':') goto yy18; + if (yych <= '9') goto yy89; + goto yy18; yy97: ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy97; - if (yych != ';') goto yy18; - ++YYCURSOR; -#line 522 "ext/standard/var_unserializer.re" +#line 647 "ext/standard/var_unserializer.re" { - zend_long id; - - *p = YYCURSOR; - if (!var_hash) return 0; - - id = parse_iv(start + 2) - 1; - if (id == -1 || (rval_ref = var_access(var_hash, id)) == NULL) { - return 0; - } + *p = YYCURSOR; - zval_ptr_dtor(rval); - if (Z_ISUNDEF_P(rval_ref) || (Z_ISREF_P(rval_ref) && Z_ISUNDEF_P(Z_REFVAL_P(rval_ref)))) { - ZVAL_UNDEF(rval); - return 1; - } - if (Z_ISREF_P(rval_ref)) { - ZVAL_COPY(rval, rval_ref); + if (!strncmp((char*)start + 2, "NAN", 3)) { + ZVAL_DOUBLE(rval, php_get_nan()); + } else if (!strncmp((char*)start + 2, "INF", 3)) { + ZVAL_DOUBLE(rval, php_get_inf()); + } else if (!strncmp((char*)start + 2, "-INF", 4)) { + ZVAL_DOUBLE(rval, -php_get_inf()); } else { - ZVAL_NEW_REF(rval_ref, rval_ref); - ZVAL_COPY(rval, rval_ref); + ZVAL_NULL(rval); } return 1; } -#line 1335 "ext/standard/var_unserializer.c" +#line 1396 "ext/standard/var_unserializer.c" } -#line 886 "ext/standard/var_unserializer.re" +#line 924 "ext/standard/var_unserializer.re" return 0; diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re index 9051894643..978f401ac2 100644 --- a/ext/standard/var_unserializer.re +++ b/ext/standard/var_unserializer.re @@ -876,11 +876,13 @@ object ":" uiv ":" ["] { } /* The callback function may have defined the class */ + BG(serialize_lock)++; if ((ce = zend_lookup_class(class_name)) == NULL) { php_error_docref(NULL, E_WARNING, "Function %s() hasn't defined the class it was called for", Z_STRVAL(user_func)); incomplete_class = 1; ce = PHP_IC_ENTRY; } + BG(serialize_lock)--; zval_ptr_dtor(&user_func); zval_ptr_dtor(&args[0]); diff --git a/ext/standard/versioning.c b/ext/standard/versioning.c index 688f25afad..29f421c72f 100644 --- a/ext/standard/versioning.c +++ b/ext/standard/versioning.c @@ -12,7 +12,7 @@ | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ - | Author: Stig Sæther Bakken <ssb@php.net> | + | Author: Stig Sæther Bakken <ssb@php.net> | +----------------------------------------------------------------------+ */ @@ -33,7 +33,7 @@ PHPAPI char * php_canonicalize_version(const char *version) { - int len = strlen(version); + size_t len = strlen(version); char *buf = safe_emalloc(len, 2, 1), *q, lp, lq; const char *p; diff --git a/ext/wddx/tests/bug73631.phpt b/ext/wddx/tests/bug73631.phpt new file mode 100644 index 0000000000..1fcde72dfe --- /dev/null +++ b/ext/wddx/tests/bug73631.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #73631 (Memory leak due to invalid wddx stack processing) +--SKIPIF-- +<?php if (!extension_loaded("wddx")) print "skip"; ?> +--FILE-- +<?php +$xml = <<<EOF +<?xml version="1.0" ?> +<wddxPacket version="1.0"> +<number>1234</number> +<binary><boolean/></binary> +</wddxPacket> +EOF; +$wddx = wddx_deserialize($xml); +var_dump($wddx); +?> +--EXPECTF-- +int(1234) diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c index b188e8929e..d58a564593 100644 --- a/ext/wddx/wddx.c +++ b/ext/wddx/wddx.c @@ -772,6 +772,11 @@ static void php_wddx_push_element(void *user_data, const XML_Char *name, const X php_wddx_process_data(user_data, atts[i+1], strlen((char *)atts[i+1])); break; } + } else { + ent.type = ST_BOOLEAN; + SET_STACK_VARNAME; + ZVAL_FALSE(&ent.data); + wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry)); } } else if (!strcmp((char *)name, EL_NULL)) { ent.type = ST_NULL; @@ -902,8 +907,13 @@ static void php_wddx_pop_element(void *user_data, const XML_Char *name) } if (!strcmp((char *)name, EL_BINARY)) { - zend_string *new_str = php_base64_decode( - (unsigned char *)Z_STRVAL(ent1->data), Z_STRLEN(ent1->data)); + zend_string *new_str = NULL; + + if (ZSTR_EMPTY_ALLOC() != Z_STR(ent1->data)) { + new_str = php_base64_decode( + (unsigned char *)Z_STRVAL(ent1->data), Z_STRLEN(ent1->data)); + } + zval_ptr_dtor(&ent1->data); if (new_str) { ZVAL_STR(&ent1->data, new_str); diff --git a/ext/xml/xml.c b/ext/xml/xml.c index 43086934a5..f3ca5d3047 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -1610,7 +1610,7 @@ PHP_FUNCTION(xml_parser_set_option) convert_to_long_ex(val); parser->toffset = Z_LVAL_P(val); if (parser->toffset < 0) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "tagstart ignored, because it is out of range"); + php_error_docref(NULL, E_NOTICE, "tagstart ignored, because it is out of range"); parser->toffset = 0; } break; diff --git a/ext/zlib/tests/deflate_add_buffer_full.phpt b/ext/zlib/tests/deflate_add_buffer_full.phpt new file mode 100644 index 0000000000..a2b3fc4ab0 --- /dev/null +++ b/ext/zlib/tests/deflate_add_buffer_full.phpt @@ -0,0 +1,53 @@ +--TEST-- +Test deflate_add() buffer issue with data that fills deflate buffer while using ZLIB_SYNC_FLUSH on ZLIB_ENCODING_RAW. +--SKIPIF-- +<?php +if (!extension_loaded("zlib")) { + print "skip - ZLIB extension not loaded"; +} +?> +--FILE-- +<?php + +/* + * When using ZLIB_ENCODING_RAW, the deflated buffer should always end in 00 00 ff ff + * Many streaming deflate users rely on this behaviour. + * example: websocket permessage-deflate extension + * (https://tools.ietf.org/html/draft-ietf-hybi-permessage-compression-28#section-7.2.1) + * + * Prior to fixing, the output buffer size was not being checked. According to the zlib + * manual, deflate must be called again with more buffer space. + */ + +$deflateContext = deflate_init(ZLIB_ENCODING_RAW); + +$deflated = deflate_add( + $deflateContext, + hex2bin("255044462d312e320a25c7ec8fa20a362030206f626a0a3c3c2f4c656e6774682037203020522f46696c746572202f466c6174654465636f64653e3e0a737472"), + ZLIB_SYNC_FLUSH +); + +echo bin2hex(substr($deflated, strlen($deflated) - 4)) . "\n"; + +$deflated = deflate_add( + $deflateContext, + hex2bin("65616d0a789c7d53c16ed43010bde7c037f85824766a7bc6767c2ca8a00a016a1b2edcb2dbecaed1266937d98afe3d6327363794439437e3f17b6f5e242821e3"), + ZLIB_SYNC_FLUSH +); + +echo bin2hex(substr($deflated, strlen($deflated) - 4)) . "\n"; + +$deflated = deflate_add( + $deflateContext, + hex2bin("b3be777df5525d3f90384cd58b50a9945fbb5e7c6cb8c89fca8156c688665f2de794504a81f75658a7c1d54a347d7575fb6e17ba617edffcae9c84da3aee6c9e"), + ZLIB_SYNC_FLUSH +); + +echo bin2hex(substr($deflated, strlen($deflated) - 4)) . "\n"; +?> +===DONE=== +--EXPECTF-- +0000ffff +0000ffff +0000ffff +===DONE=== diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index d9d6be1638..bbe1334ca9 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -1115,7 +1115,7 @@ PHP_FUNCTION(deflate_add) { zend_string *out; char *in_buf; - size_t in_len, out_size; + size_t in_len, out_size, buffer_used; zval *res; z_stream *ctx; zend_long flush_type = Z_SYNC_FLUSH; @@ -1157,6 +1157,7 @@ PHP_FUNCTION(deflate_add) out_size = PHP_ZLIB_BUFFER_SIZE_GUESS(ctx->total_in + in_len); out_size = (ctx->total_out >= out_size) ? 16 : (out_size - ctx->total_out); out_size = (out_size < 16) ? 16 : out_size; + out_size += 64; out = zend_string_alloc(out_size, 0); ctx->next_in = (Bytef *) in_buf; @@ -1164,7 +1165,21 @@ PHP_FUNCTION(deflate_add) ctx->avail_in = in_len; ctx->avail_out = ZSTR_LEN(out); - status = deflate(ctx, flush_type); + buffer_used = 0; + + do { + if (ctx->avail_out == 0) { + /* more output buffer space needed; realloc and try again */ + /* adding 64 more bytes solved every issue I have seen */ + /* the + 1 is for the string terminator added below */ + out = zend_string_realloc(out, ZSTR_LEN(out) + 64 + 1, 0); + ctx->avail_out = 64; + ctx->next_out = (Bytef *) ZSTR_VAL(out) + buffer_used; + } + status = deflate(ctx, flush_type); + buffer_used = ZSTR_LEN(out) - ctx->avail_out; + } while (status == Z_OK && ctx->avail_out == 0); + switch (status) { case Z_OK: ZSTR_LEN(out) = (char *) ctx->next_out - ZSTR_VAL(out); diff --git a/main/main.c b/main/main.c index fcb42b43b4..722f157fb5 100644 --- a/main/main.c +++ b/main/main.c @@ -1117,11 +1117,9 @@ static ZEND_COLD void php_error_cb(int type, const char *error_filename, const u if ((!strcmp(sapi_module.name, "cli") || !strcmp(sapi_module.name, "cgi")) && PG(display_errors) == PHP_DISPLAY_ERRORS_STDERR ) { -#ifdef PHP_WIN32 fprintf(stderr, "%s: %s in %s on line %u\n", error_type_str, buffer, error_filename, error_lineno); +#ifdef PHP_WIN32 fflush(stderr); -#else - fprintf(stderr, "%s: %s in %s on line %u\n", error_type_str, buffer, error_filename, error_lineno); #endif } else { php_printf("%s\n%s: %s in %s on line %d\n%s", STR_PRINT(prepend_string), error_type_str, buffer, error_filename, error_lineno, STR_PRINT(append_string)); diff --git a/main/php_version.h b/main/php_version.h index 50226a86ff..53ea5475a5 100644 --- a/main/php_version.h +++ b/main/php_version.h @@ -2,7 +2,7 @@ /* edit configure.in to change version number */ #define PHP_MAJOR_VERSION 7 #define PHP_MINOR_VERSION 0 -#define PHP_RELEASE_VERSION 14 +#define PHP_RELEASE_VERSION 15 #define PHP_EXTRA_VERSION "-dev" -#define PHP_VERSION "7.0.14-dev" -#define PHP_VERSION_ID 70014 +#define PHP_VERSION "7.0.15-dev" +#define PHP_VERSION_ID 70015 diff --git a/php.ini-development b/php.ini-development index e8800fc905..74b7f11baf 100644 --- a/php.ini-development +++ b/php.ini-development @@ -1883,6 +1883,12 @@ ldap.max_links = -1 ; This should improve performance, but requires appropriate OS configuration. ;opcache.huge_code_pages=0 +; Validate cached file permissions. +; opcache.validate_permission=0 + +; Prevent name collisions in chroot'ed environment. +; opcache.validate_root=0 + [curl] ; A default value for the CURLOPT_CAINFO option. This is required to be an ; absolute path. diff --git a/php.ini-production b/php.ini-production index 03254ad8c1..60571aae72 100644 --- a/php.ini-production +++ b/php.ini-production @@ -1883,6 +1883,12 @@ ldap.max_links = -1 ; This should improve performance, but requires appropriate OS configuration. ;opcache.huge_code_pages=1 +; Validate cached file permissions. +; opcache.validate_permission=0 + +; Prevent name collisions in chroot'ed environment. +; opcache.validate_root=0 + [curl] ; A default value for the CURLOPT_CAINFO option. This is required to be an ; absolute path. diff --git a/run-tests.php b/run-tests.php index fef39c50b8..fbe6d79d81 100755 --- a/run-tests.php +++ b/run-tests.php @@ -159,16 +159,6 @@ if (getenv('TEST_PHP_EXECUTABLE')) { $php_cgi = null; } } - - if (!getenv('TEST_PHPDBG_EXECUTABLE')) { - $phpdbg = $cwd . '/sapi/phpdbg/phpdbg'; - - if (file_exists($phpdbg)) { - putenv("TEST_PHPDBG_EXECUTABLE=$phpdbg"); - } else { - $phpdbg = null; - } - } } $environment['TEST_PHP_EXECUTABLE'] = $php; } @@ -184,6 +174,23 @@ if (getenv('TEST_PHP_CGI_EXECUTABLE')) { $environment['TEST_PHP_CGI_EXECUTABLE'] = $php_cgi; } +if (!getenv('TEST_PHPDBG_EXECUTABLE')) { + if (!strncasecmp(PHP_OS, "win", 3) && file_exists(dirname($php) . "/phpdbg.exe")) { + $phpdbg = realpath(dirname($php) . "/phpdbg.exe"); + } elseif (file_exists(dirname($php) . "/../../sapi/phpdbg/phpdbg")) { + $phpdbg = realpath(dirname($php) . "/../../sapi/phpdbg/phpdbg"); + } elseif (file_exists("./sapi/phpdbg/phpdbg")) { + $phpdbg = realpath("./sapi/phpdbg/phpdbg"); + } elseif (file_exists(dirname($php) . "/phpdbg")) { + $phpdbg = realpath(dirname($php) . "/phpdbg"); + } else { + $phpdbg = null; + } + if ($phpdbg) { + putenv("TEST_PHPDBG_EXECUTABLE=$phpdbg"); + } +} + if (getenv('TEST_PHPDBG_EXECUTABLE')) { $phpdbg = getenv('TEST_PHPDBG_EXECUTABLE'); @@ -1415,26 +1422,12 @@ TEST $file if (isset($phpdbg)) { $old_php = $php; $php = $phpdbg . ' -qIb'; - } else if (!strncasecmp(PHP_OS, "win", 3) && file_exists(dirname($php) . "/phpdbg.exe")) { - $old_php = $php; - $php = realpath(dirname($php) . "/phpdbg.exe") . ' -qIb '; } else { - if (file_exists(dirname($php) . "/../../sapi/phpdbg/phpdbg")) { - $old_php = $php; - $php = realpath(dirname($php) . "/../../sapi/phpdbg/phpdbg") . ' -qIb '; - } else if (file_exists("./sapi/phpdbg/phpdbg")) { - $old_php = $php; - $php = realpath("./sapi/phpdbg/phpdbg") . ' -qIb '; - } else if (file_exists(dirname($php) . "/phpdbg")) { - $old_php = $php; - $php = realpath(dirname($php) . "/phpdbg") . ' -qIb '; - } else { - show_result('SKIP', $tested, $tested_file, "reason: phpdbg not available"); + show_result('SKIP', $tested, $tested_file, "reason: phpdbg not available"); - junit_init_suite(junit_get_suitename_for($shortname)); - junit_mark_test_as('SKIP', $shortname, $tested, 0, 'phpdbg not available'); - return 'SKIPPED'; - } + junit_init_suite(junit_get_suitename_for($shortname)); + junit_mark_test_as('SKIP', $shortname, $tested, 0, 'phpdbg not available'); + return 'SKIPPED'; } } @@ -2734,6 +2727,7 @@ function junit_init() { 'test_fail' => 0, 'test_error' => 0, 'test_skip' => 0, + 'test_warn' => 0, 'execution_time'=> 0, 'suites' => array(), 'files' => array() diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c index 456b9719fa..81574a4784 100644 --- a/sapi/apache2handler/sapi_apache2.c +++ b/sapi/apache2handler/sapi_apache2.c @@ -69,6 +69,33 @@ char *apache2_php_ini_path_override = NULL; ZEND_TSRMLS_CACHE_DEFINE() #endif +/* if apache's version is newer than 2.2.31 or 2.4.16 */ +#if MODULE_MAGIC_COOKIE == 0x41503232UL && AP_MODULE_MAGIC_AT_LEAST(20051115,40) || \ + MODULE_MAGIC_COOKIE == 0x41503234UL && AP_MODULE_MAGIC_AT_LEAST(20120211,47) +#define php_ap_map_http_request_error ap_map_http_request_error +#else +static int php_ap_map_http_request_error(apr_status_t rv, int status) +{ + switch (rv) { + case AP_FILTER_ERROR: { + return AP_FILTER_ERROR; + } + case APR_ENOSPC: { + return HTTP_REQUEST_ENTITY_TOO_LARGE; + } + case APR_ENOTIMPL: { + return HTTP_NOT_IMPLEMENTED; + } + case APR_ETIMEDOUT: { + return HTTP_REQUEST_TIME_OUT; + } + default: { + return status; + } + } +} +#endif + static size_t php_apache_sapi_ub_write(const char *str, size_t str_length) { @@ -184,6 +211,7 @@ php_apache_sapi_read_post(char *buf, size_t count_bytes) php_struct *ctx = SG(server_context); request_rec *r; apr_bucket_brigade *brigade; + apr_status_t ret; r = ctx->r; brigade = ctx->brigade; @@ -195,7 +223,7 @@ php_apache_sapi_read_post(char *buf, size_t count_bytes) * need to make sure that if data is available we fill the buffer completely. */ - while (ap_get_brigade(r->input_filters, brigade, AP_MODE_READBYTES, APR_BLOCK_READ, len) == APR_SUCCESS) { + while ((ret=ap_get_brigade(r->input_filters, brigade, AP_MODE_READBYTES, APR_BLOCK_READ, len)) == APR_SUCCESS) { apr_brigade_flatten(brigade, buf, &len); apr_brigade_cleanup(brigade); tlen += len; @@ -206,6 +234,14 @@ php_apache_sapi_read_post(char *buf, size_t count_bytes) len = count_bytes - tlen; } + if (ret != APR_SUCCESS) { + if (APR_STATUS_IS_TIMEUP(ret)) { + SG(sapi_headers).http_response_code = php_ap_map_http_request_error(ret, HTTP_REQUEST_TIME_OUT); + } else { + SG(sapi_headers).http_response_code = php_ap_map_http_request_error(ret, HTTP_BAD_REQUEST); + } + } + return tlen; } @@ -656,6 +692,13 @@ zend_first_try { brigade = ctx->brigade; } + if (SG(request_info).content_length > SG(read_post_bytes)) { + ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "Error while attempting to read POST data: %d", SG(sapi_headers).http_response_code); + apr_brigade_cleanup(brigade); + PHPAP_INI_OFF; + return SG(sapi_headers).http_response_code; + } + if (AP2(last_modified)) { ap_update_mtime(r, r->finfo.mtime); ap_set_last_modified(r); diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 978c8b332e..22f4e0cebe 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -379,6 +379,9 @@ static void sapi_cli_register_variables(zval *track_vars_array) /* {{{ */ static void sapi_cli_log_message(char *message) /* {{{ */ { fprintf(stderr, "%s\n", message); +#ifdef PHP_WIN32 + fflush(stderr); +#endif } /* }}} */ diff --git a/sapi/cli/tests/bug67429.phpt b/sapi/cli/tests/bug67429.phpt index 856946b29d..1c861be899 100644 --- a/sapi/cli/tests/bug67429.phpt +++ b/sapi/cli/tests/bug67429.phpt @@ -8,8 +8,9 @@ include "skipif.inc"; <?php include "php_cli_server.inc"; +// This creates a new server for each response code foreach ([308, 426] as $code) { - php_cli_server_start(<<<PHP + $proc_handle = php_cli_server_start(<<<PHP http_response_code($code); PHP ); @@ -34,6 +35,10 @@ HEADER } fclose($fp); + // Shutdown the servers or another server may not be able to start + // because of the this server still being bound to the port + + php_cli_server_stop($proc_handle); } ?> --EXPECTF-- diff --git a/sapi/cli/tests/php_cli_server.inc b/sapi/cli/tests/php_cli_server.inc index 6b1e90c4dc..6e7b70cb60 100644 --- a/sapi/cli/tests/php_cli_server.inc +++ b/sapi/cli/tests/php_cli_server.inc @@ -33,29 +33,62 @@ function php_cli_server_start($code = 'echo "Hello world";', $router = 'index.ph $handle = proc_open($cmd, $descriptorspec, $pipes, $doc_root); } - - // note: even when server prints 'Listening on localhost:8964...Press Ctrl-C to quit.' - // it might not be listening yet...need to wait until fsockopen() call returns - $i = 0; - while (($i++ < 30) && !($fp = @fsockopen(PHP_CLI_SERVER_HOSTNAME, PHP_CLI_SERVER_PORT))) { - usleep(10000); + + // note: even when server prints 'Listening on localhost:8964...Press Ctrl-C to quit.' + // it might not be listening yet...need to wait until fsockopen() call returns + $error = "Unable to connect to servers\n"; + for ($i=0; $i < 60; $i++) { + usleep(25000); // 25ms per try + $status = proc_get_status($handle); + $fp = @fsockopen(PHP_CLI_SERVER_HOSTNAME, PHP_CLI_SERVER_PORT); + // Failure, the server is no longer running + if (!($status && $status['running'])) { + $error = "Server is not running\n"; + break; + } + // Success, Connected to servers + if ($fp) { + $error = ''; + break; + } } if ($fp) { fclose($fp); } - register_shutdown_function( - function($handle) use($router) { - proc_terminate($handle); - @unlink(__DIR__ . "/{$router}"); - }, - $handle - ); - // don't bother sleeping, server is already up - // server can take a variable amount of time to be up, so just sleeping a guessed amount of time - // does not work. this is why tests sometimes pass and sometimes fail. to get a reliable pass - // sleeping doesn't work. + if ($error) { + echo $error; + proc_terminate($handle); + exit(1); + } + + register_shutdown_function( + function($handle) use($router) { + proc_terminate($handle); + @unlink(__DIR__ . "/{$router}"); + }, + $handle + ); + + return $handle; +} + +function php_cli_server_stop($handle) { + $success = FALSE; + if ($handle) { + proc_terminate($handle); + /* Wait for server to shutdown */ + for ($i = 0; $i < 60; $i++) { + $status = proc_get_status($handle); + if (!($status && $status['running'])) { + $success = TRUE; + break; + } + usleep(25000); + } + } + return $success; } ?> diff --git a/sapi/fpm/fpm/fpm_log.c b/sapi/fpm/fpm/fpm_log.c index 5aad9a08c9..9f63d7a34c 100644 --- a/sapi/fpm/fpm/fpm_log.c +++ b/sapi/fpm/fpm/fpm_log.c @@ -467,7 +467,7 @@ int fpm_log_write(char *log_format) /* {{{ */ if (!test && strlen(buffer) > 0) { buffer[len] = '\n'; - write(fpm_log_fd, buffer, len + 1); + zend_quiet_write(fpm_log_fd, buffer, len + 1); } return 0; diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c index 5adeb63b7a..c0b4b1c754 100644 --- a/sapi/fpm/fpm/fpm_main.c +++ b/sapi/fpm/fpm/fpm_main.c @@ -1865,7 +1865,7 @@ consult the installation file that came with this distribution, or visit \n\ if (fpm_globals.send_config_pipe[1]) { int writeval = 0; zlog(ZLOG_DEBUG, "Sending \"0\" (error) to parent via fd=%d", fpm_globals.send_config_pipe[1]); - write(fpm_globals.send_config_pipe[1], &writeval, sizeof(writeval)); + zend_quiet_write(fpm_globals.send_config_pipe[1], &writeval, sizeof(writeval)); close(fpm_globals.send_config_pipe[1]); } return FPM_EXIT_CONFIG; @@ -1874,7 +1874,7 @@ consult the installation file that came with this distribution, or visit \n\ if (fpm_globals.send_config_pipe[1]) { int writeval = 1; zlog(ZLOG_DEBUG, "Sending \"1\" (OK) to parent via fd=%d", fpm_globals.send_config_pipe[1]); - write(fpm_globals.send_config_pipe[1], &writeval, sizeof(writeval)); + zend_quiet_write(fpm_globals.send_config_pipe[1], &writeval, sizeof(writeval)); close(fpm_globals.send_config_pipe[1]); } fpm_is_running = 1; diff --git a/sapi/fpm/fpm/fpm_signals.c b/sapi/fpm/fpm/fpm_signals.c index a637e69e71..e9f49d9e47 100644 --- a/sapi/fpm/fpm/fpm_signals.c +++ b/sapi/fpm/fpm/fpm_signals.c @@ -174,7 +174,7 @@ static void sig_handler(int signo) /* {{{ */ saved_errno = errno; s = sig_chars[signo]; - write(sp[1], &s, sizeof(s)); + zend_quiet_write(sp[1], &s, sizeof(s)); errno = saved_errno; } /* }}} */ diff --git a/sapi/fpm/fpm/zlog.c b/sapi/fpm/fpm/zlog.c index 1659c77efc..4884dca856 100644 --- a/sapi/fpm/fpm/zlog.c +++ b/sapi/fpm/fpm/zlog.c @@ -16,6 +16,7 @@ #include "zlog.h" #include "fpm.h" +#include "zend_portability.h" #define MAX_LINE_LENGTH 1024 @@ -186,11 +187,11 @@ void vzlog(const char *function, int line, int flags, const char *fmt, va_list a #endif { buf[len++] = '\n'; - write(zlog_fd > -1 ? zlog_fd : STDERR_FILENO, buf, len); + zend_quiet_write(zlog_fd > -1 ? zlog_fd : STDERR_FILENO, buf, len); } if (zlog_fd != STDERR_FILENO && zlog_fd != -1 && !launched && (flags & ZLOG_LEVEL_MASK) >= ZLOG_NOTICE) { - write(STDERR_FILENO, buf, len); + zend_quiet_write(STDERR_FILENO, buf, len); } } /* }}} */ diff --git a/sapi/fpm/www.conf.in b/sapi/fpm/www.conf.in index 394e27819d..beddb1e2ef 100644 --- a/sapi/fpm/www.conf.in +++ b/sapi/fpm/www.conf.in @@ -1,5 +1,5 @@ ; Start a new pool named 'www'. -; the variable $pool can we used in any directive and will be replaced by the +; the variable $pool can be used in any directive and will be replaced by the ; pool name ('www' here) [www] diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index 2c43a9c853..8153772368 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -33,6 +33,7 @@ #include "zend_alloc.h" #include "phpdbg_eol.h" #include "phpdbg_print.h" +#include "phpdbg_help.h" #include "ext/standard/basic_functions.h" @@ -1299,7 +1300,7 @@ void phpdbg_free_wrapper(void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) /* {{ */ } else { phpdbg_watch_efree(p); - return _zend_mm_free(heap, p ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); + _zend_mm_free(heap, p ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); } } /* }}} */ @@ -1575,7 +1576,7 @@ phpdbg_main: quit_immediately = phpdbg_startup_run > 1; /* set exec if present on command line */ - if (!read_from_stdin && argc > php_optind && (strcmp(argv[php_optind-1], "--") != SUCCESS)) { + if (!read_from_stdin && argc > php_optind) { if (!exec && strlen(argv[php_optind])) { exec = strdup(argv[php_optind]); } @@ -1873,9 +1874,7 @@ phpdbg_main: /* initialize from file */ PHPDBG_G(flags) |= PHPDBG_IS_INITIALIZING; zend_try { - if (init_file) { - phpdbg_init(init_file, init_file_len, init_file_default); - } + phpdbg_init(init_file, init_file_len, init_file_default); } zend_end_try(); PHPDBG_G(flags) &= ~PHPDBG_IS_INITIALIZING; @@ -1938,7 +1937,7 @@ phpdbg_main: if (PHPDBG_G(ops)) { phpdbg_print_opcodes(print_opline_func); } else { - quiet_write(PHPDBG_G(io)[PHPDBG_STDERR].fd, ZEND_STRL("No opcodes could be compiled | No file specified or compilation failed?\n")); + zend_quiet_write(PHPDBG_G(io)[PHPDBG_STDERR].fd, ZEND_STRL("No opcodes could be compiled | No file specified or compilation failed?\n")); } goto phpdbg_out; } diff --git a/sapi/phpdbg/phpdbg.h b/sapi/phpdbg/phpdbg.h index 94c5471e22..3df2be0aed 100644 --- a/sapi/phpdbg/phpdbg.h +++ b/sapi/phpdbg/phpdbg.h @@ -113,8 +113,6 @@ #define memcpy(...) memcpy_tmp(__VA_ARGS__) #endif -#define quiet_write(...) ZEND_IGNORE_VALUE(write(__VA_ARGS__)) - #if !defined(PHPDBG_WEBDATA_TRANSFER_H) && !defined(PHPDBG_WEBHELPER_H) #ifdef ZTS diff --git a/sapi/phpdbg/phpdbg_io.c b/sapi/phpdbg/phpdbg_io.c index b2f4ba7c0d..65a14d0ccb 100644 --- a/sapi/phpdbg/phpdbg_io.c +++ b/sapi/phpdbg/phpdbg_io.c @@ -149,7 +149,7 @@ recv_once: #endif if (got_now == -1) { - quiet_write(PHPDBG_G(io)[PHPDBG_STDERR].fd, ZEND_STRL("Read operation timed out!\n")); + zend_quiet_write(PHPDBG_G(io)[PHPDBG_STDERR].fd, ZEND_STRL("Read operation timed out!\n")); return -1; } i -= got_now; @@ -203,7 +203,7 @@ static int phpdbg_output_pager(int sock, const char *ptr, int len) { if (memchr(p, '\n', endp - p)) { char buf[PHPDBG_MAX_CMD]; - write(sock, ZEND_STRL("\r---Type <return> to continue or q <return> to quit---")); + zend_quiet_write(sock, ZEND_STRL("\r---Type <return> to continue or q <return> to quit---")); phpdbg_consume_stdin_line(buf); if (*buf == 'q') { break; @@ -305,7 +305,7 @@ PHPDBG_API int phpdbg_create_listenable_socket(const char *addr, unsigned short wrote = snprintf(buf, 128, "Could not translate address '%s'", addr); buf[wrote] = '\0'; - quiet_write(PHPDBG_G(io)[PHPDBG_STDERR].fd, buf, strlen(buf)); + zend_quiet_write(PHPDBG_G(io)[PHPDBG_STDERR].fd, buf, strlen(buf)); return sock; } else { @@ -315,7 +315,7 @@ PHPDBG_API int phpdbg_create_listenable_socket(const char *addr, unsigned short wrote = snprintf(buf, 256, "Host '%s' not found. %s", addr, estrdup(gai_strerror(rc))); buf[wrote] = '\0'; - quiet_write(PHPDBG_G(io)[PHPDBG_STDERR].fd, buf, strlen(buf)); + zend_quiet_write(PHPDBG_G(io)[PHPDBG_STDERR].fd, buf, strlen(buf)); return sock; #ifndef PHP_WIN32 @@ -330,7 +330,7 @@ PHPDBG_API int phpdbg_create_listenable_socket(const char *addr, unsigned short wrote = sprintf(buf, "Unable to create socket"); buf[wrote] = '\0'; - quiet_write(PHPDBG_G(io)[PHPDBG_STDERR].fd, buf, strlen(buf)); + zend_quiet_write(PHPDBG_G(io)[PHPDBG_STDERR].fd, buf, strlen(buf)); return sock; } diff --git a/sapi/phpdbg/phpdbg_list.c b/sapi/phpdbg/phpdbg_list.c index b0bb157f08..34e9187f52 100644 --- a/sapi/phpdbg/phpdbg_list.c +++ b/sapi/phpdbg/phpdbg_list.c @@ -235,21 +235,21 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) { phpdbg_file_source data, *dataptr; zend_file_handle fake; zend_op_array *ret; - char *filename = (char *)(file->opened_path ? ZSTR_VAL(file->opened_path) : file->filename); + char *filename; uint line; char *bufptr, *endptr; - char resolved_path_buf[MAXPATHLEN]; if (zend_stream_fixup(file, &bufptr, &data.len) == FAILURE) { return PHPDBG_G(compile_file)(file, type); } + filename = (char *)(file->opened_path ? ZSTR_VAL(file->opened_path) : file->filename); + data.buf = emalloc(data.len + ZEND_MMAP_AHEAD + 1); if (data.len > 0) { memcpy(data.buf, bufptr, data.len); } memset(data.buf + data.len, 0, ZEND_MMAP_AHEAD + 1); - data.filename = filename; data.line[0] = 0; memset(&fake, 0, sizeof(fake)); @@ -261,9 +261,6 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) { fake.opened_path = file->opened_path; *(dataptr = emalloc(sizeof(phpdbg_file_source) + sizeof(uint) * data.len)) = data; - if (VCWD_REALPATH(filename, resolved_path_buf)) { - filename = resolved_path_buf; - } for (line = 0, bufptr = data.buf - 1, endptr = data.buf + data.len; ++bufptr < endptr;) { if (*bufptr == '\n') { @@ -285,10 +282,9 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) { return NULL; } - dataptr->filename = estrdup(dataptr->filename); dataptr = erealloc(dataptr, sizeof(phpdbg_file_source) + sizeof(uint) * line); - zend_hash_str_add_ptr(&PHPDBG_G(file_sources), filename, strlen(filename), dataptr); - phpdbg_resolve_pending_file_break(filename); + zend_hash_add_ptr(&PHPDBG_G(file_sources), ret->filename, dataptr); + phpdbg_resolve_pending_file_break(ZSTR_VAL(ret->filename)); fake.opened_path = NULL; zend_file_handle_dtor(&fake); @@ -323,7 +319,7 @@ zend_op_array *phpdbg_init_compile_file(zend_file_handle *file, int type) { return NULL; } - dataptr = zend_hash_str_find_ptr(&PHPDBG_G(file_sources), filename, strlen(filename)); + dataptr = zend_hash_find_ptr(&PHPDBG_G(file_sources), op_array->filename); ZEND_ASSERT(dataptr != NULL); dataptr->op_array = *op_array; @@ -370,7 +366,6 @@ zend_op_array *phpdbg_compile_string(zval *source_string, char *filename) { dataptr = erealloc(dataptr, sizeof(phpdbg_file_source) + sizeof(uint) * line); zend_hash_add_ptr(&PHPDBG_G(file_sources), fake_name, dataptr); - dataptr->filename = estrndup(ZSTR_VAL(fake_name), ZSTR_LEN(fake_name)); zend_string_release(fake_name); dataptr->op_array = *op_array; @@ -387,7 +382,6 @@ void phpdbg_free_file_source(zval *zv) { if (data->buf) { efree(data->buf); } - efree(data->filename); destroy_op_array(&data->op_array); diff --git a/sapi/phpdbg/phpdbg_list.h b/sapi/phpdbg/phpdbg_list.h index c011b9598a..62ded66cf0 100644 --- a/sapi/phpdbg/phpdbg_list.h +++ b/sapi/phpdbg/phpdbg_list.h @@ -42,7 +42,6 @@ void phpdbg_init_list(void); void phpdbg_list_update(void); typedef struct { - char *filename; char *buf; size_t len; #if HAVE_MMAP diff --git a/sapi/phpdbg/phpdbg_parser.c b/sapi/phpdbg/phpdbg_parser.c index d68c0ff441..da08df2199 100644 --- a/sapi/phpdbg/phpdbg_parser.c +++ b/sapi/phpdbg/phpdbg_parser.c @@ -70,7 +70,7 @@ /* Copy the first part of user declarations. */ /* Line 371 of yacc.c */ -#line 1 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 1 "sapi/phpdbg/phpdbg_parser.y" /* @@ -134,7 +134,7 @@ extern int phpdbg_debug; #endif /* "%code requires" blocks. */ /* Line 387 of yacc.c */ -#line 36 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 36 "sapi/phpdbg/phpdbg_parser.y" #include "phpdbg.h" #ifndef YY_TYPEDEF_YY_SCANNER_T @@ -1469,49 +1469,49 @@ yyreduce: { case 2: /* Line 1802 of yacc.c */ -#line 71 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 71 "sapi/phpdbg/phpdbg_parser.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 3: /* Line 1802 of yacc.c */ -#line 72 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 72 "sapi/phpdbg/phpdbg_parser.y" { phpdbg_stack_separate((yyvsp[(1) - (3)]).top); (yyval) = (yyvsp[(3) - (3)]); } break; case 5: /* Line 1802 of yacc.c */ -#line 77 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 77 "sapi/phpdbg/phpdbg_parser.y" { (yyval).top = PHPDBG_G(parser_stack)->top; } break; case 6: /* Line 1802 of yacc.c */ -#line 78 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 78 "sapi/phpdbg/phpdbg_parser.y" { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(1) - (1)])); (yyval).top = PHPDBG_G(parser_stack)->top; } break; case 7: /* Line 1802 of yacc.c */ -#line 82 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 82 "sapi/phpdbg/phpdbg_parser.y" { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(1) - (1)])); (yyval).top = PHPDBG_G(parser_stack)->top; } break; case 8: /* Line 1802 of yacc.c */ -#line 83 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 83 "sapi/phpdbg/phpdbg_parser.y" { phpdbg_stack_push(PHPDBG_G(parser_stack), &(yyvsp[(2) - (2)])); (yyval).top = PHPDBG_G(parser_stack)->top; } break; case 9: /* Line 1802 of yacc.c */ -#line 84 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 84 "sapi/phpdbg/phpdbg_parser.y" { (yyval) = (yyvsp[(1) - (2)]); } break; case 10: /* Line 1802 of yacc.c */ -#line 88 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 88 "sapi/phpdbg/phpdbg_parser.y" { (yyval).type = FILE_PARAM; (yyval).file.name = (yyvsp[(2) - (3)]).str; @@ -1521,7 +1521,7 @@ yyreduce: case 11: /* Line 1802 of yacc.c */ -#line 93 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 93 "sapi/phpdbg/phpdbg_parser.y" { (yyval).type = NUMERIC_FILE_PARAM; (yyval).file.name = (yyvsp[(1) - (4)]).str; @@ -1531,7 +1531,7 @@ yyreduce: case 12: /* Line 1802 of yacc.c */ -#line 98 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 98 "sapi/phpdbg/phpdbg_parser.y" { (yyval).type = FILE_PARAM; (yyval).file.name = malloc((yyvsp[(1) - (4)]).len + (yyvsp[(2) - (4)]).len + 1); @@ -1546,7 +1546,7 @@ yyreduce: case 13: /* Line 1802 of yacc.c */ -#line 108 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 108 "sapi/phpdbg/phpdbg_parser.y" { (yyval).type = NUMERIC_FILE_PARAM; (yyval).file.name = malloc((yyvsp[(1) - (5)]).len + (yyvsp[(2) - (5)]).len + 1); @@ -1561,7 +1561,7 @@ yyreduce: case 14: /* Line 1802 of yacc.c */ -#line 118 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 118 "sapi/phpdbg/phpdbg_parser.y" { (yyval).type = METHOD_PARAM; (yyval).method.class = (yyvsp[(1) - (3)]).str; @@ -1571,7 +1571,7 @@ yyreduce: case 15: /* Line 1802 of yacc.c */ -#line 123 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 123 "sapi/phpdbg/phpdbg_parser.y" { (yyval).type = NUMERIC_METHOD_PARAM; (yyval).method.class = (yyvsp[(1) - (5)]).str; @@ -1582,7 +1582,7 @@ yyreduce: case 16: /* Line 1802 of yacc.c */ -#line 129 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 129 "sapi/phpdbg/phpdbg_parser.y" { (yyval).type = NUMERIC_FUNCTION_PARAM; (yyval).str = (yyvsp[(1) - (3)]).str; @@ -1593,7 +1593,7 @@ yyreduce: case 17: /* Line 1802 of yacc.c */ -#line 135 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 135 "sapi/phpdbg/phpdbg_parser.y" { (yyval).type = COND_PARAM; (yyval).str = (yyvsp[(2) - (2)]).str; @@ -1603,55 +1603,55 @@ yyreduce: case 18: /* Line 1802 of yacc.c */ -#line 140 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 140 "sapi/phpdbg/phpdbg_parser.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 19: /* Line 1802 of yacc.c */ -#line 141 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 141 "sapi/phpdbg/phpdbg_parser.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 20: /* Line 1802 of yacc.c */ -#line 142 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 142 "sapi/phpdbg/phpdbg_parser.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 21: /* Line 1802 of yacc.c */ -#line 143 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 143 "sapi/phpdbg/phpdbg_parser.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 22: /* Line 1802 of yacc.c */ -#line 144 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 144 "sapi/phpdbg/phpdbg_parser.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 23: /* Line 1802 of yacc.c */ -#line 145 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 145 "sapi/phpdbg/phpdbg_parser.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 24: /* Line 1802 of yacc.c */ -#line 146 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 146 "sapi/phpdbg/phpdbg_parser.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 25: /* Line 1802 of yacc.c */ -#line 150 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 150 "sapi/phpdbg/phpdbg_parser.y" { PHPDBG_G(req_id) = (yyvsp[(1) - (1)]).num; } break; case 27: /* Line 1802 of yacc.c */ -#line 155 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 155 "sapi/phpdbg/phpdbg_parser.y" { (yyval).type = EVAL_PARAM; (yyval).str = (yyvsp[(3) - (3)]).str; @@ -1661,7 +1661,7 @@ yyreduce: case 28: /* Line 1802 of yacc.c */ -#line 160 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 160 "sapi/phpdbg/phpdbg_parser.y" { (yyval).type = SHELL_PARAM; (yyval).str = (yyvsp[(3) - (3)]).str; @@ -1671,7 +1671,7 @@ yyreduce: case 29: /* Line 1802 of yacc.c */ -#line 165 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 165 "sapi/phpdbg/phpdbg_parser.y" { (yyval).type = RUN_PARAM; (yyval).len = 0; @@ -1680,7 +1680,7 @@ yyreduce: case 30: /* Line 1802 of yacc.c */ -#line 169 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 169 "sapi/phpdbg/phpdbg_parser.y" { (yyval).type = RUN_PARAM; (yyval).str = (yyvsp[(3) - (3)]).str; @@ -1922,7 +1922,7 @@ yyreturn: /* Line 2050 of yacc.c */ -#line 176 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 176 "sapi/phpdbg/phpdbg_parser.y" static int yyerror(const char *msg) { diff --git a/sapi/phpdbg/phpdbg_parser.h b/sapi/phpdbg/phpdbg_parser.h index 38d3ecbf70..d13cfbc0a5 100644 --- a/sapi/phpdbg/phpdbg_parser.h +++ b/sapi/phpdbg/phpdbg_parser.h @@ -41,7 +41,7 @@ extern int phpdbg_debug; #endif /* "%code requires" blocks. */ /* Line 2060 of yacc.c */ -#line 36 "/Users/Bob/php-src-X/sapi/phpdbg/phpdbg_parser.y" +#line 36 "sapi/phpdbg/phpdbg_parser.y" #include "phpdbg.h" #ifndef YY_TYPEDEF_YY_SCANNER_T diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c index c126ce2029..450e57d02e 100644 --- a/sapi/phpdbg/phpdbg_prompt.c +++ b/sapi/phpdbg/phpdbg_prompt.c @@ -349,7 +349,9 @@ void phpdbg_try_file_init(char *init_file, size_t init_file_len, zend_bool free_ void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default) /* {{{ */ { - if (!init_file && use_default) { + if (init_file) { + phpdbg_try_file_init(init_file, init_file_len, 1); + } else if (use_default) { char *scan_dir = getenv("PHP_INI_SCAN_DIR"); char *sys_ini; int i; @@ -382,8 +384,6 @@ void phpdbg_init(char *init_file, size_t init_file_len, zend_bool use_default) / } phpdbg_try_file_init(PHPDBG_STRL(PHPDBG_INIT_FILENAME), 0); - } else { - phpdbg_try_file_init(init_file, init_file_len, 1); } } /* }}} */ @@ -544,6 +544,7 @@ int phpdbg_compile_stdin(zend_string *code) { PHPDBG_G(exec_len) = 1; { /* remove leading ?> from source */ int i; + /* remove trailing data after zero byte, used for avoiding conflicts in eval()'ed code snippets */ zend_string *source_path = strpprintf(0, "-%c%p", 0, PHPDBG_G(ops)->opcodes); phpdbg_file_source *data = zend_hash_find_ptr(&PHPDBG_G(file_sources), source_path); dtor_func_t dtor = PHPDBG_G(file_sources).pDestructor; @@ -553,9 +554,6 @@ int phpdbg_compile_stdin(zend_string *code) { zend_hash_str_update_ptr(&PHPDBG_G(file_sources), "-", 1, data); zend_string_release(source_path); - efree(data->filename); - data->filename = estrdup("-"); - for (i = 1; i <= data->lines; i++) { data->line[i] -= 2; } @@ -572,7 +570,10 @@ int phpdbg_compile(void) /* {{{ */ { zend_file_handle fh; char *buf; + char *start_line = NULL; size_t len; + size_t start_line_len; + int i; if (!PHPDBG_G(exec)) { phpdbg_error("inactive", "type=\"nocontext\"", "No execution context"); @@ -591,7 +592,10 @@ int phpdbg_compile(void) /* {{{ */ } case '\n': CG(start_lineno) = 2; - fh.handle.stream.mmap.len -= fh.handle.stream.mmap.buf - buf; + start_line_len = fh.handle.stream.mmap.buf - buf; + start_line = emalloc(start_line_len); + memcpy(start_line, buf, start_line_len); + fh.handle.stream.mmap.len -= start_line_len; end = fh.handle.stream.mmap.buf; } } while (fh.handle.stream.mmap.buf + 1 < end); @@ -599,6 +603,29 @@ int phpdbg_compile(void) /* {{{ */ PHPDBG_G(ops) = zend_compile_file(&fh, ZEND_INCLUDE); + /* prepend shebang line to file_source */ + if (start_line) { + phpdbg_file_source *data = zend_hash_find_ptr(&PHPDBG_G(file_sources), PHPDBG_G(ops)->filename); + + dtor_func_t dtor = PHPDBG_G(file_sources).pDestructor; + PHPDBG_G(file_sources).pDestructor = NULL; + zend_hash_del(&PHPDBG_G(file_sources), PHPDBG_G(ops)->filename); + PHPDBG_G(file_sources).pDestructor = dtor; + + data = erealloc(data, sizeof(phpdbg_file_source) + sizeof(uint) * ++data->lines); + memmove(data->line + 1, data->line, sizeof(uint) * data->lines); + data->line[0] = 0; + data->buf = erealloc(data->buf, data->len + start_line_len); + memmove(data->buf + start_line_len, data->buf, data->len * sizeof(uint)); + memcpy(data->buf, start_line, start_line_len); + efree(start_line); + data->len += start_line_len; + for (i = 1; i <= data->lines; i++) { + data->line[i] += start_line_len; + } + zend_hash_update_ptr(&PHPDBG_G(file_sources), PHPDBG_G(ops)->filename, data); + } + fh.handle.stream.mmap.buf = buf; fh.handle.stream.mmap.len = len; zend_destroy_file_handle(&fh); diff --git a/sapi/phpdbg/phpdbg_sigsafe.c b/sapi/phpdbg/phpdbg_sigsafe.c index 2f987b3a15..081d864c5c 100644 --- a/sapi/phpdbg/phpdbg_sigsafe.c +++ b/sapi/phpdbg/phpdbg_sigsafe.c @@ -13,13 +13,13 @@ static void* zend_mm_mem_alloc(zend_mm_storage *storage, size_t size, size_t ali return (void *) (((size_t) PHPDBG_G(sigsafe_mem).mem & ~(alignment - 1)) + alignment); } - quiet_write(PHPDBG_G(io)[PHPDBG_STDERR].fd, ZEND_STRL("Tried to allocate more than " EXP_STR(PHPDBG_SIGSAFE_MEM_SIZE) " bytes from stack memory in signal handler ... bailing out of signal handler\n")); + zend_quiet_write(PHPDBG_G(io)[PHPDBG_STDERR].fd, ZEND_STRL("Tried to allocate more than " EXP_STR(PHPDBG_SIGSAFE_MEM_SIZE) " bytes from stack memory in signal handler ... bailing out of signal handler\n")); if (*EG(bailout)) { LONGJMP(*EG(bailout), FAILURE); } - quiet_write(PHPDBG_G(io)[PHPDBG_STDERR].fd, ZEND_STRL("Bailed out without a bailout address in signal handler!\n")); + zend_quiet_write(PHPDBG_G(io)[PHPDBG_STDERR].fd, ZEND_STRL("Bailed out without a bailout address in signal handler!\n")); return NULL; } diff --git a/sapi/phpdbg/tests/bug73615.phpt b/sapi/phpdbg/tests/bug73615.phpt new file mode 100644 index 0000000000..e5fccef0a8 --- /dev/null +++ b/sapi/phpdbg/tests/bug73615.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #73615 (phpdbg without option never load .phpdbginit at startup) +--SKIPIF-- +<?php +if (!getenv('TEST_PHPDBG_EXECUTABLE')) die("SKIP: No TEST_PHPDBG_EXECUTABLE specified"); +?> +--FILE-- +<?php + +$phpdbg = getenv('TEST_PHPDBG_EXECUTABLE'); + +chdir(__DIR__."/bug73615"); + +print `$phpdbg -qn`; + +?> +--EXPECT-- +Executed .phpdbginit diff --git a/sapi/phpdbg/tests/bug73615/.phpdbginit b/sapi/phpdbg/tests/bug73615/.phpdbginit new file mode 100644 index 0000000000..29184ddf7c --- /dev/null +++ b/sapi/phpdbg/tests/bug73615/.phpdbginit @@ -0,0 +1,2 @@ +ev "Executed .phpdbginit" +q diff --git a/sapi/phpdbg/tests/bug73704.phpt b/sapi/phpdbg/tests/bug73704.phpt new file mode 100644 index 0000000000..a3ee92b126 --- /dev/null +++ b/sapi/phpdbg/tests/bug73704.phpt @@ -0,0 +1,27 @@ +--TEST-- +Bug #73704 (phpdbg shows the wrong line in files with shebang) +--PHPDBG-- +list 6 +b 4 +r +c +q +--EXPECTF-- +[Successful compilation of %s] +prompt> 00001: #!/usr/bin/env php + 00002: <?php + 00003: + 00004: echo 1; + 00005: +prompt> [Breakpoint #0 added at %s:4] +prompt> [Breakpoint #0 at %s:4, hits: 1] +>00004: echo 1; + 00005: +prompt> 1 +[Script ended normally] +prompt> +--FILE-- +#!/usr/bin/env php +<?php + +echo 1; diff --git a/sapi/phpdbg/tests/phpdbg_get_executable_stream_wrapper.inc b/sapi/phpdbg/tests/phpdbg_get_executable_stream_wrapper.inc new file mode 100644 index 0000000000..4f4155715d --- /dev/null +++ b/sapi/phpdbg/tests/phpdbg_get_executable_stream_wrapper.inc @@ -0,0 +1,6 @@ +<?php + +function foo() +{ + return '<result>'; // line 5 is executable +} diff --git a/sapi/phpdbg/tests/phpdbg_get_executable_stream_wrapper.phpt b/sapi/phpdbg/tests/phpdbg_get_executable_stream_wrapper.phpt new file mode 100644 index 0000000000..0ddbd6f527 --- /dev/null +++ b/sapi/phpdbg/tests/phpdbg_get_executable_stream_wrapper.phpt @@ -0,0 +1,84 @@ +--TEST-- +Getting executable lines from custom wrappers +--PHPDBG-- +r +q +--EXPECTF-- +[Successful compilation of %s] +prompt> array(1) { + [5]=> + int(0) +} +[Script ended normally] +prompt> +--FILE-- +<?php + +/** + * This example demonstrates how phpdbg_get_executable() behaves differently + * when passed the 'files' option vs without, in the face of some mild abuse + * of stream wrappers. + */ + +/** + * First, we define a stream wrapper that simply maps to a real file on disk. + */ +final class StreamWrapper +{ + public function stream_open( + string $path, + string $mode, + int $options = 0, + string &$openedPath = null + ) : bool { + if ($mode[0] !== 'r') { + return false; + } + + list($scheme, $path) = explode('://', $path, 2); + + $stream = \fopen($path, $mode); + + if ($stream === false) { + return false; + } + + $this->stream = $stream; + + /** + * The $openedPath reference variable is assigned, indicating the + * *actual* path that was opened. This affects the behaviour of + * constants like __FILE__. + */ + $openedPath = \realpath($path); + + return true; + } + + public function stream_read(int $count) : string { return \fread($this->stream, $count); } + public function stream_close() : bool { return \fclose($this->stream); } + public function stream_eof() : bool { return \feof($this->stream); } + public function stream_stat() { return \fstat($this->stream); } + + private $stream = false; +} + +stream_wrapper_register('wrapper', StreamWrapper::class); + +/** + * Next, we include a PHP file that contains executable lines, via the stream + * wrapper. + */ +$filename = __DIR__ . '/phpdbg_get_executable_stream_wrapper.inc'; +require 'wrapper://' . $filename; + +/** + * If we call phpdbg_get_executable() and pass no options, the realpath of the + * included file is present in the array, but indicates no executable lines. + */ +$x = phpdbg_get_executable(); + +// We expect [5 => 0], but got an empty array ... +var_dump($x[$filename]); + +?> diff --git a/tests/lang/operators/overloaded_property_ref.phpt b/tests/lang/operators/overloaded_property_ref.phpt new file mode 100644 index 0000000000..7561fc9916 --- /dev/null +++ b/tests/lang/operators/overloaded_property_ref.phpt @@ -0,0 +1,20 @@ +--TEST-- +Operators on overlaoded property reference +--FILE-- +<?php +class C { + function __construct() { $this->bar = str_repeat("1", 2); } + function &__get($x) { return $this->bar; } + function __set($x, $v) { $this->bar = $v; } +} +$x = new C; +var_dump(++$x->foo); +$x = new C; +var_dump($x->foo++); +$x = new C; +var_dump($x->foo += 2); +?> +--EXPECT-- +int(12) +string(2) "11" +int(13) diff --git a/tests/run-test/test008a.phpt b/tests/run-test/test008a.phpt index bdd48bebf4..7d7649adc0 100644 --- a/tests/run-test/test008a.phpt +++ b/tests/run-test/test008a.phpt @@ -2,7 +2,7 @@ Error message handling (with ZendOpcache) --SKIPIF-- <?php -if (!extension_loaded("Zend Opcache")) die("skip Zend Opcache is loaded"); +if (!extension_loaded("Zend Opcache")) die("skip Zend Opcache is not loaded"); ?> --FILE-- <?php diff --git a/win32/build/libs_version.txt b/win32/build/libs_version.txt index c7cfb37940..716fad3c8b 100644 --- a/win32/build/libs_version.txt +++ b/win32/build/libs_version.txt @@ -3,13 +3,13 @@ cclient-2007f freetype-2.6.2 icu-57.1 jpeglib-9b -libcurl-7.50.3 +libcurl-7.51.0 libiconv-1.14 libmcrypt-2.5.8 libmpir-2.7.2 libpng-1.6.21 libpq-9.5.3 -libssh2-1.7.0 +libssh2-1.8.0 libtidy-20090406 libxslt-1.1.29 libxml-2.9.4 |