From f7c692a940b07fcc25a831ad28f2e1ff2560fc6f Mon Sep 17 00:00:00 2001 From: Pierrick Charron Date: Tue, 28 Mar 2023 17:27:17 -0400 Subject: [PATCH 01/51] PHP-8.2 is now for PHP 8.2.6-dev --- NEWS | 5 ++++- Zend/zend.h | 2 +- configure.ac | 2 +- main/php_version.h | 6 +++--- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index 7587628e026cb..4cdf09ba407c9 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,9 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -?? ??? ????, PHP 8.2.5 +?? ??? ????, PHP 8.2.6 + + +30 Mar 2023, PHP 8.2.5 - Core: . Added optional support for max_execution_time in ZTS/Linux builds diff --git a/Zend/zend.h b/Zend/zend.h index 379ee9c919f22..f5ea5dc911603 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -20,7 +20,7 @@ #ifndef ZEND_H #define ZEND_H -#define ZEND_VERSION "4.2.5-dev" +#define ZEND_VERSION "4.2.6-dev" #define ZEND_ENGINE_3 diff --git a/configure.ac b/configure.ac index c7ad8e66aa28a..899ead28d3dbf 100644 --- a/configure.ac +++ b/configure.ac @@ -17,7 +17,7 @@ dnl Basic autoconf initialization, generation of config.nice. dnl ---------------------------------------------------------------------------- AC_PREREQ([2.68]) -AC_INIT([PHP],[8.2.5-dev],[https://github.com/php/php-src/issues],[php],[https://www.php.net]) +AC_INIT([PHP],[8.2.6-dev],[https://github.com/php/php-src/issues],[php],[https://www.php.net]) AC_CONFIG_SRCDIR([main/php_version.h]) AC_CONFIG_AUX_DIR([build]) AC_PRESERVE_HELP_ORDER diff --git a/main/php_version.h b/main/php_version.h index 585a10d847e33..1ce7c926d8697 100644 --- a/main/php_version.h +++ b/main/php_version.h @@ -2,7 +2,7 @@ /* edit configure.ac to change version number */ #define PHP_MAJOR_VERSION 8 #define PHP_MINOR_VERSION 2 -#define PHP_RELEASE_VERSION 5 +#define PHP_RELEASE_VERSION 6 #define PHP_EXTRA_VERSION "-dev" -#define PHP_VERSION "8.2.5-dev" -#define PHP_VERSION_ID 80205 +#define PHP_VERSION "8.2.6-dev" +#define PHP_VERSION_ID 80206 From bb7dd51f7a9b5ea96cbe703dc407dbca6e207d3b Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Wed, 29 Mar 2023 10:06:00 +0100 Subject: [PATCH 02/51] Updated to version 2023.3 (2023c) --- ext/date/lib/timezonedb.h | 752 ++++++++++++++++++-------------------- 1 file changed, 362 insertions(+), 390 deletions(-) diff --git a/ext/date/lib/timezonedb.h b/ext/date/lib/timezonedb.h index 89c62a6d4926d..94397084d7bb2 100644 --- a/ext/date/lib/timezonedb.h +++ b/ext/date/lib/timezonedb.h @@ -255,357 +255,357 @@ const timelib_tzdb_index_entry timezonedb_idx_builtin[597] = { { (char*) "Asia/Bangkok" , 0x02427E }, { (char*) "Asia/Barnaul" , 0x024322 }, { (char*) "Asia/Beirut" , 0x02462D }, - { (char*) "Asia/Bishkek" , 0x024ACE }, - { (char*) "Asia/Brunei" , 0x024D44 }, - { (char*) "Asia/Calcutta" , 0x024DEA }, - { (char*) "Asia/Chita" , 0x024ED2 }, - { (char*) "Asia/Choibalsan" , 0x0251E0 }, - { (char*) "Asia/Chongqing" , 0x025469 }, - { (char*) "Asia/Chungking" , 0x0255FE }, - { (char*) "Asia/Colombo" , 0x025793 }, - { (char*) "Asia/Dacca" , 0x025896 }, - { (char*) "Asia/Damascus" , 0x025989 }, - { (char*) "Asia/Dhaka" , 0x025E67 }, - { (char*) "Asia/Dili" , 0x025F5A }, - { (char*) "Asia/Dubai" , 0x026010 }, - { (char*) "Asia/Dushanbe" , 0x0260A1 }, - { (char*) "Asia/Famagusta" , 0x02621B }, - { (char*) "Asia/Gaza" , 0x0265E2 }, - { (char*) "Asia/Harbin" , 0x026FCE }, - { (char*) "Asia/Hebron" , 0x027163 }, - { (char*) "Asia/Ho_Chi_Minh" , 0x027B60 }, - { (char*) "Asia/Hong_Kong" , 0x027C58 }, - { (char*) "Asia/Hovd" , 0x027F6B }, - { (char*) "Asia/Irkutsk" , 0x0281F4 }, - { (char*) "Asia/Istanbul" , 0x028512 }, - { (char*) "Asia/Jakarta" , 0x0289CE }, - { (char*) "Asia/Jayapura" , 0x028ADF }, - { (char*) "Asia/Jerusalem" , 0x028BCC }, - { (char*) "Asia/Kabul" , 0x02900A }, - { (char*) "Asia/Kamchatka" , 0x0290B5 }, - { (char*) "Asia/Karachi" , 0x0293AA }, - { (char*) "Asia/Kashgar" , 0x0294C0 }, - { (char*) "Asia/Kathmandu" , 0x029551 }, - { (char*) "Asia/Katmandu" , 0x0295FE }, - { (char*) "Asia/Khandyga" , 0x0296AB }, - { (char*) "Asia/Kolkata" , 0x0299DC }, - { (char*) "Asia/Krasnoyarsk" , 0x029AC4 }, - { (char*) "Asia/Kuala_Lumpur" , 0x029DCE }, - { (char*) "Asia/Kuching" , 0x029EEE }, - { (char*) "Asia/Kuwait" , 0x02A048 }, - { (char*) "Asia/Macao" , 0x02A0D9 }, - { (char*) "Asia/Macau" , 0x02A3FC }, - { (char*) "Asia/Magadan" , 0x02A71F }, - { (char*) "Asia/Makassar" , 0x02AA2A }, - { (char*) "Asia/Manila" , 0x02AB3D }, - { (char*) "Asia/Muscat" , 0x02AC37 }, - { (char*) "Asia/Nicosia" , 0x02ACC8 }, - { (char*) "Asia/Novokuznetsk" , 0x02AF37 }, - { (char*) "Asia/Novosibirsk" , 0x02B22A }, - { (char*) "Asia/Omsk" , 0x02B53B }, - { (char*) "Asia/Oral" , 0x02B839 }, - { (char*) "Asia/Phnom_Penh" , 0x02BAC5 }, - { (char*) "Asia/Pontianak" , 0x02BB99 }, - { (char*) "Asia/Pyongyang" , 0x02BCB2 }, - { (char*) "Asia/Qatar" , 0x02BD75 }, - { (char*) "Asia/Qostanay" , 0x02BE19 }, - { (char*) "Asia/Qyzylorda" , 0x02C0A6 }, - { (char*) "Asia/Rangoon" , 0x02C33F }, - { (char*) "Asia/Riyadh" , 0x02C406 }, - { (char*) "Asia/Saigon" , 0x02C497 }, - { (char*) "Asia/Sakhalin" , 0x02C58F }, - { (char*) "Asia/Samarkand" , 0x02C8A6 }, - { (char*) "Asia/Seoul" , 0x02CA31 }, - { (char*) "Asia/Shanghai" , 0x02CBDC }, - { (char*) "Asia/Singapore" , 0x02CD7D }, - { (char*) "Asia/Srednekolymsk" , 0x02CE89 }, - { (char*) "Asia/Taipei" , 0x02D199 }, - { (char*) "Asia/Tashkent" , 0x02D3A4 }, - { (char*) "Asia/Tbilisi" , 0x02D52F }, - { (char*) "Asia/Tehran" , 0x02D7B0 }, - { (char*) "Asia/Tel_Aviv" , 0x02DAE8 }, - { (char*) "Asia/Thimbu" , 0x02DF26 }, - { (char*) "Asia/Thimphu" , 0x02DFCC }, - { (char*) "Asia/Tokyo" , 0x02E072 }, - { (char*) "Asia/Tomsk" , 0x02E153 }, - { (char*) "Asia/Ujung_Pandang" , 0x02E45E }, - { (char*) "Asia/Ulaanbaatar" , 0x02E528 }, - { (char*) "Asia/Ulan_Bator" , 0x02E796 }, - { (char*) "Asia/Urumqi" , 0x02E9F4 }, - { (char*) "Asia/Ust-Nera" , 0x02EA92 }, - { (char*) "Asia/Vientiane" , 0x02EDB5 }, - { (char*) "Asia/Vladivostok" , 0x02EE9B }, - { (char*) "Asia/Yakutsk" , 0x02F1A0 }, - { (char*) "Asia/Yangon" , 0x02F4A4 }, - { (char*) "Asia/Yekaterinburg" , 0x02F56B }, - { (char*) "Asia/Yerevan" , 0x02F87D }, - { (char*) "Atlantic/Azores" , 0x02FB4D }, - { (char*) "Atlantic/Bermuda" , 0x03010C }, - { (char*) "Atlantic/Canary" , 0x030518 }, - { (char*) "Atlantic/Cape_Verde" , 0x030710 }, - { (char*) "Atlantic/Faeroe" , 0x0307CB }, - { (char*) "Atlantic/Faroe" , 0x030990 }, - { (char*) "Atlantic/Jan_Mayen" , 0x030B55 }, - { (char*) "Atlantic/Madeira" , 0x030E22 }, - { (char*) "Atlantic/Reykjavik" , 0x0313EA }, - { (char*) "Atlantic/South_Georgia" , 0x0316E7 }, - { (char*) "Atlantic/St_Helena" , 0x031777 }, - { (char*) "Atlantic/Stanley" , 0x031818 }, - { (char*) "Australia/ACT" , 0x031B39 }, - { (char*) "Australia/Adelaide" , 0x031ECD }, - { (char*) "Australia/Brisbane" , 0x032281 }, - { (char*) "Australia/Broken_Hill" , 0x0323C5 }, - { (char*) "Australia/Canberra" , 0x03279A }, - { (char*) "Australia/Currie" , 0x032B2E }, - { (char*) "Australia/Darwin" , 0x032F25 }, - { (char*) "Australia/Eucla" , 0x03302D }, - { (char*) "Australia/Hobart" , 0x03318C }, - { (char*) "Australia/LHI" , 0x03358B }, - { (char*) "Australia/Lindeman" , 0x03384B }, - { (char*) "Australia/Lord_Howe" , 0x0339BB }, - { (char*) "Australia/Melbourne" , 0x033C8B }, - { (char*) "Australia/North" , 0x034027 }, - { (char*) "Australia/NSW" , 0x03411D }, - { (char*) "Australia/Perth" , 0x0344B1 }, - { (char*) "Australia/Queensland" , 0x03460D }, - { (char*) "Australia/South" , 0x03473A }, - { (char*) "Australia/Sydney" , 0x034ADF }, - { (char*) "Australia/Tasmania" , 0x034E8F }, - { (char*) "Australia/Victoria" , 0x035286 }, - { (char*) "Australia/West" , 0x03561A }, - { (char*) "Australia/Yancowinna" , 0x035758 }, - { (char*) "Brazil/Acre" , 0x035B11 }, - { (char*) "Brazil/DeNoronha" , 0x035CBF }, - { (char*) "Brazil/East" , 0x035EAF }, - { (char*) "Brazil/West" , 0x036273 }, - { (char*) "Canada/Atlantic" , 0x03641B }, - { (char*) "Canada/Central" , 0x036AAF }, - { (char*) "Canada/Eastern" , 0x036FC9 }, - { (char*) "Canada/Mountain" , 0x03768A }, - { (char*) "Canada/Newfoundland" , 0x037A60 }, - { (char*) "Canada/Pacific" , 0x0381C2 }, - { (char*) "Canada/Saskatchewan" , 0x038700 }, - { (char*) "Canada/Yukon" , 0x03898A }, - { (char*) "CET" , 0x038D9B }, - { (char*) "Chile/Continental" , 0x039014 }, - { (char*) "Chile/EasterIsland" , 0x03956A }, - { (char*) "CST6CDT" , 0x039A0C }, - { (char*) "Cuba" , 0x039DCF }, - { (char*) "EET" , 0x03A238 }, - { (char*) "Egypt" , 0x03A435 }, - { (char*) "Eire" , 0x03A95E }, - { (char*) "EST" , 0x03AF42 }, - { (char*) "EST5EDT" , 0x03AFBD }, - { (char*) "Etc/GMT" , 0x03B380 }, - { (char*) "Etc/GMT+0" , 0x03B3FB }, - { (char*) "Etc/GMT+1" , 0x03B476 }, - { (char*) "Etc/GMT+10" , 0x03B4F3 }, - { (char*) "Etc/GMT+11" , 0x03B571 }, - { (char*) "Etc/GMT+12" , 0x03B5EF }, - { (char*) "Etc/GMT+2" , 0x03B66D }, - { (char*) "Etc/GMT+3" , 0x03B6EA }, - { (char*) "Etc/GMT+4" , 0x03B767 }, - { (char*) "Etc/GMT+5" , 0x03B7E4 }, - { (char*) "Etc/GMT+6" , 0x03B861 }, - { (char*) "Etc/GMT+7" , 0x03B8DE }, - { (char*) "Etc/GMT+8" , 0x03B95B }, - { (char*) "Etc/GMT+9" , 0x03B9D8 }, - { (char*) "Etc/GMT-0" , 0x03BA55 }, - { (char*) "Etc/GMT-1" , 0x03BAD0 }, - { (char*) "Etc/GMT-10" , 0x03BB4E }, - { (char*) "Etc/GMT-11" , 0x03BBCD }, - { (char*) "Etc/GMT-12" , 0x03BC4C }, - { (char*) "Etc/GMT-13" , 0x03BCCB }, - { (char*) "Etc/GMT-14" , 0x03BD4A }, - { (char*) "Etc/GMT-2" , 0x03BDC9 }, - { (char*) "Etc/GMT-3" , 0x03BE47 }, - { (char*) "Etc/GMT-4" , 0x03BEC5 }, - { (char*) "Etc/GMT-5" , 0x03BF43 }, - { (char*) "Etc/GMT-6" , 0x03BFC1 }, - { (char*) "Etc/GMT-7" , 0x03C03F }, - { (char*) "Etc/GMT-8" , 0x03C0BD }, - { (char*) "Etc/GMT-9" , 0x03C13B }, - { (char*) "Etc/GMT0" , 0x03C1B9 }, - { (char*) "Etc/Greenwich" , 0x03C234 }, - { (char*) "Etc/UCT" , 0x03C2AF }, - { (char*) "Etc/Universal" , 0x03C32A }, - { (char*) "Etc/UTC" , 0x03C3A5 }, - { (char*) "Etc/Zulu" , 0x03C420 }, - { (char*) "Europe/Amsterdam" , 0x03C49B }, - { (char*) "Europe/Andorra" , 0x03C8D6 }, - { (char*) "Europe/Astrakhan" , 0x03CA67 }, - { (char*) "Europe/Athens" , 0x03CD5B }, - { (char*) "Europe/Belfast" , 0x03D011 }, - { (char*) "Europe/Belgrade" , 0x03D65C }, - { (char*) "Europe/Berlin" , 0x03D846 }, - { (char*) "Europe/Bratislava" , 0x03DB22 }, - { (char*) "Europe/Brussels" , 0x03DE01 }, - { (char*) "Europe/Bucharest" , 0x03E25C }, - { (char*) "Europe/Budapest" , 0x03E4FD }, - { (char*) "Europe/Busingen" , 0x03E807 }, - { (char*) "Europe/Chisinau" , 0x03EA0C }, - { (char*) "Europe/Copenhagen" , 0x03ED0B }, - { (char*) "Europe/Dublin" , 0x03EF86 }, - { (char*) "Europe/Gibraltar" , 0x03F56A }, - { (char*) "Europe/Guernsey" , 0x03FA3A }, - { (char*) "Europe/Helsinki" , 0x040091 }, - { (char*) "Europe/Isle_of_Man" , 0x04027E }, - { (char*) "Europe/Istanbul" , 0x0408C9 }, - { (char*) "Europe/Jersey" , 0x040D85 }, - { (char*) "Europe/Kaliningrad" , 0x0413DC }, - { (char*) "Europe/Kiev" , 0x041784 }, - { (char*) "Europe/Kirov" , 0x0419BE }, - { (char*) "Europe/Kyiv" , 0x041CB7 }, - { (char*) "Europe/Lisbon" , 0x041F00 }, - { (char*) "Europe/Ljubljana" , 0x0424CD }, - { (char*) "Europe/London" , 0x0426B7 }, - { (char*) "Europe/Luxembourg" , 0x042D02 }, - { (char*) "Europe/Madrid" , 0x04314D }, - { (char*) "Europe/Malta" , 0x0434EA }, - { (char*) "Europe/Mariehamn" , 0x043896 }, - { (char*) "Europe/Minsk" , 0x043A83 }, - { (char*) "Europe/Monaco" , 0x043DB7 }, - { (char*) "Europe/Moscow" , 0x04421D }, - { (char*) "Europe/Nicosia" , 0x0445C9 }, - { (char*) "Europe/Oslo" , 0x04482A }, - { (char*) "Europe/Paris" , 0x044ADA }, - { (char*) "Europe/Podgorica" , 0x044F37 }, - { (char*) "Europe/Prague" , 0x045121 }, - { (char*) "Europe/Riga" , 0x045400 }, - { (char*) "Europe/Rome" , 0x0456C2 }, - { (char*) "Europe/Samara" , 0x045A81 }, - { (char*) "Europe/San_Marino" , 0x045D82 }, - { (char*) "Europe/Sarajevo" , 0x046141 }, - { (char*) "Europe/Saratov" , 0x04632B }, - { (char*) "Europe/Simferopol" , 0x04661D }, - { (char*) "Europe/Skopje" , 0x046990 }, - { (char*) "Europe/Sofia" , 0x046B7A }, - { (char*) "Europe/Stockholm" , 0x046DD6 }, - { (char*) "Europe/Tallinn" , 0x046FD3 }, - { (char*) "Europe/Tirane" , 0x047282 }, - { (char*) "Europe/Tiraspol" , 0x0474EA }, - { (char*) "Europe/Ulyanovsk" , 0x0477E9 }, - { (char*) "Europe/Uzhgorod" , 0x047AFF }, - { (char*) "Europe/Vaduz" , 0x047D39 }, - { (char*) "Europe/Vatican" , 0x047F23 }, - { (char*) "Europe/Vienna" , 0x0482E2 }, - { (char*) "Europe/Vilnius" , 0x048580 }, - { (char*) "Europe/Volgograd" , 0x048830 }, - { (char*) "Europe/Warsaw" , 0x048B3F }, - { (char*) "Europe/Zagreb" , 0x048EE6 }, - { (char*) "Europe/Zaporozhye" , 0x0490D0 }, - { (char*) "Europe/Zurich" , 0x04930A }, - { (char*) "Factory" , 0x049507 }, - { (char*) "GB" , 0x049584 }, - { (char*) "GB-Eire" , 0x049BCF }, - { (char*) "GMT" , 0x04A21A }, - { (char*) "GMT+0" , 0x04A295 }, - { (char*) "GMT-0" , 0x04A310 }, - { (char*) "GMT0" , 0x04A38B }, - { (char*) "Greenwich" , 0x04A406 }, - { (char*) "Hongkong" , 0x04A481 }, - { (char*) "HST" , 0x04A794 }, - { (char*) "Iceland" , 0x04A810 }, - { (char*) "Indian/Antananarivo" , 0x04A89E }, - { (char*) "Indian/Chagos" , 0x04A94A }, - { (char*) "Indian/Christmas" , 0x04A9EE }, - { (char*) "Indian/Cocos" , 0x04AA7F }, - { (char*) "Indian/Comoro" , 0x04AB17 }, - { (char*) "Indian/Kerguelen" , 0x04ABA6 }, - { (char*) "Indian/Mahe" , 0x04AC37 }, - { (char*) "Indian/Maldives" , 0x04ACC8 }, - { (char*) "Indian/Mauritius" , 0x04AD6C }, - { (char*) "Indian/Mayotte" , 0x04AE2B }, - { (char*) "Indian/Reunion" , 0x04AEBA }, - { (char*) "Iran" , 0x04AF4B }, - { (char*) "Israel" , 0x04B283 }, - { (char*) "Jamaica" , 0x04B6C1 }, - { (char*) "Japan" , 0x04B820 }, - { (char*) "Kwajalein" , 0x04B901 }, - { (char*) "Libya" , 0x04B9E8 }, - { (char*) "MET" , 0x04BBA3 }, - { (char*) "Mexico/BajaNorte" , 0x04BE1C }, - { (char*) "Mexico/BajaSur" , 0x04C229 }, - { (char*) "Mexico/General" , 0x04C503 }, - { (char*) "MST" , 0x04C814 }, - { (char*) "MST7MDT" , 0x04C88F }, - { (char*) "Navajo" , 0x04CC52 }, - { (char*) "NZ" , 0x04D070 }, - { (char*) "NZ-CHAT" , 0x04D48F }, - { (char*) "Pacific/Apia" , 0x04D7C3 }, - { (char*) "Pacific/Auckland" , 0x04D966 }, - { (char*) "Pacific/Bougainville" , 0x04DD98 }, - { (char*) "Pacific/Chatham" , 0x04DE79 }, - { (char*) "Pacific/Chuuk" , 0x04E1BC }, - { (char*) "Pacific/Easter" , 0x04E29A }, - { (char*) "Pacific/Efate" , 0x04E749 }, - { (char*) "Pacific/Enderbury" , 0x04E8AB }, - { (char*) "Pacific/Fakaofo" , 0x04E963 }, - { (char*) "Pacific/Fiji" , 0x04EA08 }, - { (char*) "Pacific/Funafuti" , 0x04EBA0 }, - { (char*) "Pacific/Galapagos" , 0x04EC32 }, - { (char*) "Pacific/Gambier" , 0x04ECFE }, - { (char*) "Pacific/Guadalcanal" , 0x04ED9D }, - { (char*) "Pacific/Guam" , 0x04EE2F }, - { (char*) "Pacific/Honolulu" , 0x04EF99 }, - { (char*) "Pacific/Johnston" , 0x04F088 }, - { (char*) "Pacific/Kanton" , 0x04F171 }, - { (char*) "Pacific/Kiritimati" , 0x04F238 }, - { (char*) "Pacific/Kosrae" , 0x04F2FE }, - { (char*) "Pacific/Kwajalein" , 0x04F402 }, - { (char*) "Pacific/Majuro" , 0x04F4F2 }, - { (char*) "Pacific/Marquesas" , 0x04F5F0 }, - { (char*) "Pacific/Midway" , 0x04F698 }, - { (char*) "Pacific/Nauru" , 0x04F75B }, - { (char*) "Pacific/Niue" , 0x04F81E }, - { (char*) "Pacific/Norfolk" , 0x04F8C4 }, - { (char*) "Pacific/Noumea" , 0x04F9C7 }, - { (char*) "Pacific/Pago_Pago" , 0x04FA99 }, - { (char*) "Pacific/Palau" , 0x04FB37 }, - { (char*) "Pacific/Pitcairn" , 0x04FBD7 }, - { (char*) "Pacific/Pohnpei" , 0x04FC7C }, - { (char*) "Pacific/Ponape" , 0x04FD6C }, - { (char*) "Pacific/Port_Moresby" , 0x04FDFE }, - { (char*) "Pacific/Rarotonga" , 0x04FEBC }, - { (char*) "Pacific/Saipan" , 0x05005E }, - { (char*) "Pacific/Samoa" , 0x0501BF }, - { (char*) "Pacific/Tahiti" , 0x05025D }, - { (char*) "Pacific/Tarawa" , 0x0502FD }, - { (char*) "Pacific/Tongatapu" , 0x05039E }, - { (char*) "Pacific/Truk" , 0x050497 }, - { (char*) "Pacific/Wake" , 0x05053D }, - { (char*) "Pacific/Wallis" , 0x0505DA }, - { (char*) "Pacific/Yap" , 0x05066C }, - { (char*) "Poland" , 0x050712 }, - { (char*) "Portugal" , 0x050AB9 }, - { (char*) "PRC" , 0x051073 }, - { (char*) "PST8PDT" , 0x051208 }, - { (char*) "ROC" , 0x0515CB }, - { (char*) "ROK" , 0x0517D6 }, - { (char*) "Singapore" , 0x051981 }, - { (char*) "Turkey" , 0x051A8D }, - { (char*) "UCT" , 0x051F49 }, - { (char*) "Universal" , 0x051FC4 }, - { (char*) "US/Alaska" , 0x05203F }, - { (char*) "US/Aleutian" , 0x05241C }, - { (char*) "US/Arizona" , 0x0527F1 }, - { (char*) "US/Central" , 0x0528ED }, - { (char*) "US/East-Indiana" , 0x052FD3 }, - { (char*) "US/Eastern" , 0x0531F2 }, - { (char*) "US/Hawaii" , 0x0538CE }, - { (char*) "US/Indiana-Starke" , 0x0539B7 }, - { (char*) "US/Michigan" , 0x053DBB }, - { (char*) "US/Mountain" , 0x05414A }, - { (char*) "US/Pacific" , 0x054568 }, - { (char*) "US/Samoa" , 0x054A82 }, - { (char*) "UTC" , 0x054B20 }, - { (char*) "W-SU" , 0x054B9B }, - { (char*) "WET" , 0x054F33 }, - { (char*) "Zulu" , 0x05512D }, + { (char*) "Asia/Bishkek" , 0x024915 }, + { (char*) "Asia/Brunei" , 0x024B8B }, + { (char*) "Asia/Calcutta" , 0x024C31 }, + { (char*) "Asia/Chita" , 0x024D19 }, + { (char*) "Asia/Choibalsan" , 0x025027 }, + { (char*) "Asia/Chongqing" , 0x0252B0 }, + { (char*) "Asia/Chungking" , 0x025445 }, + { (char*) "Asia/Colombo" , 0x0255DA }, + { (char*) "Asia/Dacca" , 0x0256DD }, + { (char*) "Asia/Damascus" , 0x0257D0 }, + { (char*) "Asia/Dhaka" , 0x025CAE }, + { (char*) "Asia/Dili" , 0x025DA1 }, + { (char*) "Asia/Dubai" , 0x025E57 }, + { (char*) "Asia/Dushanbe" , 0x025EE8 }, + { (char*) "Asia/Famagusta" , 0x026062 }, + { (char*) "Asia/Gaza" , 0x026429 }, + { (char*) "Asia/Harbin" , 0x026E15 }, + { (char*) "Asia/Hebron" , 0x026FAA }, + { (char*) "Asia/Ho_Chi_Minh" , 0x0279A7 }, + { (char*) "Asia/Hong_Kong" , 0x027A9F }, + { (char*) "Asia/Hovd" , 0x027DB2 }, + { (char*) "Asia/Irkutsk" , 0x02803B }, + { (char*) "Asia/Istanbul" , 0x028359 }, + { (char*) "Asia/Jakarta" , 0x028815 }, + { (char*) "Asia/Jayapura" , 0x028926 }, + { (char*) "Asia/Jerusalem" , 0x028A13 }, + { (char*) "Asia/Kabul" , 0x028E51 }, + { (char*) "Asia/Kamchatka" , 0x028EFC }, + { (char*) "Asia/Karachi" , 0x0291F1 }, + { (char*) "Asia/Kashgar" , 0x029307 }, + { (char*) "Asia/Kathmandu" , 0x029398 }, + { (char*) "Asia/Katmandu" , 0x029445 }, + { (char*) "Asia/Khandyga" , 0x0294F2 }, + { (char*) "Asia/Kolkata" , 0x029823 }, + { (char*) "Asia/Krasnoyarsk" , 0x02990B }, + { (char*) "Asia/Kuala_Lumpur" , 0x029C15 }, + { (char*) "Asia/Kuching" , 0x029D35 }, + { (char*) "Asia/Kuwait" , 0x029E8F }, + { (char*) "Asia/Macao" , 0x029F20 }, + { (char*) "Asia/Macau" , 0x02A243 }, + { (char*) "Asia/Magadan" , 0x02A566 }, + { (char*) "Asia/Makassar" , 0x02A871 }, + { (char*) "Asia/Manila" , 0x02A984 }, + { (char*) "Asia/Muscat" , 0x02AA7E }, + { (char*) "Asia/Nicosia" , 0x02AB0F }, + { (char*) "Asia/Novokuznetsk" , 0x02AD7E }, + { (char*) "Asia/Novosibirsk" , 0x02B071 }, + { (char*) "Asia/Omsk" , 0x02B382 }, + { (char*) "Asia/Oral" , 0x02B680 }, + { (char*) "Asia/Phnom_Penh" , 0x02B90C }, + { (char*) "Asia/Pontianak" , 0x02B9E0 }, + { (char*) "Asia/Pyongyang" , 0x02BAF9 }, + { (char*) "Asia/Qatar" , 0x02BBBC }, + { (char*) "Asia/Qostanay" , 0x02BC60 }, + { (char*) "Asia/Qyzylorda" , 0x02BEED }, + { (char*) "Asia/Rangoon" , 0x02C186 }, + { (char*) "Asia/Riyadh" , 0x02C24D }, + { (char*) "Asia/Saigon" , 0x02C2DE }, + { (char*) "Asia/Sakhalin" , 0x02C3D6 }, + { (char*) "Asia/Samarkand" , 0x02C6ED }, + { (char*) "Asia/Seoul" , 0x02C878 }, + { (char*) "Asia/Shanghai" , 0x02CA23 }, + { (char*) "Asia/Singapore" , 0x02CBC4 }, + { (char*) "Asia/Srednekolymsk" , 0x02CCD0 }, + { (char*) "Asia/Taipei" , 0x02CFE0 }, + { (char*) "Asia/Tashkent" , 0x02D1EB }, + { (char*) "Asia/Tbilisi" , 0x02D376 }, + { (char*) "Asia/Tehran" , 0x02D5F7 }, + { (char*) "Asia/Tel_Aviv" , 0x02D92F }, + { (char*) "Asia/Thimbu" , 0x02DD6D }, + { (char*) "Asia/Thimphu" , 0x02DE13 }, + { (char*) "Asia/Tokyo" , 0x02DEB9 }, + { (char*) "Asia/Tomsk" , 0x02DF9A }, + { (char*) "Asia/Ujung_Pandang" , 0x02E2A5 }, + { (char*) "Asia/Ulaanbaatar" , 0x02E36F }, + { (char*) "Asia/Ulan_Bator" , 0x02E5DD }, + { (char*) "Asia/Urumqi" , 0x02E83B }, + { (char*) "Asia/Ust-Nera" , 0x02E8D9 }, + { (char*) "Asia/Vientiane" , 0x02EBFC }, + { (char*) "Asia/Vladivostok" , 0x02ECE2 }, + { (char*) "Asia/Yakutsk" , 0x02EFE7 }, + { (char*) "Asia/Yangon" , 0x02F2EB }, + { (char*) "Asia/Yekaterinburg" , 0x02F3B2 }, + { (char*) "Asia/Yerevan" , 0x02F6C4 }, + { (char*) "Atlantic/Azores" , 0x02F994 }, + { (char*) "Atlantic/Bermuda" , 0x02FF53 }, + { (char*) "Atlantic/Canary" , 0x03035F }, + { (char*) "Atlantic/Cape_Verde" , 0x030557 }, + { (char*) "Atlantic/Faeroe" , 0x030612 }, + { (char*) "Atlantic/Faroe" , 0x0307D7 }, + { (char*) "Atlantic/Jan_Mayen" , 0x03099C }, + { (char*) "Atlantic/Madeira" , 0x030C69 }, + { (char*) "Atlantic/Reykjavik" , 0x031231 }, + { (char*) "Atlantic/South_Georgia" , 0x03152E }, + { (char*) "Atlantic/St_Helena" , 0x0315BE }, + { (char*) "Atlantic/Stanley" , 0x03165F }, + { (char*) "Australia/ACT" , 0x031980 }, + { (char*) "Australia/Adelaide" , 0x031D14 }, + { (char*) "Australia/Brisbane" , 0x0320C8 }, + { (char*) "Australia/Broken_Hill" , 0x03220C }, + { (char*) "Australia/Canberra" , 0x0325E1 }, + { (char*) "Australia/Currie" , 0x032975 }, + { (char*) "Australia/Darwin" , 0x032D6C }, + { (char*) "Australia/Eucla" , 0x032E74 }, + { (char*) "Australia/Hobart" , 0x032FD3 }, + { (char*) "Australia/LHI" , 0x0333D2 }, + { (char*) "Australia/Lindeman" , 0x033692 }, + { (char*) "Australia/Lord_Howe" , 0x033802 }, + { (char*) "Australia/Melbourne" , 0x033AD2 }, + { (char*) "Australia/North" , 0x033E6E }, + { (char*) "Australia/NSW" , 0x033F64 }, + { (char*) "Australia/Perth" , 0x0342F8 }, + { (char*) "Australia/Queensland" , 0x034454 }, + { (char*) "Australia/South" , 0x034581 }, + { (char*) "Australia/Sydney" , 0x034926 }, + { (char*) "Australia/Tasmania" , 0x034CD6 }, + { (char*) "Australia/Victoria" , 0x0350CD }, + { (char*) "Australia/West" , 0x035461 }, + { (char*) "Australia/Yancowinna" , 0x03559F }, + { (char*) "Brazil/Acre" , 0x035958 }, + { (char*) "Brazil/DeNoronha" , 0x035B06 }, + { (char*) "Brazil/East" , 0x035CF6 }, + { (char*) "Brazil/West" , 0x0360BA }, + { (char*) "Canada/Atlantic" , 0x036262 }, + { (char*) "Canada/Central" , 0x0368F6 }, + { (char*) "Canada/Eastern" , 0x036E10 }, + { (char*) "Canada/Mountain" , 0x0374D1 }, + { (char*) "Canada/Newfoundland" , 0x0378A7 }, + { (char*) "Canada/Pacific" , 0x038009 }, + { (char*) "Canada/Saskatchewan" , 0x038547 }, + { (char*) "Canada/Yukon" , 0x0387D1 }, + { (char*) "CET" , 0x038BE2 }, + { (char*) "Chile/Continental" , 0x038E5B }, + { (char*) "Chile/EasterIsland" , 0x0393B1 }, + { (char*) "CST6CDT" , 0x039853 }, + { (char*) "Cuba" , 0x039C16 }, + { (char*) "EET" , 0x03A07F }, + { (char*) "Egypt" , 0x03A27C }, + { (char*) "Eire" , 0x03A7A5 }, + { (char*) "EST" , 0x03AD89 }, + { (char*) "EST5EDT" , 0x03AE04 }, + { (char*) "Etc/GMT" , 0x03B1C7 }, + { (char*) "Etc/GMT+0" , 0x03B242 }, + { (char*) "Etc/GMT+1" , 0x03B2BD }, + { (char*) "Etc/GMT+10" , 0x03B33A }, + { (char*) "Etc/GMT+11" , 0x03B3B8 }, + { (char*) "Etc/GMT+12" , 0x03B436 }, + { (char*) "Etc/GMT+2" , 0x03B4B4 }, + { (char*) "Etc/GMT+3" , 0x03B531 }, + { (char*) "Etc/GMT+4" , 0x03B5AE }, + { (char*) "Etc/GMT+5" , 0x03B62B }, + { (char*) "Etc/GMT+6" , 0x03B6A8 }, + { (char*) "Etc/GMT+7" , 0x03B725 }, + { (char*) "Etc/GMT+8" , 0x03B7A2 }, + { (char*) "Etc/GMT+9" , 0x03B81F }, + { (char*) "Etc/GMT-0" , 0x03B89C }, + { (char*) "Etc/GMT-1" , 0x03B917 }, + { (char*) "Etc/GMT-10" , 0x03B995 }, + { (char*) "Etc/GMT-11" , 0x03BA14 }, + { (char*) "Etc/GMT-12" , 0x03BA93 }, + { (char*) "Etc/GMT-13" , 0x03BB12 }, + { (char*) "Etc/GMT-14" , 0x03BB91 }, + { (char*) "Etc/GMT-2" , 0x03BC10 }, + { (char*) "Etc/GMT-3" , 0x03BC8E }, + { (char*) "Etc/GMT-4" , 0x03BD0C }, + { (char*) "Etc/GMT-5" , 0x03BD8A }, + { (char*) "Etc/GMT-6" , 0x03BE08 }, + { (char*) "Etc/GMT-7" , 0x03BE86 }, + { (char*) "Etc/GMT-8" , 0x03BF04 }, + { (char*) "Etc/GMT-9" , 0x03BF82 }, + { (char*) "Etc/GMT0" , 0x03C000 }, + { (char*) "Etc/Greenwich" , 0x03C07B }, + { (char*) "Etc/UCT" , 0x03C0F6 }, + { (char*) "Etc/Universal" , 0x03C171 }, + { (char*) "Etc/UTC" , 0x03C1EC }, + { (char*) "Etc/Zulu" , 0x03C267 }, + { (char*) "Europe/Amsterdam" , 0x03C2E2 }, + { (char*) "Europe/Andorra" , 0x03C71D }, + { (char*) "Europe/Astrakhan" , 0x03C8AE }, + { (char*) "Europe/Athens" , 0x03CBA2 }, + { (char*) "Europe/Belfast" , 0x03CE58 }, + { (char*) "Europe/Belgrade" , 0x03D4A3 }, + { (char*) "Europe/Berlin" , 0x03D68D }, + { (char*) "Europe/Bratislava" , 0x03D969 }, + { (char*) "Europe/Brussels" , 0x03DC48 }, + { (char*) "Europe/Bucharest" , 0x03E0A3 }, + { (char*) "Europe/Budapest" , 0x03E344 }, + { (char*) "Europe/Busingen" , 0x03E64E }, + { (char*) "Europe/Chisinau" , 0x03E853 }, + { (char*) "Europe/Copenhagen" , 0x03EB52 }, + { (char*) "Europe/Dublin" , 0x03EDCD }, + { (char*) "Europe/Gibraltar" , 0x03F3B1 }, + { (char*) "Europe/Guernsey" , 0x03F881 }, + { (char*) "Europe/Helsinki" , 0x03FED8 }, + { (char*) "Europe/Isle_of_Man" , 0x0400C5 }, + { (char*) "Europe/Istanbul" , 0x040710 }, + { (char*) "Europe/Jersey" , 0x040BCC }, + { (char*) "Europe/Kaliningrad" , 0x041223 }, + { (char*) "Europe/Kiev" , 0x0415CB }, + { (char*) "Europe/Kirov" , 0x041805 }, + { (char*) "Europe/Kyiv" , 0x041AFE }, + { (char*) "Europe/Lisbon" , 0x041D47 }, + { (char*) "Europe/Ljubljana" , 0x042314 }, + { (char*) "Europe/London" , 0x0424FE }, + { (char*) "Europe/Luxembourg" , 0x042B49 }, + { (char*) "Europe/Madrid" , 0x042F94 }, + { (char*) "Europe/Malta" , 0x043331 }, + { (char*) "Europe/Mariehamn" , 0x0436DD }, + { (char*) "Europe/Minsk" , 0x0438CA }, + { (char*) "Europe/Monaco" , 0x043BFE }, + { (char*) "Europe/Moscow" , 0x044064 }, + { (char*) "Europe/Nicosia" , 0x044410 }, + { (char*) "Europe/Oslo" , 0x044671 }, + { (char*) "Europe/Paris" , 0x044921 }, + { (char*) "Europe/Podgorica" , 0x044D7E }, + { (char*) "Europe/Prague" , 0x044F68 }, + { (char*) "Europe/Riga" , 0x045247 }, + { (char*) "Europe/Rome" , 0x045509 }, + { (char*) "Europe/Samara" , 0x0458C8 }, + { (char*) "Europe/San_Marino" , 0x045BC9 }, + { (char*) "Europe/Sarajevo" , 0x045F88 }, + { (char*) "Europe/Saratov" , 0x046172 }, + { (char*) "Europe/Simferopol" , 0x046464 }, + { (char*) "Europe/Skopje" , 0x0467D7 }, + { (char*) "Europe/Sofia" , 0x0469C1 }, + { (char*) "Europe/Stockholm" , 0x046C1D }, + { (char*) "Europe/Tallinn" , 0x046E1A }, + { (char*) "Europe/Tirane" , 0x0470C9 }, + { (char*) "Europe/Tiraspol" , 0x047331 }, + { (char*) "Europe/Ulyanovsk" , 0x047630 }, + { (char*) "Europe/Uzhgorod" , 0x047946 }, + { (char*) "Europe/Vaduz" , 0x047B80 }, + { (char*) "Europe/Vatican" , 0x047D6A }, + { (char*) "Europe/Vienna" , 0x048129 }, + { (char*) "Europe/Vilnius" , 0x0483C7 }, + { (char*) "Europe/Volgograd" , 0x048677 }, + { (char*) "Europe/Warsaw" , 0x048986 }, + { (char*) "Europe/Zagreb" , 0x048D2D }, + { (char*) "Europe/Zaporozhye" , 0x048F17 }, + { (char*) "Europe/Zurich" , 0x049151 }, + { (char*) "Factory" , 0x04934E }, + { (char*) "GB" , 0x0493CB }, + { (char*) "GB-Eire" , 0x049A16 }, + { (char*) "GMT" , 0x04A061 }, + { (char*) "GMT+0" , 0x04A0DC }, + { (char*) "GMT-0" , 0x04A157 }, + { (char*) "GMT0" , 0x04A1D2 }, + { (char*) "Greenwich" , 0x04A24D }, + { (char*) "Hongkong" , 0x04A2C8 }, + { (char*) "HST" , 0x04A5DB }, + { (char*) "Iceland" , 0x04A657 }, + { (char*) "Indian/Antananarivo" , 0x04A6E5 }, + { (char*) "Indian/Chagos" , 0x04A791 }, + { (char*) "Indian/Christmas" , 0x04A835 }, + { (char*) "Indian/Cocos" , 0x04A8C6 }, + { (char*) "Indian/Comoro" , 0x04A95E }, + { (char*) "Indian/Kerguelen" , 0x04A9ED }, + { (char*) "Indian/Mahe" , 0x04AA7E }, + { (char*) "Indian/Maldives" , 0x04AB0F }, + { (char*) "Indian/Mauritius" , 0x04ABB3 }, + { (char*) "Indian/Mayotte" , 0x04AC72 }, + { (char*) "Indian/Reunion" , 0x04AD01 }, + { (char*) "Iran" , 0x04AD92 }, + { (char*) "Israel" , 0x04B0CA }, + { (char*) "Jamaica" , 0x04B508 }, + { (char*) "Japan" , 0x04B667 }, + { (char*) "Kwajalein" , 0x04B748 }, + { (char*) "Libya" , 0x04B82F }, + { (char*) "MET" , 0x04B9EA }, + { (char*) "Mexico/BajaNorte" , 0x04BC63 }, + { (char*) "Mexico/BajaSur" , 0x04C070 }, + { (char*) "Mexico/General" , 0x04C34A }, + { (char*) "MST" , 0x04C65B }, + { (char*) "MST7MDT" , 0x04C6D6 }, + { (char*) "Navajo" , 0x04CA99 }, + { (char*) "NZ" , 0x04CEB7 }, + { (char*) "NZ-CHAT" , 0x04D2D6 }, + { (char*) "Pacific/Apia" , 0x04D60A }, + { (char*) "Pacific/Auckland" , 0x04D7AD }, + { (char*) "Pacific/Bougainville" , 0x04DBDF }, + { (char*) "Pacific/Chatham" , 0x04DCC0 }, + { (char*) "Pacific/Chuuk" , 0x04E003 }, + { (char*) "Pacific/Easter" , 0x04E0E1 }, + { (char*) "Pacific/Efate" , 0x04E590 }, + { (char*) "Pacific/Enderbury" , 0x04E6F2 }, + { (char*) "Pacific/Fakaofo" , 0x04E7AA }, + { (char*) "Pacific/Fiji" , 0x04E84F }, + { (char*) "Pacific/Funafuti" , 0x04E9E7 }, + { (char*) "Pacific/Galapagos" , 0x04EA79 }, + { (char*) "Pacific/Gambier" , 0x04EB45 }, + { (char*) "Pacific/Guadalcanal" , 0x04EBE4 }, + { (char*) "Pacific/Guam" , 0x04EC76 }, + { (char*) "Pacific/Honolulu" , 0x04EDE0 }, + { (char*) "Pacific/Johnston" , 0x04EECF }, + { (char*) "Pacific/Kanton" , 0x04EFB8 }, + { (char*) "Pacific/Kiritimati" , 0x04F07F }, + { (char*) "Pacific/Kosrae" , 0x04F145 }, + { (char*) "Pacific/Kwajalein" , 0x04F249 }, + { (char*) "Pacific/Majuro" , 0x04F339 }, + { (char*) "Pacific/Marquesas" , 0x04F437 }, + { (char*) "Pacific/Midway" , 0x04F4DF }, + { (char*) "Pacific/Nauru" , 0x04F5A2 }, + { (char*) "Pacific/Niue" , 0x04F665 }, + { (char*) "Pacific/Norfolk" , 0x04F70B }, + { (char*) "Pacific/Noumea" , 0x04F80E }, + { (char*) "Pacific/Pago_Pago" , 0x04F8E0 }, + { (char*) "Pacific/Palau" , 0x04F97E }, + { (char*) "Pacific/Pitcairn" , 0x04FA1E }, + { (char*) "Pacific/Pohnpei" , 0x04FAC3 }, + { (char*) "Pacific/Ponape" , 0x04FBB3 }, + { (char*) "Pacific/Port_Moresby" , 0x04FC45 }, + { (char*) "Pacific/Rarotonga" , 0x04FD03 }, + { (char*) "Pacific/Saipan" , 0x04FEA5 }, + { (char*) "Pacific/Samoa" , 0x050006 }, + { (char*) "Pacific/Tahiti" , 0x0500A4 }, + { (char*) "Pacific/Tarawa" , 0x050144 }, + { (char*) "Pacific/Tongatapu" , 0x0501E5 }, + { (char*) "Pacific/Truk" , 0x0502DE }, + { (char*) "Pacific/Wake" , 0x050384 }, + { (char*) "Pacific/Wallis" , 0x050421 }, + { (char*) "Pacific/Yap" , 0x0504B3 }, + { (char*) "Poland" , 0x050559 }, + { (char*) "Portugal" , 0x050900 }, + { (char*) "PRC" , 0x050EBA }, + { (char*) "PST8PDT" , 0x05104F }, + { (char*) "ROC" , 0x051412 }, + { (char*) "ROK" , 0x05161D }, + { (char*) "Singapore" , 0x0517C8 }, + { (char*) "Turkey" , 0x0518D4 }, + { (char*) "UCT" , 0x051D90 }, + { (char*) "Universal" , 0x051E0B }, + { (char*) "US/Alaska" , 0x051E86 }, + { (char*) "US/Aleutian" , 0x052263 }, + { (char*) "US/Arizona" , 0x052638 }, + { (char*) "US/Central" , 0x052734 }, + { (char*) "US/East-Indiana" , 0x052E1A }, + { (char*) "US/Eastern" , 0x053039 }, + { (char*) "US/Hawaii" , 0x053715 }, + { (char*) "US/Indiana-Starke" , 0x0537FE }, + { (char*) "US/Michigan" , 0x053C02 }, + { (char*) "US/Mountain" , 0x053F91 }, + { (char*) "US/Pacific" , 0x0543AF }, + { (char*) "US/Samoa" , 0x0548C9 }, + { (char*) "UTC" , 0x054967 }, + { (char*) "W-SU" , 0x0549E2 }, + { (char*) "WET" , 0x054D7A }, + { (char*) "Zulu" , 0x054F74 }, }; -const unsigned char timelib_timezone_db_data_builtin[348584] = { +const unsigned char timelib_timezone_db_data_builtin[348143] = { /* Africa/Abidjan */ 0x50, 0x48, 0x50, 0x32, 0x01, 0x43, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -10557,7 +10557,7 @@ const unsigned char timelib_timezone_db_data_builtin[348584] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x5A, 0x69, 0x66, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0xFF, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0xFF, 0xFF, 0xFF, 0xFF, 0x56, 0xB6, 0xC2, 0xB8, 0xFF, 0xFF, 0xFF, 0xFF, 0xA2, 0x65, 0x63, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0xA3, 0x7B, 0x82, 0x50, 0xFF, 0xFF, 0xFF, 0xFF, 0xA4, 0x4E, 0x80, 0x60, 0xFF, 0xFF, 0xFF, 0xFF, 0xA5, 0x3F, 0xB4, 0xD0, 0xFF, 0xFF, 0xFF, 0xFF, 0xA6, 0x25, 0x27, 0xE0, 0xFF, @@ -10589,44 +10589,16 @@ const unsigned char timelib_timezone_db_data_builtin[348584] = { 0x00, 0x00, 0x00, 0x30, 0x64, 0x75, 0x50, 0x00, 0x00, 0x00, 0x00, 0x31, 0x5D, 0xAE, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x32, 0x4D, 0x91, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x33, 0x3D, 0x90, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x34, 0x2D, 0x73, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x35, 0x1D, 0x72, 0xE0, 0x00, -0x00, 0x00, 0x00, 0x36, 0x0D, 0x55, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x36, 0xFD, 0x54, 0xE0, 0x00, -0x00, 0x00, 0x00, 0x38, 0x1B, 0x5C, 0x50, 0x00, 0x00, 0x00, 0x00, 0x38, 0xDD, 0x36, 0xE0, 0x00, -0x00, 0x00, 0x00, 0x39, 0xFB, 0x3E, 0x50, 0x00, 0x00, 0x00, 0x00, 0x3A, 0xBD, 0x18, 0xE0, 0x00, -0x00, 0x00, 0x00, 0x3B, 0xDB, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x3C, 0xA6, 0x35, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3D, 0xBB, 0x02, 0x50, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x86, 0x17, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3F, 0x9A, 0xE4, 0x50, 0x00, 0x00, 0x00, 0x00, 0x40, 0x65, 0xF9, 0x60, 0x00, -0x00, 0x00, 0x00, 0x41, 0x84, 0x00, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x42, 0x45, 0xDB, 0x60, 0x00, -0x00, 0x00, 0x00, 0x43, 0x63, 0xE2, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x44, 0x25, 0xBD, 0x60, 0x00, -0x00, 0x00, 0x00, 0x45, 0x43, 0xC4, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x46, 0x05, 0x9F, 0x60, 0x00, -0x00, 0x00, 0x00, 0x47, 0x23, 0xA6, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x47, 0xEE, 0xBB, 0xE0, 0x00, -0x00, 0x00, 0x00, 0x49, 0x03, 0x88, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x49, 0xCE, 0x9D, 0xE0, 0x00, -0x00, 0x00, 0x00, 0x4A, 0xE3, 0x6A, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x4B, 0xAE, 0x7F, 0xE0, 0x00, -0x00, 0x00, 0x00, 0x4C, 0xCC, 0x87, 0x50, 0x00, 0x00, 0x00, 0x00, 0x4D, 0x8E, 0x61, 0xE0, 0x00, -0x00, 0x00, 0x00, 0x4E, 0xAC, 0x69, 0x50, 0x00, 0x00, 0x00, 0x00, 0x4F, 0x6E, 0x43, 0xE0, 0x00, -0x00, 0x00, 0x00, 0x50, 0x8C, 0x4B, 0x50, 0x00, 0x00, 0x00, 0x00, 0x51, 0x57, 0x60, 0x60, 0x00, -0x00, 0x00, 0x00, 0x52, 0x6C, 0x2D, 0x50, 0x00, 0x00, 0x00, 0x00, 0x53, 0x37, 0x42, 0x60, 0x00, -0x00, 0x00, 0x00, 0x54, 0x4C, 0x0F, 0x50, 0x00, 0x00, 0x00, 0x00, 0x55, 0x17, 0x24, 0x60, 0x00, -0x00, 0x00, 0x00, 0x56, 0x2B, 0xF1, 0x50, 0x00, 0x00, 0x00, 0x00, 0x56, 0xF7, 0x06, 0x60, 0x00, -0x00, 0x00, 0x00, 0x58, 0x15, 0x0D, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x58, 0xD6, 0xE8, 0x60, 0x00, -0x00, 0x00, 0x00, 0x59, 0xF4, 0xEF, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x5A, 0xB6, 0xCA, 0x60, 0x00, -0x00, 0x00, 0x00, 0x5B, 0xD4, 0xD1, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x5C, 0x9F, 0xE6, 0xE0, 0x00, -0x00, 0x00, 0x00, 0x5D, 0xB4, 0xB3, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x5E, 0x7F, 0xC8, 0xE0, 0x00, -0x00, 0x00, 0x00, 0x5F, 0x94, 0x95, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x60, 0x5F, 0xAA, 0xE0, 0x00, -0x00, 0x00, 0x00, 0x61, 0x7D, 0xB2, 0x50, 0x00, 0x00, 0x00, 0x00, 0x62, 0x3F, 0x8C, 0xE0, 0x00, -0x00, 0x00, 0x00, 0x63, 0x5D, 0x94, 0x50, 0x00, 0x00, 0x00, 0x00, 0x64, 0x41, 0xB5, 0xE0, 0x00, -0x00, 0x00, 0x00, 0x65, 0x3D, 0x76, 0x50, 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, 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, 0x21, 0x48, 0x00, 0x00, 0x00, 0x00, -0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x45, -0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x0A, 0x45, 0x45, 0x54, 0x2D, 0x32, 0x45, 0x45, 0x53, -0x54, 0x2C, 0x4D, 0x33, 0x2E, 0x35, 0x2E, 0x30, 0x2F, 0x30, 0x2C, 0x4D, 0x31, 0x30, 0x2E, 0x35, -0x2E, 0x30, 0x2F, 0x30, 0x0A, 0x00, 0xBD, 0x07, 0xED, 0x01, 0x48, 0xD3, 0xB0, 0x00, 0x00, 0x00, -0x00, +0x00, 0x00, 0x00, 0x36, 0x0D, 0x55, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x36, 0xFD, 0x54, 0xE0, 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, 0x00, +0x00, 0x21, 0x48, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, +0x09, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x0A, 0x45, +0x45, 0x54, 0x2D, 0x32, 0x45, 0x45, 0x53, 0x54, 0x2C, 0x4D, 0x33, 0x2E, 0x35, 0x2E, 0x30, 0x2F, +0x30, 0x2C, 0x4D, 0x31, 0x30, 0x2E, 0x35, 0x2E, 0x30, 0x2F, 0x30, 0x0A, 0x00, 0xBD, 0x07, 0xED, +0x01, 0x48, 0xD3, 0xB0, 0x00, 0x00, 0x00, 0x00, /* Asia/Bishkek */ 0x50, 0x48, 0x50, 0x32, 0x01, 0x4B, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -42868,7 +42840,7 @@ const unsigned char timelib_timezone_db_data_builtin[703933] = { 0x56, 0xF7, 0x06, 0x60, 0x58, 0x15, 0x0D, 0xD0, 0x58, 0xD6, 0xE8, 0x60, 0x59, 0xF4, 0xEF, 0xD0, 0x5A, 0xB6, 0xCA, 0x60, 0x5B, 0xD4, 0xD1, 0xD0, 0x5C, 0x9F, 0xE6, 0xE0, 0x5D, 0xB4, 0xB3, 0xD0, 0x5E, 0x7F, 0xC8, 0xE0, 0x5F, 0x94, 0x95, 0xD0, 0x60, 0x5F, 0xAA, 0xE0, 0x61, 0x7D, 0xB2, 0x50, -0x62, 0x3F, 0x8C, 0xE0, 0x63, 0x5D, 0x94, 0x50, 0x64, 0x41, 0xB5, 0xE0, 0x65, 0x3D, 0x76, 0x50, +0x62, 0x3F, 0x8C, 0xE0, 0x63, 0x5D, 0x94, 0x50, 0x64, 0x1F, 0x6E, 0xE0, 0x65, 0x3D, 0x76, 0x50, 0x66, 0x08, 0x8B, 0x60, 0x67, 0x1D, 0x58, 0x50, 0x67, 0xE8, 0x6D, 0x60, 0x68, 0xFD, 0x3A, 0x50, 0x69, 0xC8, 0x4F, 0x60, 0x6A, 0xDD, 0x1C, 0x50, 0x6B, 0xA8, 0x31, 0x60, 0x6C, 0xC6, 0x38, 0xD0, 0x6D, 0x88, 0x13, 0x60, 0x6E, 0xA6, 0x1A, 0xD0, 0x6F, 0x67, 0xF5, 0x60, 0x70, 0x85, 0xFC, 0xD0, @@ -42945,7 +42917,7 @@ const unsigned char timelib_timezone_db_data_builtin[703933] = { 0x00, 0x00, 0x00, 0x00, 0x5E, 0x7F, 0xC8, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x94, 0x95, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x60, 0x5F, 0xAA, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x61, 0x7D, 0xB2, 0x50, 0x00, 0x00, 0x00, 0x00, 0x62, 0x3F, 0x8C, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x63, 0x5D, 0x94, 0x50, -0x00, 0x00, 0x00, 0x00, 0x64, 0x41, 0xB5, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x65, 0x3D, 0x76, 0x50, +0x00, 0x00, 0x00, 0x00, 0x64, 0x1F, 0x6E, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x65, 0x3D, 0x76, 0x50, 0x00, 0x00, 0x00, 0x00, 0x66, 0x08, 0x8B, 0x60, 0x00, 0x00, 0x00, 0x00, 0x67, 0x1D, 0x58, 0x50, 0x00, 0x00, 0x00, 0x00, 0x67, 0xE8, 0x6D, 0x60, 0x00, 0x00, 0x00, 0x00, 0x68, 0xFD, 0x3A, 0x50, 0x00, 0x00, 0x00, 0x00, 0x69, 0xC8, 0x4F, 0x60, 0x00, 0x00, 0x00, 0x00, 0x6A, 0xDD, 0x1C, 0x50, @@ -70027,4 +69999,4 @@ const unsigned char timelib_timezone_db_data_builtin[703933] = { }; #endif -const timelib_tzdb timezonedb_builtin = { "2023.2", 597, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; +const timelib_tzdb timezonedb_builtin = { "2023.3", 597, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; From 3ec02202fd88a81c7e222a4bffec23ea7547e275 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Wed, 29 Mar 2023 10:06:01 +0100 Subject: [PATCH 03/51] Updated to version 2023.3 (2023c) --- ext/date/lib/timezonedb.h | 752 ++++++++++++++++++-------------------- 1 file changed, 362 insertions(+), 390 deletions(-) diff --git a/ext/date/lib/timezonedb.h b/ext/date/lib/timezonedb.h index 89c62a6d4926d..94397084d7bb2 100644 --- a/ext/date/lib/timezonedb.h +++ b/ext/date/lib/timezonedb.h @@ -255,357 +255,357 @@ const timelib_tzdb_index_entry timezonedb_idx_builtin[597] = { { (char*) "Asia/Bangkok" , 0x02427E }, { (char*) "Asia/Barnaul" , 0x024322 }, { (char*) "Asia/Beirut" , 0x02462D }, - { (char*) "Asia/Bishkek" , 0x024ACE }, - { (char*) "Asia/Brunei" , 0x024D44 }, - { (char*) "Asia/Calcutta" , 0x024DEA }, - { (char*) "Asia/Chita" , 0x024ED2 }, - { (char*) "Asia/Choibalsan" , 0x0251E0 }, - { (char*) "Asia/Chongqing" , 0x025469 }, - { (char*) "Asia/Chungking" , 0x0255FE }, - { (char*) "Asia/Colombo" , 0x025793 }, - { (char*) "Asia/Dacca" , 0x025896 }, - { (char*) "Asia/Damascus" , 0x025989 }, - { (char*) "Asia/Dhaka" , 0x025E67 }, - { (char*) "Asia/Dili" , 0x025F5A }, - { (char*) "Asia/Dubai" , 0x026010 }, - { (char*) "Asia/Dushanbe" , 0x0260A1 }, - { (char*) "Asia/Famagusta" , 0x02621B }, - { (char*) "Asia/Gaza" , 0x0265E2 }, - { (char*) "Asia/Harbin" , 0x026FCE }, - { (char*) "Asia/Hebron" , 0x027163 }, - { (char*) "Asia/Ho_Chi_Minh" , 0x027B60 }, - { (char*) "Asia/Hong_Kong" , 0x027C58 }, - { (char*) "Asia/Hovd" , 0x027F6B }, - { (char*) "Asia/Irkutsk" , 0x0281F4 }, - { (char*) "Asia/Istanbul" , 0x028512 }, - { (char*) "Asia/Jakarta" , 0x0289CE }, - { (char*) "Asia/Jayapura" , 0x028ADF }, - { (char*) "Asia/Jerusalem" , 0x028BCC }, - { (char*) "Asia/Kabul" , 0x02900A }, - { (char*) "Asia/Kamchatka" , 0x0290B5 }, - { (char*) "Asia/Karachi" , 0x0293AA }, - { (char*) "Asia/Kashgar" , 0x0294C0 }, - { (char*) "Asia/Kathmandu" , 0x029551 }, - { (char*) "Asia/Katmandu" , 0x0295FE }, - { (char*) "Asia/Khandyga" , 0x0296AB }, - { (char*) "Asia/Kolkata" , 0x0299DC }, - { (char*) "Asia/Krasnoyarsk" , 0x029AC4 }, - { (char*) "Asia/Kuala_Lumpur" , 0x029DCE }, - { (char*) "Asia/Kuching" , 0x029EEE }, - { (char*) "Asia/Kuwait" , 0x02A048 }, - { (char*) "Asia/Macao" , 0x02A0D9 }, - { (char*) "Asia/Macau" , 0x02A3FC }, - { (char*) "Asia/Magadan" , 0x02A71F }, - { (char*) "Asia/Makassar" , 0x02AA2A }, - { (char*) "Asia/Manila" , 0x02AB3D }, - { (char*) "Asia/Muscat" , 0x02AC37 }, - { (char*) "Asia/Nicosia" , 0x02ACC8 }, - { (char*) "Asia/Novokuznetsk" , 0x02AF37 }, - { (char*) "Asia/Novosibirsk" , 0x02B22A }, - { (char*) "Asia/Omsk" , 0x02B53B }, - { (char*) "Asia/Oral" , 0x02B839 }, - { (char*) "Asia/Phnom_Penh" , 0x02BAC5 }, - { (char*) "Asia/Pontianak" , 0x02BB99 }, - { (char*) "Asia/Pyongyang" , 0x02BCB2 }, - { (char*) "Asia/Qatar" , 0x02BD75 }, - { (char*) "Asia/Qostanay" , 0x02BE19 }, - { (char*) "Asia/Qyzylorda" , 0x02C0A6 }, - { (char*) "Asia/Rangoon" , 0x02C33F }, - { (char*) "Asia/Riyadh" , 0x02C406 }, - { (char*) "Asia/Saigon" , 0x02C497 }, - { (char*) "Asia/Sakhalin" , 0x02C58F }, - { (char*) "Asia/Samarkand" , 0x02C8A6 }, - { (char*) "Asia/Seoul" , 0x02CA31 }, - { (char*) "Asia/Shanghai" , 0x02CBDC }, - { (char*) "Asia/Singapore" , 0x02CD7D }, - { (char*) "Asia/Srednekolymsk" , 0x02CE89 }, - { (char*) "Asia/Taipei" , 0x02D199 }, - { (char*) "Asia/Tashkent" , 0x02D3A4 }, - { (char*) "Asia/Tbilisi" , 0x02D52F }, - { (char*) "Asia/Tehran" , 0x02D7B0 }, - { (char*) "Asia/Tel_Aviv" , 0x02DAE8 }, - { (char*) "Asia/Thimbu" , 0x02DF26 }, - { (char*) "Asia/Thimphu" , 0x02DFCC }, - { (char*) "Asia/Tokyo" , 0x02E072 }, - { (char*) "Asia/Tomsk" , 0x02E153 }, - { (char*) "Asia/Ujung_Pandang" , 0x02E45E }, - { (char*) "Asia/Ulaanbaatar" , 0x02E528 }, - { (char*) "Asia/Ulan_Bator" , 0x02E796 }, - { (char*) "Asia/Urumqi" , 0x02E9F4 }, - { (char*) "Asia/Ust-Nera" , 0x02EA92 }, - { (char*) "Asia/Vientiane" , 0x02EDB5 }, - { (char*) "Asia/Vladivostok" , 0x02EE9B }, - { (char*) "Asia/Yakutsk" , 0x02F1A0 }, - { (char*) "Asia/Yangon" , 0x02F4A4 }, - { (char*) "Asia/Yekaterinburg" , 0x02F56B }, - { (char*) "Asia/Yerevan" , 0x02F87D }, - { (char*) "Atlantic/Azores" , 0x02FB4D }, - { (char*) "Atlantic/Bermuda" , 0x03010C }, - { (char*) "Atlantic/Canary" , 0x030518 }, - { (char*) "Atlantic/Cape_Verde" , 0x030710 }, - { (char*) "Atlantic/Faeroe" , 0x0307CB }, - { (char*) "Atlantic/Faroe" , 0x030990 }, - { (char*) "Atlantic/Jan_Mayen" , 0x030B55 }, - { (char*) "Atlantic/Madeira" , 0x030E22 }, - { (char*) "Atlantic/Reykjavik" , 0x0313EA }, - { (char*) "Atlantic/South_Georgia" , 0x0316E7 }, - { (char*) "Atlantic/St_Helena" , 0x031777 }, - { (char*) "Atlantic/Stanley" , 0x031818 }, - { (char*) "Australia/ACT" , 0x031B39 }, - { (char*) "Australia/Adelaide" , 0x031ECD }, - { (char*) "Australia/Brisbane" , 0x032281 }, - { (char*) "Australia/Broken_Hill" , 0x0323C5 }, - { (char*) "Australia/Canberra" , 0x03279A }, - { (char*) "Australia/Currie" , 0x032B2E }, - { (char*) "Australia/Darwin" , 0x032F25 }, - { (char*) "Australia/Eucla" , 0x03302D }, - { (char*) "Australia/Hobart" , 0x03318C }, - { (char*) "Australia/LHI" , 0x03358B }, - { (char*) "Australia/Lindeman" , 0x03384B }, - { (char*) "Australia/Lord_Howe" , 0x0339BB }, - { (char*) "Australia/Melbourne" , 0x033C8B }, - { (char*) "Australia/North" , 0x034027 }, - { (char*) "Australia/NSW" , 0x03411D }, - { (char*) "Australia/Perth" , 0x0344B1 }, - { (char*) "Australia/Queensland" , 0x03460D }, - { (char*) "Australia/South" , 0x03473A }, - { (char*) "Australia/Sydney" , 0x034ADF }, - { (char*) "Australia/Tasmania" , 0x034E8F }, - { (char*) "Australia/Victoria" , 0x035286 }, - { (char*) "Australia/West" , 0x03561A }, - { (char*) "Australia/Yancowinna" , 0x035758 }, - { (char*) "Brazil/Acre" , 0x035B11 }, - { (char*) "Brazil/DeNoronha" , 0x035CBF }, - { (char*) "Brazil/East" , 0x035EAF }, - { (char*) "Brazil/West" , 0x036273 }, - { (char*) "Canada/Atlantic" , 0x03641B }, - { (char*) "Canada/Central" , 0x036AAF }, - { (char*) "Canada/Eastern" , 0x036FC9 }, - { (char*) "Canada/Mountain" , 0x03768A }, - { (char*) "Canada/Newfoundland" , 0x037A60 }, - { (char*) "Canada/Pacific" , 0x0381C2 }, - { (char*) "Canada/Saskatchewan" , 0x038700 }, - { (char*) "Canada/Yukon" , 0x03898A }, - { (char*) "CET" , 0x038D9B }, - { (char*) "Chile/Continental" , 0x039014 }, - { (char*) "Chile/EasterIsland" , 0x03956A }, - { (char*) "CST6CDT" , 0x039A0C }, - { (char*) "Cuba" , 0x039DCF }, - { (char*) "EET" , 0x03A238 }, - { (char*) "Egypt" , 0x03A435 }, - { (char*) "Eire" , 0x03A95E }, - { (char*) "EST" , 0x03AF42 }, - { (char*) "EST5EDT" , 0x03AFBD }, - { (char*) "Etc/GMT" , 0x03B380 }, - { (char*) "Etc/GMT+0" , 0x03B3FB }, - { (char*) "Etc/GMT+1" , 0x03B476 }, - { (char*) "Etc/GMT+10" , 0x03B4F3 }, - { (char*) "Etc/GMT+11" , 0x03B571 }, - { (char*) "Etc/GMT+12" , 0x03B5EF }, - { (char*) "Etc/GMT+2" , 0x03B66D }, - { (char*) "Etc/GMT+3" , 0x03B6EA }, - { (char*) "Etc/GMT+4" , 0x03B767 }, - { (char*) "Etc/GMT+5" , 0x03B7E4 }, - { (char*) "Etc/GMT+6" , 0x03B861 }, - { (char*) "Etc/GMT+7" , 0x03B8DE }, - { (char*) "Etc/GMT+8" , 0x03B95B }, - { (char*) "Etc/GMT+9" , 0x03B9D8 }, - { (char*) "Etc/GMT-0" , 0x03BA55 }, - { (char*) "Etc/GMT-1" , 0x03BAD0 }, - { (char*) "Etc/GMT-10" , 0x03BB4E }, - { (char*) "Etc/GMT-11" , 0x03BBCD }, - { (char*) "Etc/GMT-12" , 0x03BC4C }, - { (char*) "Etc/GMT-13" , 0x03BCCB }, - { (char*) "Etc/GMT-14" , 0x03BD4A }, - { (char*) "Etc/GMT-2" , 0x03BDC9 }, - { (char*) "Etc/GMT-3" , 0x03BE47 }, - { (char*) "Etc/GMT-4" , 0x03BEC5 }, - { (char*) "Etc/GMT-5" , 0x03BF43 }, - { (char*) "Etc/GMT-6" , 0x03BFC1 }, - { (char*) "Etc/GMT-7" , 0x03C03F }, - { (char*) "Etc/GMT-8" , 0x03C0BD }, - { (char*) "Etc/GMT-9" , 0x03C13B }, - { (char*) "Etc/GMT0" , 0x03C1B9 }, - { (char*) "Etc/Greenwich" , 0x03C234 }, - { (char*) "Etc/UCT" , 0x03C2AF }, - { (char*) "Etc/Universal" , 0x03C32A }, - { (char*) "Etc/UTC" , 0x03C3A5 }, - { (char*) "Etc/Zulu" , 0x03C420 }, - { (char*) "Europe/Amsterdam" , 0x03C49B }, - { (char*) "Europe/Andorra" , 0x03C8D6 }, - { (char*) "Europe/Astrakhan" , 0x03CA67 }, - { (char*) "Europe/Athens" , 0x03CD5B }, - { (char*) "Europe/Belfast" , 0x03D011 }, - { (char*) "Europe/Belgrade" , 0x03D65C }, - { (char*) "Europe/Berlin" , 0x03D846 }, - { (char*) "Europe/Bratislava" , 0x03DB22 }, - { (char*) "Europe/Brussels" , 0x03DE01 }, - { (char*) "Europe/Bucharest" , 0x03E25C }, - { (char*) "Europe/Budapest" , 0x03E4FD }, - { (char*) "Europe/Busingen" , 0x03E807 }, - { (char*) "Europe/Chisinau" , 0x03EA0C }, - { (char*) "Europe/Copenhagen" , 0x03ED0B }, - { (char*) "Europe/Dublin" , 0x03EF86 }, - { (char*) "Europe/Gibraltar" , 0x03F56A }, - { (char*) "Europe/Guernsey" , 0x03FA3A }, - { (char*) "Europe/Helsinki" , 0x040091 }, - { (char*) "Europe/Isle_of_Man" , 0x04027E }, - { (char*) "Europe/Istanbul" , 0x0408C9 }, - { (char*) "Europe/Jersey" , 0x040D85 }, - { (char*) "Europe/Kaliningrad" , 0x0413DC }, - { (char*) "Europe/Kiev" , 0x041784 }, - { (char*) "Europe/Kirov" , 0x0419BE }, - { (char*) "Europe/Kyiv" , 0x041CB7 }, - { (char*) "Europe/Lisbon" , 0x041F00 }, - { (char*) "Europe/Ljubljana" , 0x0424CD }, - { (char*) "Europe/London" , 0x0426B7 }, - { (char*) "Europe/Luxembourg" , 0x042D02 }, - { (char*) "Europe/Madrid" , 0x04314D }, - { (char*) "Europe/Malta" , 0x0434EA }, - { (char*) "Europe/Mariehamn" , 0x043896 }, - { (char*) "Europe/Minsk" , 0x043A83 }, - { (char*) "Europe/Monaco" , 0x043DB7 }, - { (char*) "Europe/Moscow" , 0x04421D }, - { (char*) "Europe/Nicosia" , 0x0445C9 }, - { (char*) "Europe/Oslo" , 0x04482A }, - { (char*) "Europe/Paris" , 0x044ADA }, - { (char*) "Europe/Podgorica" , 0x044F37 }, - { (char*) "Europe/Prague" , 0x045121 }, - { (char*) "Europe/Riga" , 0x045400 }, - { (char*) "Europe/Rome" , 0x0456C2 }, - { (char*) "Europe/Samara" , 0x045A81 }, - { (char*) "Europe/San_Marino" , 0x045D82 }, - { (char*) "Europe/Sarajevo" , 0x046141 }, - { (char*) "Europe/Saratov" , 0x04632B }, - { (char*) "Europe/Simferopol" , 0x04661D }, - { (char*) "Europe/Skopje" , 0x046990 }, - { (char*) "Europe/Sofia" , 0x046B7A }, - { (char*) "Europe/Stockholm" , 0x046DD6 }, - { (char*) "Europe/Tallinn" , 0x046FD3 }, - { (char*) "Europe/Tirane" , 0x047282 }, - { (char*) "Europe/Tiraspol" , 0x0474EA }, - { (char*) "Europe/Ulyanovsk" , 0x0477E9 }, - { (char*) "Europe/Uzhgorod" , 0x047AFF }, - { (char*) "Europe/Vaduz" , 0x047D39 }, - { (char*) "Europe/Vatican" , 0x047F23 }, - { (char*) "Europe/Vienna" , 0x0482E2 }, - { (char*) "Europe/Vilnius" , 0x048580 }, - { (char*) "Europe/Volgograd" , 0x048830 }, - { (char*) "Europe/Warsaw" , 0x048B3F }, - { (char*) "Europe/Zagreb" , 0x048EE6 }, - { (char*) "Europe/Zaporozhye" , 0x0490D0 }, - { (char*) "Europe/Zurich" , 0x04930A }, - { (char*) "Factory" , 0x049507 }, - { (char*) "GB" , 0x049584 }, - { (char*) "GB-Eire" , 0x049BCF }, - { (char*) "GMT" , 0x04A21A }, - { (char*) "GMT+0" , 0x04A295 }, - { (char*) "GMT-0" , 0x04A310 }, - { (char*) "GMT0" , 0x04A38B }, - { (char*) "Greenwich" , 0x04A406 }, - { (char*) "Hongkong" , 0x04A481 }, - { (char*) "HST" , 0x04A794 }, - { (char*) "Iceland" , 0x04A810 }, - { (char*) "Indian/Antananarivo" , 0x04A89E }, - { (char*) "Indian/Chagos" , 0x04A94A }, - { (char*) "Indian/Christmas" , 0x04A9EE }, - { (char*) "Indian/Cocos" , 0x04AA7F }, - { (char*) "Indian/Comoro" , 0x04AB17 }, - { (char*) "Indian/Kerguelen" , 0x04ABA6 }, - { (char*) "Indian/Mahe" , 0x04AC37 }, - { (char*) "Indian/Maldives" , 0x04ACC8 }, - { (char*) "Indian/Mauritius" , 0x04AD6C }, - { (char*) "Indian/Mayotte" , 0x04AE2B }, - { (char*) "Indian/Reunion" , 0x04AEBA }, - { (char*) "Iran" , 0x04AF4B }, - { (char*) "Israel" , 0x04B283 }, - { (char*) "Jamaica" , 0x04B6C1 }, - { (char*) "Japan" , 0x04B820 }, - { (char*) "Kwajalein" , 0x04B901 }, - { (char*) "Libya" , 0x04B9E8 }, - { (char*) "MET" , 0x04BBA3 }, - { (char*) "Mexico/BajaNorte" , 0x04BE1C }, - { (char*) "Mexico/BajaSur" , 0x04C229 }, - { (char*) "Mexico/General" , 0x04C503 }, - { (char*) "MST" , 0x04C814 }, - { (char*) "MST7MDT" , 0x04C88F }, - { (char*) "Navajo" , 0x04CC52 }, - { (char*) "NZ" , 0x04D070 }, - { (char*) "NZ-CHAT" , 0x04D48F }, - { (char*) "Pacific/Apia" , 0x04D7C3 }, - { (char*) "Pacific/Auckland" , 0x04D966 }, - { (char*) "Pacific/Bougainville" , 0x04DD98 }, - { (char*) "Pacific/Chatham" , 0x04DE79 }, - { (char*) "Pacific/Chuuk" , 0x04E1BC }, - { (char*) "Pacific/Easter" , 0x04E29A }, - { (char*) "Pacific/Efate" , 0x04E749 }, - { (char*) "Pacific/Enderbury" , 0x04E8AB }, - { (char*) "Pacific/Fakaofo" , 0x04E963 }, - { (char*) "Pacific/Fiji" , 0x04EA08 }, - { (char*) "Pacific/Funafuti" , 0x04EBA0 }, - { (char*) "Pacific/Galapagos" , 0x04EC32 }, - { (char*) "Pacific/Gambier" , 0x04ECFE }, - { (char*) "Pacific/Guadalcanal" , 0x04ED9D }, - { (char*) "Pacific/Guam" , 0x04EE2F }, - { (char*) "Pacific/Honolulu" , 0x04EF99 }, - { (char*) "Pacific/Johnston" , 0x04F088 }, - { (char*) "Pacific/Kanton" , 0x04F171 }, - { (char*) "Pacific/Kiritimati" , 0x04F238 }, - { (char*) "Pacific/Kosrae" , 0x04F2FE }, - { (char*) "Pacific/Kwajalein" , 0x04F402 }, - { (char*) "Pacific/Majuro" , 0x04F4F2 }, - { (char*) "Pacific/Marquesas" , 0x04F5F0 }, - { (char*) "Pacific/Midway" , 0x04F698 }, - { (char*) "Pacific/Nauru" , 0x04F75B }, - { (char*) "Pacific/Niue" , 0x04F81E }, - { (char*) "Pacific/Norfolk" , 0x04F8C4 }, - { (char*) "Pacific/Noumea" , 0x04F9C7 }, - { (char*) "Pacific/Pago_Pago" , 0x04FA99 }, - { (char*) "Pacific/Palau" , 0x04FB37 }, - { (char*) "Pacific/Pitcairn" , 0x04FBD7 }, - { (char*) "Pacific/Pohnpei" , 0x04FC7C }, - { (char*) "Pacific/Ponape" , 0x04FD6C }, - { (char*) "Pacific/Port_Moresby" , 0x04FDFE }, - { (char*) "Pacific/Rarotonga" , 0x04FEBC }, - { (char*) "Pacific/Saipan" , 0x05005E }, - { (char*) "Pacific/Samoa" , 0x0501BF }, - { (char*) "Pacific/Tahiti" , 0x05025D }, - { (char*) "Pacific/Tarawa" , 0x0502FD }, - { (char*) "Pacific/Tongatapu" , 0x05039E }, - { (char*) "Pacific/Truk" , 0x050497 }, - { (char*) "Pacific/Wake" , 0x05053D }, - { (char*) "Pacific/Wallis" , 0x0505DA }, - { (char*) "Pacific/Yap" , 0x05066C }, - { (char*) "Poland" , 0x050712 }, - { (char*) "Portugal" , 0x050AB9 }, - { (char*) "PRC" , 0x051073 }, - { (char*) "PST8PDT" , 0x051208 }, - { (char*) "ROC" , 0x0515CB }, - { (char*) "ROK" , 0x0517D6 }, - { (char*) "Singapore" , 0x051981 }, - { (char*) "Turkey" , 0x051A8D }, - { (char*) "UCT" , 0x051F49 }, - { (char*) "Universal" , 0x051FC4 }, - { (char*) "US/Alaska" , 0x05203F }, - { (char*) "US/Aleutian" , 0x05241C }, - { (char*) "US/Arizona" , 0x0527F1 }, - { (char*) "US/Central" , 0x0528ED }, - { (char*) "US/East-Indiana" , 0x052FD3 }, - { (char*) "US/Eastern" , 0x0531F2 }, - { (char*) "US/Hawaii" , 0x0538CE }, - { (char*) "US/Indiana-Starke" , 0x0539B7 }, - { (char*) "US/Michigan" , 0x053DBB }, - { (char*) "US/Mountain" , 0x05414A }, - { (char*) "US/Pacific" , 0x054568 }, - { (char*) "US/Samoa" , 0x054A82 }, - { (char*) "UTC" , 0x054B20 }, - { (char*) "W-SU" , 0x054B9B }, - { (char*) "WET" , 0x054F33 }, - { (char*) "Zulu" , 0x05512D }, + { (char*) "Asia/Bishkek" , 0x024915 }, + { (char*) "Asia/Brunei" , 0x024B8B }, + { (char*) "Asia/Calcutta" , 0x024C31 }, + { (char*) "Asia/Chita" , 0x024D19 }, + { (char*) "Asia/Choibalsan" , 0x025027 }, + { (char*) "Asia/Chongqing" , 0x0252B0 }, + { (char*) "Asia/Chungking" , 0x025445 }, + { (char*) "Asia/Colombo" , 0x0255DA }, + { (char*) "Asia/Dacca" , 0x0256DD }, + { (char*) "Asia/Damascus" , 0x0257D0 }, + { (char*) "Asia/Dhaka" , 0x025CAE }, + { (char*) "Asia/Dili" , 0x025DA1 }, + { (char*) "Asia/Dubai" , 0x025E57 }, + { (char*) "Asia/Dushanbe" , 0x025EE8 }, + { (char*) "Asia/Famagusta" , 0x026062 }, + { (char*) "Asia/Gaza" , 0x026429 }, + { (char*) "Asia/Harbin" , 0x026E15 }, + { (char*) "Asia/Hebron" , 0x026FAA }, + { (char*) "Asia/Ho_Chi_Minh" , 0x0279A7 }, + { (char*) "Asia/Hong_Kong" , 0x027A9F }, + { (char*) "Asia/Hovd" , 0x027DB2 }, + { (char*) "Asia/Irkutsk" , 0x02803B }, + { (char*) "Asia/Istanbul" , 0x028359 }, + { (char*) "Asia/Jakarta" , 0x028815 }, + { (char*) "Asia/Jayapura" , 0x028926 }, + { (char*) "Asia/Jerusalem" , 0x028A13 }, + { (char*) "Asia/Kabul" , 0x028E51 }, + { (char*) "Asia/Kamchatka" , 0x028EFC }, + { (char*) "Asia/Karachi" , 0x0291F1 }, + { (char*) "Asia/Kashgar" , 0x029307 }, + { (char*) "Asia/Kathmandu" , 0x029398 }, + { (char*) "Asia/Katmandu" , 0x029445 }, + { (char*) "Asia/Khandyga" , 0x0294F2 }, + { (char*) "Asia/Kolkata" , 0x029823 }, + { (char*) "Asia/Krasnoyarsk" , 0x02990B }, + { (char*) "Asia/Kuala_Lumpur" , 0x029C15 }, + { (char*) "Asia/Kuching" , 0x029D35 }, + { (char*) "Asia/Kuwait" , 0x029E8F }, + { (char*) "Asia/Macao" , 0x029F20 }, + { (char*) "Asia/Macau" , 0x02A243 }, + { (char*) "Asia/Magadan" , 0x02A566 }, + { (char*) "Asia/Makassar" , 0x02A871 }, + { (char*) "Asia/Manila" , 0x02A984 }, + { (char*) "Asia/Muscat" , 0x02AA7E }, + { (char*) "Asia/Nicosia" , 0x02AB0F }, + { (char*) "Asia/Novokuznetsk" , 0x02AD7E }, + { (char*) "Asia/Novosibirsk" , 0x02B071 }, + { (char*) "Asia/Omsk" , 0x02B382 }, + { (char*) "Asia/Oral" , 0x02B680 }, + { (char*) "Asia/Phnom_Penh" , 0x02B90C }, + { (char*) "Asia/Pontianak" , 0x02B9E0 }, + { (char*) "Asia/Pyongyang" , 0x02BAF9 }, + { (char*) "Asia/Qatar" , 0x02BBBC }, + { (char*) "Asia/Qostanay" , 0x02BC60 }, + { (char*) "Asia/Qyzylorda" , 0x02BEED }, + { (char*) "Asia/Rangoon" , 0x02C186 }, + { (char*) "Asia/Riyadh" , 0x02C24D }, + { (char*) "Asia/Saigon" , 0x02C2DE }, + { (char*) "Asia/Sakhalin" , 0x02C3D6 }, + { (char*) "Asia/Samarkand" , 0x02C6ED }, + { (char*) "Asia/Seoul" , 0x02C878 }, + { (char*) "Asia/Shanghai" , 0x02CA23 }, + { (char*) "Asia/Singapore" , 0x02CBC4 }, + { (char*) "Asia/Srednekolymsk" , 0x02CCD0 }, + { (char*) "Asia/Taipei" , 0x02CFE0 }, + { (char*) "Asia/Tashkent" , 0x02D1EB }, + { (char*) "Asia/Tbilisi" , 0x02D376 }, + { (char*) "Asia/Tehran" , 0x02D5F7 }, + { (char*) "Asia/Tel_Aviv" , 0x02D92F }, + { (char*) "Asia/Thimbu" , 0x02DD6D }, + { (char*) "Asia/Thimphu" , 0x02DE13 }, + { (char*) "Asia/Tokyo" , 0x02DEB9 }, + { (char*) "Asia/Tomsk" , 0x02DF9A }, + { (char*) "Asia/Ujung_Pandang" , 0x02E2A5 }, + { (char*) "Asia/Ulaanbaatar" , 0x02E36F }, + { (char*) "Asia/Ulan_Bator" , 0x02E5DD }, + { (char*) "Asia/Urumqi" , 0x02E83B }, + { (char*) "Asia/Ust-Nera" , 0x02E8D9 }, + { (char*) "Asia/Vientiane" , 0x02EBFC }, + { (char*) "Asia/Vladivostok" , 0x02ECE2 }, + { (char*) "Asia/Yakutsk" , 0x02EFE7 }, + { (char*) "Asia/Yangon" , 0x02F2EB }, + { (char*) "Asia/Yekaterinburg" , 0x02F3B2 }, + { (char*) "Asia/Yerevan" , 0x02F6C4 }, + { (char*) "Atlantic/Azores" , 0x02F994 }, + { (char*) "Atlantic/Bermuda" , 0x02FF53 }, + { (char*) "Atlantic/Canary" , 0x03035F }, + { (char*) "Atlantic/Cape_Verde" , 0x030557 }, + { (char*) "Atlantic/Faeroe" , 0x030612 }, + { (char*) "Atlantic/Faroe" , 0x0307D7 }, + { (char*) "Atlantic/Jan_Mayen" , 0x03099C }, + { (char*) "Atlantic/Madeira" , 0x030C69 }, + { (char*) "Atlantic/Reykjavik" , 0x031231 }, + { (char*) "Atlantic/South_Georgia" , 0x03152E }, + { (char*) "Atlantic/St_Helena" , 0x0315BE }, + { (char*) "Atlantic/Stanley" , 0x03165F }, + { (char*) "Australia/ACT" , 0x031980 }, + { (char*) "Australia/Adelaide" , 0x031D14 }, + { (char*) "Australia/Brisbane" , 0x0320C8 }, + { (char*) "Australia/Broken_Hill" , 0x03220C }, + { (char*) "Australia/Canberra" , 0x0325E1 }, + { (char*) "Australia/Currie" , 0x032975 }, + { (char*) "Australia/Darwin" , 0x032D6C }, + { (char*) "Australia/Eucla" , 0x032E74 }, + { (char*) "Australia/Hobart" , 0x032FD3 }, + { (char*) "Australia/LHI" , 0x0333D2 }, + { (char*) "Australia/Lindeman" , 0x033692 }, + { (char*) "Australia/Lord_Howe" , 0x033802 }, + { (char*) "Australia/Melbourne" , 0x033AD2 }, + { (char*) "Australia/North" , 0x033E6E }, + { (char*) "Australia/NSW" , 0x033F64 }, + { (char*) "Australia/Perth" , 0x0342F8 }, + { (char*) "Australia/Queensland" , 0x034454 }, + { (char*) "Australia/South" , 0x034581 }, + { (char*) "Australia/Sydney" , 0x034926 }, + { (char*) "Australia/Tasmania" , 0x034CD6 }, + { (char*) "Australia/Victoria" , 0x0350CD }, + { (char*) "Australia/West" , 0x035461 }, + { (char*) "Australia/Yancowinna" , 0x03559F }, + { (char*) "Brazil/Acre" , 0x035958 }, + { (char*) "Brazil/DeNoronha" , 0x035B06 }, + { (char*) "Brazil/East" , 0x035CF6 }, + { (char*) "Brazil/West" , 0x0360BA }, + { (char*) "Canada/Atlantic" , 0x036262 }, + { (char*) "Canada/Central" , 0x0368F6 }, + { (char*) "Canada/Eastern" , 0x036E10 }, + { (char*) "Canada/Mountain" , 0x0374D1 }, + { (char*) "Canada/Newfoundland" , 0x0378A7 }, + { (char*) "Canada/Pacific" , 0x038009 }, + { (char*) "Canada/Saskatchewan" , 0x038547 }, + { (char*) "Canada/Yukon" , 0x0387D1 }, + { (char*) "CET" , 0x038BE2 }, + { (char*) "Chile/Continental" , 0x038E5B }, + { (char*) "Chile/EasterIsland" , 0x0393B1 }, + { (char*) "CST6CDT" , 0x039853 }, + { (char*) "Cuba" , 0x039C16 }, + { (char*) "EET" , 0x03A07F }, + { (char*) "Egypt" , 0x03A27C }, + { (char*) "Eire" , 0x03A7A5 }, + { (char*) "EST" , 0x03AD89 }, + { (char*) "EST5EDT" , 0x03AE04 }, + { (char*) "Etc/GMT" , 0x03B1C7 }, + { (char*) "Etc/GMT+0" , 0x03B242 }, + { (char*) "Etc/GMT+1" , 0x03B2BD }, + { (char*) "Etc/GMT+10" , 0x03B33A }, + { (char*) "Etc/GMT+11" , 0x03B3B8 }, + { (char*) "Etc/GMT+12" , 0x03B436 }, + { (char*) "Etc/GMT+2" , 0x03B4B4 }, + { (char*) "Etc/GMT+3" , 0x03B531 }, + { (char*) "Etc/GMT+4" , 0x03B5AE }, + { (char*) "Etc/GMT+5" , 0x03B62B }, + { (char*) "Etc/GMT+6" , 0x03B6A8 }, + { (char*) "Etc/GMT+7" , 0x03B725 }, + { (char*) "Etc/GMT+8" , 0x03B7A2 }, + { (char*) "Etc/GMT+9" , 0x03B81F }, + { (char*) "Etc/GMT-0" , 0x03B89C }, + { (char*) "Etc/GMT-1" , 0x03B917 }, + { (char*) "Etc/GMT-10" , 0x03B995 }, + { (char*) "Etc/GMT-11" , 0x03BA14 }, + { (char*) "Etc/GMT-12" , 0x03BA93 }, + { (char*) "Etc/GMT-13" , 0x03BB12 }, + { (char*) "Etc/GMT-14" , 0x03BB91 }, + { (char*) "Etc/GMT-2" , 0x03BC10 }, + { (char*) "Etc/GMT-3" , 0x03BC8E }, + { (char*) "Etc/GMT-4" , 0x03BD0C }, + { (char*) "Etc/GMT-5" , 0x03BD8A }, + { (char*) "Etc/GMT-6" , 0x03BE08 }, + { (char*) "Etc/GMT-7" , 0x03BE86 }, + { (char*) "Etc/GMT-8" , 0x03BF04 }, + { (char*) "Etc/GMT-9" , 0x03BF82 }, + { (char*) "Etc/GMT0" , 0x03C000 }, + { (char*) "Etc/Greenwich" , 0x03C07B }, + { (char*) "Etc/UCT" , 0x03C0F6 }, + { (char*) "Etc/Universal" , 0x03C171 }, + { (char*) "Etc/UTC" , 0x03C1EC }, + { (char*) "Etc/Zulu" , 0x03C267 }, + { (char*) "Europe/Amsterdam" , 0x03C2E2 }, + { (char*) "Europe/Andorra" , 0x03C71D }, + { (char*) "Europe/Astrakhan" , 0x03C8AE }, + { (char*) "Europe/Athens" , 0x03CBA2 }, + { (char*) "Europe/Belfast" , 0x03CE58 }, + { (char*) "Europe/Belgrade" , 0x03D4A3 }, + { (char*) "Europe/Berlin" , 0x03D68D }, + { (char*) "Europe/Bratislava" , 0x03D969 }, + { (char*) "Europe/Brussels" , 0x03DC48 }, + { (char*) "Europe/Bucharest" , 0x03E0A3 }, + { (char*) "Europe/Budapest" , 0x03E344 }, + { (char*) "Europe/Busingen" , 0x03E64E }, + { (char*) "Europe/Chisinau" , 0x03E853 }, + { (char*) "Europe/Copenhagen" , 0x03EB52 }, + { (char*) "Europe/Dublin" , 0x03EDCD }, + { (char*) "Europe/Gibraltar" , 0x03F3B1 }, + { (char*) "Europe/Guernsey" , 0x03F881 }, + { (char*) "Europe/Helsinki" , 0x03FED8 }, + { (char*) "Europe/Isle_of_Man" , 0x0400C5 }, + { (char*) "Europe/Istanbul" , 0x040710 }, + { (char*) "Europe/Jersey" , 0x040BCC }, + { (char*) "Europe/Kaliningrad" , 0x041223 }, + { (char*) "Europe/Kiev" , 0x0415CB }, + { (char*) "Europe/Kirov" , 0x041805 }, + { (char*) "Europe/Kyiv" , 0x041AFE }, + { (char*) "Europe/Lisbon" , 0x041D47 }, + { (char*) "Europe/Ljubljana" , 0x042314 }, + { (char*) "Europe/London" , 0x0424FE }, + { (char*) "Europe/Luxembourg" , 0x042B49 }, + { (char*) "Europe/Madrid" , 0x042F94 }, + { (char*) "Europe/Malta" , 0x043331 }, + { (char*) "Europe/Mariehamn" , 0x0436DD }, + { (char*) "Europe/Minsk" , 0x0438CA }, + { (char*) "Europe/Monaco" , 0x043BFE }, + { (char*) "Europe/Moscow" , 0x044064 }, + { (char*) "Europe/Nicosia" , 0x044410 }, + { (char*) "Europe/Oslo" , 0x044671 }, + { (char*) "Europe/Paris" , 0x044921 }, + { (char*) "Europe/Podgorica" , 0x044D7E }, + { (char*) "Europe/Prague" , 0x044F68 }, + { (char*) "Europe/Riga" , 0x045247 }, + { (char*) "Europe/Rome" , 0x045509 }, + { (char*) "Europe/Samara" , 0x0458C8 }, + { (char*) "Europe/San_Marino" , 0x045BC9 }, + { (char*) "Europe/Sarajevo" , 0x045F88 }, + { (char*) "Europe/Saratov" , 0x046172 }, + { (char*) "Europe/Simferopol" , 0x046464 }, + { (char*) "Europe/Skopje" , 0x0467D7 }, + { (char*) "Europe/Sofia" , 0x0469C1 }, + { (char*) "Europe/Stockholm" , 0x046C1D }, + { (char*) "Europe/Tallinn" , 0x046E1A }, + { (char*) "Europe/Tirane" , 0x0470C9 }, + { (char*) "Europe/Tiraspol" , 0x047331 }, + { (char*) "Europe/Ulyanovsk" , 0x047630 }, + { (char*) "Europe/Uzhgorod" , 0x047946 }, + { (char*) "Europe/Vaduz" , 0x047B80 }, + { (char*) "Europe/Vatican" , 0x047D6A }, + { (char*) "Europe/Vienna" , 0x048129 }, + { (char*) "Europe/Vilnius" , 0x0483C7 }, + { (char*) "Europe/Volgograd" , 0x048677 }, + { (char*) "Europe/Warsaw" , 0x048986 }, + { (char*) "Europe/Zagreb" , 0x048D2D }, + { (char*) "Europe/Zaporozhye" , 0x048F17 }, + { (char*) "Europe/Zurich" , 0x049151 }, + { (char*) "Factory" , 0x04934E }, + { (char*) "GB" , 0x0493CB }, + { (char*) "GB-Eire" , 0x049A16 }, + { (char*) "GMT" , 0x04A061 }, + { (char*) "GMT+0" , 0x04A0DC }, + { (char*) "GMT-0" , 0x04A157 }, + { (char*) "GMT0" , 0x04A1D2 }, + { (char*) "Greenwich" , 0x04A24D }, + { (char*) "Hongkong" , 0x04A2C8 }, + { (char*) "HST" , 0x04A5DB }, + { (char*) "Iceland" , 0x04A657 }, + { (char*) "Indian/Antananarivo" , 0x04A6E5 }, + { (char*) "Indian/Chagos" , 0x04A791 }, + { (char*) "Indian/Christmas" , 0x04A835 }, + { (char*) "Indian/Cocos" , 0x04A8C6 }, + { (char*) "Indian/Comoro" , 0x04A95E }, + { (char*) "Indian/Kerguelen" , 0x04A9ED }, + { (char*) "Indian/Mahe" , 0x04AA7E }, + { (char*) "Indian/Maldives" , 0x04AB0F }, + { (char*) "Indian/Mauritius" , 0x04ABB3 }, + { (char*) "Indian/Mayotte" , 0x04AC72 }, + { (char*) "Indian/Reunion" , 0x04AD01 }, + { (char*) "Iran" , 0x04AD92 }, + { (char*) "Israel" , 0x04B0CA }, + { (char*) "Jamaica" , 0x04B508 }, + { (char*) "Japan" , 0x04B667 }, + { (char*) "Kwajalein" , 0x04B748 }, + { (char*) "Libya" , 0x04B82F }, + { (char*) "MET" , 0x04B9EA }, + { (char*) "Mexico/BajaNorte" , 0x04BC63 }, + { (char*) "Mexico/BajaSur" , 0x04C070 }, + { (char*) "Mexico/General" , 0x04C34A }, + { (char*) "MST" , 0x04C65B }, + { (char*) "MST7MDT" , 0x04C6D6 }, + { (char*) "Navajo" , 0x04CA99 }, + { (char*) "NZ" , 0x04CEB7 }, + { (char*) "NZ-CHAT" , 0x04D2D6 }, + { (char*) "Pacific/Apia" , 0x04D60A }, + { (char*) "Pacific/Auckland" , 0x04D7AD }, + { (char*) "Pacific/Bougainville" , 0x04DBDF }, + { (char*) "Pacific/Chatham" , 0x04DCC0 }, + { (char*) "Pacific/Chuuk" , 0x04E003 }, + { (char*) "Pacific/Easter" , 0x04E0E1 }, + { (char*) "Pacific/Efate" , 0x04E590 }, + { (char*) "Pacific/Enderbury" , 0x04E6F2 }, + { (char*) "Pacific/Fakaofo" , 0x04E7AA }, + { (char*) "Pacific/Fiji" , 0x04E84F }, + { (char*) "Pacific/Funafuti" , 0x04E9E7 }, + { (char*) "Pacific/Galapagos" , 0x04EA79 }, + { (char*) "Pacific/Gambier" , 0x04EB45 }, + { (char*) "Pacific/Guadalcanal" , 0x04EBE4 }, + { (char*) "Pacific/Guam" , 0x04EC76 }, + { (char*) "Pacific/Honolulu" , 0x04EDE0 }, + { (char*) "Pacific/Johnston" , 0x04EECF }, + { (char*) "Pacific/Kanton" , 0x04EFB8 }, + { (char*) "Pacific/Kiritimati" , 0x04F07F }, + { (char*) "Pacific/Kosrae" , 0x04F145 }, + { (char*) "Pacific/Kwajalein" , 0x04F249 }, + { (char*) "Pacific/Majuro" , 0x04F339 }, + { (char*) "Pacific/Marquesas" , 0x04F437 }, + { (char*) "Pacific/Midway" , 0x04F4DF }, + { (char*) "Pacific/Nauru" , 0x04F5A2 }, + { (char*) "Pacific/Niue" , 0x04F665 }, + { (char*) "Pacific/Norfolk" , 0x04F70B }, + { (char*) "Pacific/Noumea" , 0x04F80E }, + { (char*) "Pacific/Pago_Pago" , 0x04F8E0 }, + { (char*) "Pacific/Palau" , 0x04F97E }, + { (char*) "Pacific/Pitcairn" , 0x04FA1E }, + { (char*) "Pacific/Pohnpei" , 0x04FAC3 }, + { (char*) "Pacific/Ponape" , 0x04FBB3 }, + { (char*) "Pacific/Port_Moresby" , 0x04FC45 }, + { (char*) "Pacific/Rarotonga" , 0x04FD03 }, + { (char*) "Pacific/Saipan" , 0x04FEA5 }, + { (char*) "Pacific/Samoa" , 0x050006 }, + { (char*) "Pacific/Tahiti" , 0x0500A4 }, + { (char*) "Pacific/Tarawa" , 0x050144 }, + { (char*) "Pacific/Tongatapu" , 0x0501E5 }, + { (char*) "Pacific/Truk" , 0x0502DE }, + { (char*) "Pacific/Wake" , 0x050384 }, + { (char*) "Pacific/Wallis" , 0x050421 }, + { (char*) "Pacific/Yap" , 0x0504B3 }, + { (char*) "Poland" , 0x050559 }, + { (char*) "Portugal" , 0x050900 }, + { (char*) "PRC" , 0x050EBA }, + { (char*) "PST8PDT" , 0x05104F }, + { (char*) "ROC" , 0x051412 }, + { (char*) "ROK" , 0x05161D }, + { (char*) "Singapore" , 0x0517C8 }, + { (char*) "Turkey" , 0x0518D4 }, + { (char*) "UCT" , 0x051D90 }, + { (char*) "Universal" , 0x051E0B }, + { (char*) "US/Alaska" , 0x051E86 }, + { (char*) "US/Aleutian" , 0x052263 }, + { (char*) "US/Arizona" , 0x052638 }, + { (char*) "US/Central" , 0x052734 }, + { (char*) "US/East-Indiana" , 0x052E1A }, + { (char*) "US/Eastern" , 0x053039 }, + { (char*) "US/Hawaii" , 0x053715 }, + { (char*) "US/Indiana-Starke" , 0x0537FE }, + { (char*) "US/Michigan" , 0x053C02 }, + { (char*) "US/Mountain" , 0x053F91 }, + { (char*) "US/Pacific" , 0x0543AF }, + { (char*) "US/Samoa" , 0x0548C9 }, + { (char*) "UTC" , 0x054967 }, + { (char*) "W-SU" , 0x0549E2 }, + { (char*) "WET" , 0x054D7A }, + { (char*) "Zulu" , 0x054F74 }, }; -const unsigned char timelib_timezone_db_data_builtin[348584] = { +const unsigned char timelib_timezone_db_data_builtin[348143] = { /* Africa/Abidjan */ 0x50, 0x48, 0x50, 0x32, 0x01, 0x43, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -10557,7 +10557,7 @@ const unsigned char timelib_timezone_db_data_builtin[348584] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x5A, 0x69, 0x66, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0xFF, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0D, 0xFF, 0xFF, 0xFF, 0xFF, 0x56, 0xB6, 0xC2, 0xB8, 0xFF, 0xFF, 0xFF, 0xFF, 0xA2, 0x65, 0x63, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0xA3, 0x7B, 0x82, 0x50, 0xFF, 0xFF, 0xFF, 0xFF, 0xA4, 0x4E, 0x80, 0x60, 0xFF, 0xFF, 0xFF, 0xFF, 0xA5, 0x3F, 0xB4, 0xD0, 0xFF, 0xFF, 0xFF, 0xFF, 0xA6, 0x25, 0x27, 0xE0, 0xFF, @@ -10589,44 +10589,16 @@ const unsigned char timelib_timezone_db_data_builtin[348584] = { 0x00, 0x00, 0x00, 0x30, 0x64, 0x75, 0x50, 0x00, 0x00, 0x00, 0x00, 0x31, 0x5D, 0xAE, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x32, 0x4D, 0x91, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x33, 0x3D, 0x90, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x34, 0x2D, 0x73, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x35, 0x1D, 0x72, 0xE0, 0x00, -0x00, 0x00, 0x00, 0x36, 0x0D, 0x55, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x36, 0xFD, 0x54, 0xE0, 0x00, -0x00, 0x00, 0x00, 0x38, 0x1B, 0x5C, 0x50, 0x00, 0x00, 0x00, 0x00, 0x38, 0xDD, 0x36, 0xE0, 0x00, -0x00, 0x00, 0x00, 0x39, 0xFB, 0x3E, 0x50, 0x00, 0x00, 0x00, 0x00, 0x3A, 0xBD, 0x18, 0xE0, 0x00, -0x00, 0x00, 0x00, 0x3B, 0xDB, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x3C, 0xA6, 0x35, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3D, 0xBB, 0x02, 0x50, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x86, 0x17, 0x60, 0x00, -0x00, 0x00, 0x00, 0x3F, 0x9A, 0xE4, 0x50, 0x00, 0x00, 0x00, 0x00, 0x40, 0x65, 0xF9, 0x60, 0x00, -0x00, 0x00, 0x00, 0x41, 0x84, 0x00, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x42, 0x45, 0xDB, 0x60, 0x00, -0x00, 0x00, 0x00, 0x43, 0x63, 0xE2, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x44, 0x25, 0xBD, 0x60, 0x00, -0x00, 0x00, 0x00, 0x45, 0x43, 0xC4, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x46, 0x05, 0x9F, 0x60, 0x00, -0x00, 0x00, 0x00, 0x47, 0x23, 0xA6, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x47, 0xEE, 0xBB, 0xE0, 0x00, -0x00, 0x00, 0x00, 0x49, 0x03, 0x88, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x49, 0xCE, 0x9D, 0xE0, 0x00, -0x00, 0x00, 0x00, 0x4A, 0xE3, 0x6A, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x4B, 0xAE, 0x7F, 0xE0, 0x00, -0x00, 0x00, 0x00, 0x4C, 0xCC, 0x87, 0x50, 0x00, 0x00, 0x00, 0x00, 0x4D, 0x8E, 0x61, 0xE0, 0x00, -0x00, 0x00, 0x00, 0x4E, 0xAC, 0x69, 0x50, 0x00, 0x00, 0x00, 0x00, 0x4F, 0x6E, 0x43, 0xE0, 0x00, -0x00, 0x00, 0x00, 0x50, 0x8C, 0x4B, 0x50, 0x00, 0x00, 0x00, 0x00, 0x51, 0x57, 0x60, 0x60, 0x00, -0x00, 0x00, 0x00, 0x52, 0x6C, 0x2D, 0x50, 0x00, 0x00, 0x00, 0x00, 0x53, 0x37, 0x42, 0x60, 0x00, -0x00, 0x00, 0x00, 0x54, 0x4C, 0x0F, 0x50, 0x00, 0x00, 0x00, 0x00, 0x55, 0x17, 0x24, 0x60, 0x00, -0x00, 0x00, 0x00, 0x56, 0x2B, 0xF1, 0x50, 0x00, 0x00, 0x00, 0x00, 0x56, 0xF7, 0x06, 0x60, 0x00, -0x00, 0x00, 0x00, 0x58, 0x15, 0x0D, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x58, 0xD6, 0xE8, 0x60, 0x00, -0x00, 0x00, 0x00, 0x59, 0xF4, 0xEF, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x5A, 0xB6, 0xCA, 0x60, 0x00, -0x00, 0x00, 0x00, 0x5B, 0xD4, 0xD1, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x5C, 0x9F, 0xE6, 0xE0, 0x00, -0x00, 0x00, 0x00, 0x5D, 0xB4, 0xB3, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x5E, 0x7F, 0xC8, 0xE0, 0x00, -0x00, 0x00, 0x00, 0x5F, 0x94, 0x95, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x60, 0x5F, 0xAA, 0xE0, 0x00, -0x00, 0x00, 0x00, 0x61, 0x7D, 0xB2, 0x50, 0x00, 0x00, 0x00, 0x00, 0x62, 0x3F, 0x8C, 0xE0, 0x00, -0x00, 0x00, 0x00, 0x63, 0x5D, 0x94, 0x50, 0x00, 0x00, 0x00, 0x00, 0x64, 0x41, 0xB5, 0xE0, 0x00, -0x00, 0x00, 0x00, 0x65, 0x3D, 0x76, 0x50, 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, 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, 0x21, 0x48, 0x00, 0x00, 0x00, 0x00, -0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x45, -0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x0A, 0x45, 0x45, 0x54, 0x2D, 0x32, 0x45, 0x45, 0x53, -0x54, 0x2C, 0x4D, 0x33, 0x2E, 0x35, 0x2E, 0x30, 0x2F, 0x30, 0x2C, 0x4D, 0x31, 0x30, 0x2E, 0x35, -0x2E, 0x30, 0x2F, 0x30, 0x0A, 0x00, 0xBD, 0x07, 0xED, 0x01, 0x48, 0xD3, 0xB0, 0x00, 0x00, 0x00, -0x00, +0x00, 0x00, 0x00, 0x36, 0x0D, 0x55, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x36, 0xFD, 0x54, 0xE0, 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, 0x00, +0x00, 0x21, 0x48, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, +0x09, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x0A, 0x45, +0x45, 0x54, 0x2D, 0x32, 0x45, 0x45, 0x53, 0x54, 0x2C, 0x4D, 0x33, 0x2E, 0x35, 0x2E, 0x30, 0x2F, +0x30, 0x2C, 0x4D, 0x31, 0x30, 0x2E, 0x35, 0x2E, 0x30, 0x2F, 0x30, 0x0A, 0x00, 0xBD, 0x07, 0xED, +0x01, 0x48, 0xD3, 0xB0, 0x00, 0x00, 0x00, 0x00, /* Asia/Bishkek */ 0x50, 0x48, 0x50, 0x32, 0x01, 0x4B, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -42868,7 +42840,7 @@ const unsigned char timelib_timezone_db_data_builtin[703933] = { 0x56, 0xF7, 0x06, 0x60, 0x58, 0x15, 0x0D, 0xD0, 0x58, 0xD6, 0xE8, 0x60, 0x59, 0xF4, 0xEF, 0xD0, 0x5A, 0xB6, 0xCA, 0x60, 0x5B, 0xD4, 0xD1, 0xD0, 0x5C, 0x9F, 0xE6, 0xE0, 0x5D, 0xB4, 0xB3, 0xD0, 0x5E, 0x7F, 0xC8, 0xE0, 0x5F, 0x94, 0x95, 0xD0, 0x60, 0x5F, 0xAA, 0xE0, 0x61, 0x7D, 0xB2, 0x50, -0x62, 0x3F, 0x8C, 0xE0, 0x63, 0x5D, 0x94, 0x50, 0x64, 0x41, 0xB5, 0xE0, 0x65, 0x3D, 0x76, 0x50, +0x62, 0x3F, 0x8C, 0xE0, 0x63, 0x5D, 0x94, 0x50, 0x64, 0x1F, 0x6E, 0xE0, 0x65, 0x3D, 0x76, 0x50, 0x66, 0x08, 0x8B, 0x60, 0x67, 0x1D, 0x58, 0x50, 0x67, 0xE8, 0x6D, 0x60, 0x68, 0xFD, 0x3A, 0x50, 0x69, 0xC8, 0x4F, 0x60, 0x6A, 0xDD, 0x1C, 0x50, 0x6B, 0xA8, 0x31, 0x60, 0x6C, 0xC6, 0x38, 0xD0, 0x6D, 0x88, 0x13, 0x60, 0x6E, 0xA6, 0x1A, 0xD0, 0x6F, 0x67, 0xF5, 0x60, 0x70, 0x85, 0xFC, 0xD0, @@ -42945,7 +42917,7 @@ const unsigned char timelib_timezone_db_data_builtin[703933] = { 0x00, 0x00, 0x00, 0x00, 0x5E, 0x7F, 0xC8, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x94, 0x95, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x60, 0x5F, 0xAA, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x61, 0x7D, 0xB2, 0x50, 0x00, 0x00, 0x00, 0x00, 0x62, 0x3F, 0x8C, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x63, 0x5D, 0x94, 0x50, -0x00, 0x00, 0x00, 0x00, 0x64, 0x41, 0xB5, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x65, 0x3D, 0x76, 0x50, +0x00, 0x00, 0x00, 0x00, 0x64, 0x1F, 0x6E, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x65, 0x3D, 0x76, 0x50, 0x00, 0x00, 0x00, 0x00, 0x66, 0x08, 0x8B, 0x60, 0x00, 0x00, 0x00, 0x00, 0x67, 0x1D, 0x58, 0x50, 0x00, 0x00, 0x00, 0x00, 0x67, 0xE8, 0x6D, 0x60, 0x00, 0x00, 0x00, 0x00, 0x68, 0xFD, 0x3A, 0x50, 0x00, 0x00, 0x00, 0x00, 0x69, 0xC8, 0x4F, 0x60, 0x00, 0x00, 0x00, 0x00, 0x6A, 0xDD, 0x1C, 0x50, @@ -70027,4 +69999,4 @@ const unsigned char timelib_timezone_db_data_builtin[703933] = { }; #endif -const timelib_tzdb timezonedb_builtin = { "2023.2", 597, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; +const timelib_tzdb timezonedb_builtin = { "2023.3", 597, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; From b8755a75592bad3978d33d55d2fa48f52310c09e Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Tue, 28 Mar 2023 23:37:40 +0200 Subject: [PATCH 04/51] Fix uninitialized variable accesses in sockets/conversions This was first pointed out in GH-10959. The from_zval_... functions don't always write to the pointer, in particular it is necessary to check for an error before using the value. Otherwise we can access an uninitialized value and that's UB (and dangerous). Note: this does *NOT* get rid of the compiler warning. Even though there is error checking now, the compiler isn't smart enough to figure out that the values can not be used uninitialized. Closes GH-10966. --- ext/sockets/conversions.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ext/sockets/conversions.c b/ext/sockets/conversions.c index 90a79b83985c5..a6de55106f30f 100644 --- a/ext/sockets/conversions.c +++ b/ext/sockets/conversions.c @@ -720,6 +720,10 @@ static void from_zval_write_sockaddr_aux(const zval *container, zend_llist_add_element(&ctx->keys, &node); from_zval_write_int(elem, (char*)&family, ctx); zend_llist_remove_tail(&ctx->keys); + + if (UNEXPECTED(ctx->err.has_error)) { + return; + } } else { family = ctx->sock->type; } @@ -1115,7 +1119,10 @@ static void from_zval_write_controllen(const zval *elem, char *msghdr_c, ser_con * this least common denominator */ from_zval_write_uint32(elem, (char*)&len, ctx); - if (!ctx->err.has_error && len == 0) { + if (ctx->err.has_error) { + return; + } + if (len == 0) { do_from_zval_err(ctx, "controllen cannot be 0"); return; } From d9df750b2247bb8501eae802e1e4e912e40f9218 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Wed, 29 Mar 2023 19:51:20 -0500 Subject: [PATCH 05/51] PHP-8.1 is now for PHP 8.1.19-dev --- NEWS | 5 ++++- Zend/zend.h | 2 +- configure.ac | 2 +- main/php_version.h | 6 +++--- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index fb5882a513443..c7294f9dacad1 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,9 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -?? ??? ????, PHP 8.1.18 +?? ??? ????, PHP 8.1.19 + + +13 Apr 2023, PHP 8.1.18 - Core: . Added optional support for max_execution_time in ZTS/Linux builds diff --git a/Zend/zend.h b/Zend/zend.h index 5633f935628f3..863d06499c9c8 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -20,7 +20,7 @@ #ifndef ZEND_H #define ZEND_H -#define ZEND_VERSION "4.1.18-dev" +#define ZEND_VERSION "4.1.19-dev" #define ZEND_ENGINE_3 diff --git a/configure.ac b/configure.ac index f4ffc8b00ee32..235a0bb304d97 100644 --- a/configure.ac +++ b/configure.ac @@ -17,7 +17,7 @@ dnl Basic autoconf initialization, generation of config.nice. dnl ---------------------------------------------------------------------------- AC_PREREQ([2.68]) -AC_INIT([PHP],[8.1.18-dev],[https://github.com/php/php-src/issues],[php],[https://www.php.net]) +AC_INIT([PHP],[8.1.19-dev],[https://github.com/php/php-src/issues],[php],[https://www.php.net]) AC_CONFIG_SRCDIR([main/php_version.h]) AC_CONFIG_AUX_DIR([build]) AC_PRESERVE_HELP_ORDER diff --git a/main/php_version.h b/main/php_version.h index 30f096bb8cc64..d42ff869a27b1 100644 --- a/main/php_version.h +++ b/main/php_version.h @@ -2,7 +2,7 @@ /* edit configure.ac to change version number */ #define PHP_MAJOR_VERSION 8 #define PHP_MINOR_VERSION 1 -#define PHP_RELEASE_VERSION 18 +#define PHP_RELEASE_VERSION 19 #define PHP_EXTRA_VERSION "-dev" -#define PHP_VERSION "8.1.18-dev" -#define PHP_VERSION_ID 80118 +#define PHP_VERSION "8.1.19-dev" +#define PHP_VERSION_ID 80119 From e80073d3d2c54b195fff0bb9f3e62bb6b5f381db Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Sat, 18 Mar 2023 19:38:01 +0000 Subject: [PATCH 06/51] Fix GH-10406: feof() behavior change for UNIX based socket resources This change restores the old behaviour for the server socket streams that don't support IO. This is now stored in the stream flags so it can be later used to do some other decisions and possibly introduce some better error reporting. Closes GH-10877 --- NEWS | 3 +++ ext/openssl/xp_ssl.c | 11 +++++++++-- ext/standard/tests/streams/gh10406.phpt | 20 ++++++++++++++++++++ main/php_streams.h | 2 ++ main/streams/transports.c | 3 +++ main/streams/xp_socket.c | 9 ++++++++- 6 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 ext/standard/tests/streams/gh10406.phpt diff --git a/NEWS b/NEWS index 4cdf09ba407c9..26f20f23e6bae 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,9 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 8.2.6 +- Streams: + . Fixed bug GH-10406 (feof() behavior change for UNIX based socket + resources). (Jakub Zelenka) 30 Mar 2023, PHP 8.2.5 diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index 2ec25bee09117..79dd0b4f9c78d 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -2429,8 +2429,15 @@ static int php_openssl_sockop_set_option(php_stream *stream, int option, int val if (sslsock->s.socket == -1) { alive = 0; - } else if ((!sslsock->ssl_active && value == 0 && ((MSG_DONTWAIT != 0) || !sslsock->s.is_blocked)) || - php_pollfd_for(sslsock->s.socket, PHP_POLLREADABLE|POLLPRI, &tv) > 0) { + } else if ( + ( + !sslsock->ssl_active && + value == 0 && + !(stream->flags & PHP_STREAM_FLAG_NO_IO) && + ((MSG_DONTWAIT != 0) || !sslsock->s.is_blocked) + ) || + php_pollfd_for(sslsock->s.socket, PHP_POLLREADABLE|POLLPRI, &tv) > 0 + ) { /* the poll() call was skipped if the socket is non-blocking (or MSG_DONTWAIT is available) and if the timeout is zero */ /* additionally, we don't use this optimization if SSL is active because in that case, we're not using MSG_DONTWAIT */ if (sslsock->ssl_active) { diff --git a/ext/standard/tests/streams/gh10406.phpt b/ext/standard/tests/streams/gh10406.phpt new file mode 100644 index 0000000000000..0721dfbe9ed01 --- /dev/null +++ b/ext/standard/tests/streams/gh10406.phpt @@ -0,0 +1,20 @@ +--TEST-- +GH-10406: feof() behavior change for UNIX based socket resources +--SKIPIF-- + +--FILE-- + +--EXPECT-- +bool(false) diff --git a/main/php_streams.h b/main/php_streams.h index 71ef26c970189..e7cbc7369ed45 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -188,6 +188,8 @@ struct _php_stream_wrapper { /* Do not close handle except it is explicitly closed by user (e.g. fclose) */ #define PHP_STREAM_FLAG_NO_RSCR_DTOR_CLOSE 0x200 +#define PHP_STREAM_FLAG_NO_IO 0x400 + #define PHP_STREAM_FLAG_WAS_WRITTEN 0x80000000 struct _php_stream { diff --git a/main/streams/transports.c b/main/streams/transports.c index 35ac4ae27ade5..6fc2848be6e67 100644 --- a/main/streams/transports.c +++ b/main/streams/transports.c @@ -169,6 +169,9 @@ PHPAPI php_stream *_php_stream_xport_create(const char *name, size_t namelen, in failed = true; } } + if (!failed) { + stream->flags |= PHP_STREAM_FLAG_NO_IO; + } } } } zend_catch { diff --git a/main/streams/xp_socket.c b/main/streams/xp_socket.c index be41d3dde786d..3ba79df634915 100644 --- a/main/streams/xp_socket.c +++ b/main/streams/xp_socket.c @@ -337,7 +337,14 @@ static int php_sockop_set_option(php_stream *stream, int option, int value, void if (sock->socket == -1) { alive = 0; - } else if ((value == 0 && ((MSG_DONTWAIT != 0) || !sock->is_blocked)) || php_pollfd_for(sock->socket, PHP_POLLREADABLE|POLLPRI, &tv) > 0) { + } else if ( + ( + value == 0 && + !(stream->flags & PHP_STREAM_FLAG_NO_IO) && + ((MSG_DONTWAIT != 0) || !sock->is_blocked) + ) || + php_pollfd_for(sock->socket, PHP_POLLREADABLE|POLLPRI, &tv) > 0 + ) { /* the poll() call was skipped if the socket is non-blocking (or MSG_DONTWAIT is available) and if the timeout is zero */ #ifdef PHP_WIN32 int ret; From 2d6decc14c977159b90e9dcfa0c562c01794c12a Mon Sep 17 00:00:00 2001 From: NathanFreeman <1056159381@qq.com> Date: Thu, 23 Feb 2023 22:29:27 +0800 Subject: [PATCH 07/51] Fix bug #80602: Segfault when using DOMChildNode::before() This furthermore fixes the logic error explained in https://github.com/php/php-src/pull/8729#issuecomment-1161737132 Closes GH-10682. --- NEWS | 4 + ext/dom/parentnode.c | 90 +++++++++++++++-- ext/dom/tests/bug80602.phpt | 178 ++++++++++++++++++++++++++++++++++ ext/dom/tests/bug80602_2.phpt | 178 ++++++++++++++++++++++++++++++++++ 4 files changed, 441 insertions(+), 9 deletions(-) create mode 100644 ext/dom/tests/bug80602.phpt create mode 100644 ext/dom/tests/bug80602_2.phpt diff --git a/NEWS b/NEWS index c7294f9dacad1..3fc2f4ff07081 100644 --- a/NEWS +++ b/NEWS @@ -24,6 +24,10 @@ PHP NEWS . Fixed bug GH-10583 (DateTime modify with tz pattern should not update linked timezone). (Derick) +- DOM: + . Fixed bug #80602 (Segfault when using DOMChildNode::before()). + (Nathan Freeman) + - FPM: . Fixed bug GH-10611 (fpm_env_init_main leaks environ). (nielsdos) . Destroy file_handle in fpm_main. (Jakub Zelenka, nielsdos) diff --git a/ext/dom/parentnode.c b/ext/dom/parentnode.c index 3d7e5e44a4b2c..29880a54ada66 100644 --- a/ext/dom/parentnode.c +++ b/ext/dom/parentnode.c @@ -181,8 +181,20 @@ xmlNode* dom_zvals_to_fragment(php_libxml_ref_obj *document, xmlNode *contextNod return NULL; } + /* + * xmlNewDocText function will always returns same address to the second parameter if the parameters are greater than or equal to three. + * If it's text, that's fine, but if it's an object, it can cause invalid pointer because many new nodes point to the same memory address. + * So we must copy the new node to avoid this situation. + */ + if (nodesc > 1) { + newNode = xmlCopyNode(newNode, 1); + } + if (!xmlAddChild(fragment, newNode)) { xmlFree(fragment); + if (nodesc > 1) { + xmlFreeNode(newNode); + } php_dom_throw_error(HIERARCHY_REQUEST_ERR, stricterror); return NULL; @@ -302,7 +314,9 @@ void dom_parent_node_after(dom_object *context, zval *nodes, int nodesc) { xmlNode *prevsib = dom_object_get_node(context); xmlNodePtr newchild, parentNode; - xmlNode *fragment; + xmlNode *fragment, *nextsib; + xmlDoc *doc; + bool afterlastchild; int stricterror = dom_get_strict_error(context->document); @@ -311,7 +325,10 @@ void dom_parent_node_after(dom_object *context, zval *nodes, int nodesc) return; } + doc = prevsib->doc; parentNode = prevsib->parent; + nextsib = prevsib->next; + afterlastchild = (nextsib == NULL); fragment = dom_zvals_to_fragment(context->document, parentNode, nodes, nodesc); if (fragment == NULL) { @@ -321,13 +338,42 @@ void dom_parent_node_after(dom_object *context, zval *nodes, int nodesc) newchild = fragment->children; if (newchild) { - fragment->last->next = prevsib->next; - prevsib->next = newchild; + /* first node and last node are both both parameters to DOMElement::after() method so nextsib and prevsib are null. */ + if (!parentNode->children) { + prevsib = nextsib = NULL; + } else if (afterlastchild) { + /* + * The new node will be inserted after last node, prevsib is last node. + * The first node is the parameter to DOMElement::after() if parentNode->children == prevsib is true + * and prevsib does not change, otherwise prevsib is parentNode->last (first node). + */ + prevsib = parentNode->children == prevsib ? prevsib : parentNode->last; + } else { + /* + * The new node will be inserted after first node, prevsib is first node. + * The first node is not the parameter to DOMElement::after() if parentNode->children == prevsib is true + * and prevsib does not change otherwise prevsib is null to mean that parentNode->children is the new node. + */ + prevsib = parentNode->children == prevsib ? prevsib : NULL; + } - newchild->prev = prevsib; + if (prevsib) { + fragment->last->next = prevsib->next; + if (prevsib->next) { + prevsib->next->prev = fragment->last; + } + prevsib->next = newchild; + } else { + parentNode->children = newchild; + if (nextsib) { + fragment->last->next = nextsib; + nextsib->prev = fragment->last; + } + } + newchild->prev = prevsib; dom_fragment_assign_parent_node(parentNode, fragment); - dom_reconcile_ns(prevsib->doc, newchild); + dom_reconcile_ns(doc, newchild); } xmlFree(fragment); @@ -337,10 +383,15 @@ void dom_parent_node_before(dom_object *context, zval *nodes, int nodesc) { xmlNode *nextsib = dom_object_get_node(context); xmlNodePtr newchild, prevsib, parentNode; - xmlNode *fragment; + xmlNode *fragment, *afternextsib; + xmlDoc *doc; + bool beforefirstchild; + doc = nextsib->doc; prevsib = nextsib->prev; + afternextsib = nextsib->next; parentNode = nextsib->parent; + beforefirstchild = !prevsib; fragment = dom_zvals_to_fragment(context->document, parentNode, nodes, nodesc); if (fragment == NULL) { @@ -350,19 +401,40 @@ void dom_parent_node_before(dom_object *context, zval *nodes, int nodesc) newchild = fragment->children; if (newchild) { + /* first node and last node are both both parameters to DOMElement::before() method so nextsib is null. */ + if (!parentNode->children) { + nextsib = NULL; + } else if (beforefirstchild) { + /* + * The new node will be inserted before first node, nextsib is first node and afternextsib is last node. + * The first node is not the parameter to DOMElement::before() if parentNode->children == nextsib is true + * and nextsib does not change, otherwise nextsib is the last node. + */ + nextsib = parentNode->children == nextsib ? nextsib : afternextsib; + } else { + /* + * The new node will be inserted before last node, prevsib is first node and nestsib is last node. + * The first node is not the parameter to DOMElement::before() if parentNode->children == prevsib is true + * but last node may be, so use prevsib->next to determine the value of nextsib, otherwise nextsib does not change. + */ + nextsib = parentNode->children == prevsib ? prevsib->next : nextsib; + } + if (parentNode->children == nextsib) { parentNode->children = newchild; } else { prevsib->next = newchild; } + fragment->last->next = nextsib; - nextsib->prev = fragment->last; + if (nextsib) { + nextsib->prev = fragment->last; + } newchild->prev = prevsib; dom_fragment_assign_parent_node(parentNode, fragment); - - dom_reconcile_ns(nextsib->doc, newchild); + dom_reconcile_ns(doc, newchild); } xmlFree(fragment); diff --git a/ext/dom/tests/bug80602.phpt b/ext/dom/tests/bug80602.phpt new file mode 100644 index 0000000000000..9f041f686f516 --- /dev/null +++ b/ext/dom/tests/bug80602.phpt @@ -0,0 +1,178 @@ +--TEST-- +Bug #80602 (Segfault when using DOMChildNode::before()) +--FILE-- +loadXML('foo'); +$target = $doc->documentElement->firstChild; +$target->before($target); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->lastChild; +$target->before($target); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->firstChild; +$target->before($doc->documentElement->lastChild); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->lastChild; +$target->before($doc->documentElement->firstChild); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->firstChild; +$target->before($target, $doc->documentElement->lastChild); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->firstChild; +$target->before($doc->documentElement->lastChild, $target); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->lastChild; +$target->before($target, $doc->documentElement->firstChild); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->lastChild; +$target->before($doc->documentElement->firstChild, $target); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->firstChild; +$target->before('bar','baz'); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->lastChild; +$target->before('bar','baz'); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->firstChild; +$target->before($target, 'bar','baz'); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->firstChild; +$target->before('bar', $target, 'baz'); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->firstChild; +$target->before('bar', 'baz', $target); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + + + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->lastChild; +$target->before($target, 'bar','baz'); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->lastChild; +$target->before('bar', $target, 'baz'); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->lastChild; +$target->before('bar', 'baz', $target); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + + + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->firstChild; +$target->before('bar', $target, $doc->documentElement->lastChild); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->firstChild; +$target->before($target, 'bar', $doc->documentElement->lastChild); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->firstChild; +$target->before($target, $doc->documentElement->lastChild, 'bar'); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + + + + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->lastChild; +$target->before('bar', $doc->documentElement->firstChild, $target); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->lastChild; +$target->before($doc->documentElement->firstChild, 'bar', $target); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->lastChild; +$target->before($doc->documentElement->firstChild, $target, 'bar'); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + +?> +--EXPECTF-- +foo +foo +foo +foo +foo +foo +foo +foo +barbazfoo +foobarbaz +foobarbaz +barfoobaz +barbazfoo +foobarbaz +foobarbaz +foobarbaz +barfoo +foobar +foobar +barfoo +foobar +foobar diff --git a/ext/dom/tests/bug80602_2.phpt b/ext/dom/tests/bug80602_2.phpt new file mode 100644 index 0000000000000..1151417c0f845 --- /dev/null +++ b/ext/dom/tests/bug80602_2.phpt @@ -0,0 +1,178 @@ +--TEST-- +Bug #80602 (Segfault when using DOMChildNode::after()) +--FILE-- +loadXML('foo'); +$target = $doc->documentElement->firstChild; +$target->after($target); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->lastChild; +$target->after($target); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->firstChild; +$target->after($doc->documentElement->lastChild); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->lastChild; +$target->after($doc->documentElement->firstChild); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->firstChild; +$target->after($target, $doc->documentElement->lastChild); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->firstChild; +$target->after($doc->documentElement->lastChild, $target); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->lastChild; +$target->after($target, $doc->documentElement->firstChild); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->lastChild; +$target->after($doc->documentElement->firstChild, $target); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->firstChild; +$target->after('bar','baz'); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->lastChild; +$target->after('bar','baz'); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->firstChild; +$target->after($target, 'bar','baz'); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->firstChild; +$target->after('bar', $target, 'baz'); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->firstChild; +$target->after('bar', 'baz', $target); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + + + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->lastChild; +$target->after($target, 'bar','baz'); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->lastChild; +$target->after('bar', $target, 'baz'); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->lastChild; +$target->after('bar', 'baz', $target); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + + + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->firstChild; +$target->after('bar', $target, $doc->documentElement->lastChild); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->firstChild; +$target->after($target, 'bar', $doc->documentElement->lastChild); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->firstChild; +$target->after($target, $doc->documentElement->lastChild, 'bar'); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + + + + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->lastChild; +$target->after('bar', $doc->documentElement->firstChild, $target); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->lastChild; +$target->after($doc->documentElement->firstChild, 'bar', $target); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + + +$doc = new \DOMDocument(); +$doc->loadXML('foo'); +$target = $doc->documentElement->lastChild; +$target->after($doc->documentElement->firstChild, $target, 'bar'); +echo $doc->saveXML($doc->documentElement).PHP_EOL; + +?> +--EXPECTF-- +foo +foo +foo +foo +foo +foo +foo +foo +foobarbaz +foobarbaz +foobarbaz +barfoobaz +barbazfoo +foobarbaz +foobarbaz +foobarbaz +barfoo +foobar +foobar +barfoo +foobar +foobar From 5e76c6d2641aae5939c5f98d52ad8cc28d9eb753 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Thu, 30 Mar 2023 21:41:11 +0200 Subject: [PATCH 08/51] [ci skip] NEWS --- NEWS | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 3fc2f4ff07081..2e3c6b290e34a 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,9 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 8.1.19 +- DOM: + . Fixed bug #80602 (Segfault when using DOMChildNode::before()). + (Nathan Freeman) 13 Apr 2023, PHP 8.1.18 @@ -24,10 +27,6 @@ PHP NEWS . Fixed bug GH-10583 (DateTime modify with tz pattern should not update linked timezone). (Derick) -- DOM: - . Fixed bug #80602 (Segfault when using DOMChildNode::before()). - (Nathan Freeman) - - FPM: . Fixed bug GH-10611 (fpm_env_init_main leaks environ). (nielsdos) . Destroy file_handle in fpm_main. (Jakub Zelenka, nielsdos) From 47b3fe4710bc5320c021a0c26a27190d740a1c73 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Fri, 24 Mar 2023 19:18:28 +0100 Subject: [PATCH 09/51] Handle indirect zvals and use up-to-date properties in SplFixedArray::__serialize Closes GH-10925. --- NEWS | 4 +++ ext/spl/spl_fixedarray.c | 24 ++++++------- ext/spl/tests/gh10907.phpt | 4 +-- ext/spl/tests/gh10925.phpt | 69 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 86 insertions(+), 15 deletions(-) create mode 100644 ext/spl/tests/gh10925.phpt diff --git a/NEWS b/NEWS index 0a1bcba85efe4..8e82b4aa03b1d 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,10 @@ PHP NEWS . Fixed bug #80602 (Segfault when using DOMChildNode::before()). (Nathan Freeman) +- SPL: + . Handle indirect zvals and use up-to-date properties in + SplFixedArray::__serialize. (nielsdos) + - Streams: . Fixed bug GH-10406 (feof() behavior change for UNIX based socket resources). (Jakub Zelenka) diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c index bf9ec4e695fb4..c333c6d621843 100644 --- a/ext/spl/spl_fixedarray.c +++ b/ext/spl/spl_fixedarray.c @@ -597,8 +597,8 @@ PHP_METHOD(SplFixedArray, __serialize) RETURN_THROWS(); } - uint32_t num_properties = - intern->std.properties ? zend_hash_num_elements(intern->std.properties) : 0; + HashTable *ht = zend_std_get_properties(&intern->std); + uint32_t num_properties = zend_hash_num_elements(ht); array_init_size(return_value, intern->array.size + num_properties); /* elements */ @@ -609,17 +609,15 @@ PHP_METHOD(SplFixedArray, __serialize) } /* members */ - if (intern->std.properties) { - ZEND_HASH_FOREACH_STR_KEY_VAL(intern->std.properties, key, current) { - /* The properties hash table can also contain the array elements if the properties table was already rebuilt. - * In this case we'd have a NULL key. We can't simply use the properties table in all cases because it's - * potentially out of sync (missing elements, or containing removed elements) and might need a rebuild. */ - if (key != NULL) { - zend_hash_add_new(Z_ARRVAL_P(return_value), key, current); - Z_TRY_ADDREF_P(current); - } - } ZEND_HASH_FOREACH_END(); - } + ZEND_HASH_FOREACH_STR_KEY_VAL_IND(ht, key, current) { + /* If the properties table was already rebuild, it will also contain the + * array elements. The array elements are already added in the above loop. + * We can detect array elements by the fact that their key == NULL. */ + if (key != NULL) { + zend_hash_add_new(Z_ARRVAL_P(return_value), key, current); + Z_TRY_ADDREF_P(current); + } + } ZEND_HASH_FOREACH_END(); } PHP_METHOD(SplFixedArray, __unserialize) diff --git a/ext/spl/tests/gh10907.phpt b/ext/spl/tests/gh10907.phpt index 034c5f1d5a33c..49d98ae5ef360 100644 --- a/ext/spl/tests/gh10907.phpt +++ b/ext/spl/tests/gh10907.phpt @@ -112,10 +112,10 @@ object(SplFixedArray)#1 (3) { } ================= Test with adding members -string(161) "O:15:"MySplFixedArray":5:{i:0;s:12:"test value 1";i:1;s:12:"test value 2";i:2;N;s:9:"my_string";i:0;s:19:"my_dynamic_property";s:25:"my_dynamic_property_value";}" +string(180) "O:15:"MySplFixedArray":5:{i:0;s:12:"test value 1";i:1;s:12:"test value 2";i:2;N;s:9:"my_string";s:15:"my_string_value";s:19:"my_dynamic_property";s:25:"my_dynamic_property_value";}" object(MySplFixedArray)#1 (5) { ["my_string"]=> - int(0) + string(15) "my_string_value" ["my_dynamic_property"]=> string(25) "my_dynamic_property_value" [0]=> diff --git a/ext/spl/tests/gh10925.phpt b/ext/spl/tests/gh10925.phpt new file mode 100644 index 0000000000000..5e6cc0347b46d --- /dev/null +++ b/ext/spl/tests/gh10925.phpt @@ -0,0 +1,69 @@ +--TEST-- +Properties serialization for SplFixedArray should have updated properties +--FILE-- +y); +$x->y = 2; +var_dump($x->y); +$serialized = serialize($x); +var_dump($serialized); +var_dump(unserialize($serialized)); + +$x->dynamic_property = "dynamic_property_value"; +$serialized = serialize($x); +var_dump($serialized); +var_dump(unserialize($serialized)); + +$x->dynamic_property = "dynamic_property_value2"; +$x->y = 4; +$serialized = serialize($x); +var_dump($serialized); +var_dump(unserialize($serialized)); +?> +--EXPECT-- +int(3) +int(2) +string(61) "O:15:"MySplFixedArray":4:{i:0;N;i:1;N;s:1:"x";N;s:1:"y";i:2;}" +object(MySplFixedArray)#2 (4) { + ["x"]=> + NULL + ["y"]=> + int(2) + [0]=> + NULL + [1]=> + NULL +} +string(115) "O:15:"MySplFixedArray":5:{i:0;N;i:1;N;s:1:"x";N;s:1:"y";i:2;s:16:"dynamic_property";s:22:"dynamic_property_value";}" +object(MySplFixedArray)#2 (5) { + ["x"]=> + NULL + ["y"]=> + int(2) + ["dynamic_property"]=> + string(22) "dynamic_property_value" + [0]=> + NULL + [1]=> + NULL +} +string(116) "O:15:"MySplFixedArray":5:{i:0;N;i:1;N;s:1:"x";N;s:1:"y";i:4;s:16:"dynamic_property";s:23:"dynamic_property_value2";}" +object(MySplFixedArray)#2 (5) { + ["x"]=> + NULL + ["y"]=> + int(4) + ["dynamic_property"]=> + string(23) "dynamic_property_value2" + [0]=> + NULL + [1]=> + NULL +} From 960f07104ca4e45d4d2812cfe4b3306fcbcf1294 Mon Sep 17 00:00:00 2001 From: Pierrick Charron Date: Thu, 30 Mar 2023 23:29:56 -0400 Subject: [PATCH 10/51] [skip ci] Fix PHP 8.2.5 release date in NEWS --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 8e82b4aa03b1d..f355b98c61d6a 100644 --- a/NEWS +++ b/NEWS @@ -14,7 +14,7 @@ PHP NEWS . Fixed bug GH-10406 (feof() behavior change for UNIX based socket resources). (Jakub Zelenka) -30 Mar 2023, PHP 8.2.5 +13 Apr 2023, PHP 8.2.5 - Core: . Added optional support for max_execution_time in ZTS/Linux builds From 41bbb116dd6e16d975fe6e7ab82f18adb8a193fd Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Thu, 30 Mar 2023 13:22:52 +0200 Subject: [PATCH 11/51] Unary minus const expression consistency - of 0.0 should result in -0.0 Closes GH-10978 --- NEWS | 3 +++ .../unary_minus_const_expr_consistency.phpt | 16 ++++++++++++++++ Zend/zend_ast.c | 4 ++-- 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 Zend/tests/unary_minus_const_expr_consistency.phpt diff --git a/NEWS b/NEWS index 2e3c6b290e34a..99ef4c45288ce 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,9 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 8.1.19 +- Core: + . Fix inconsistent float negation in constant expressions. (ilutov) + - DOM: . Fixed bug #80602 (Segfault when using DOMChildNode::before()). (Nathan Freeman) diff --git a/Zend/tests/unary_minus_const_expr_consistency.phpt b/Zend/tests/unary_minus_const_expr_consistency.phpt new file mode 100644 index 0000000000000..c8175df8bed3a --- /dev/null +++ b/Zend/tests/unary_minus_const_expr_consistency.phpt @@ -0,0 +1,16 @@ +--TEST-- +Unary minus constant expression consistency +--FILE-- + +--EXPECT-- +float(-0) +float(-0) diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c index 0e5e5ebac1688..409993c89edfa 100644 --- a/Zend/zend_ast.c +++ b/Zend/zend_ast.c @@ -662,8 +662,8 @@ ZEND_API zend_result ZEND_FASTCALL zend_ast_evaluate(zval *result, zend_ast *ast if (UNEXPECTED(zend_ast_evaluate(&op2, ast->child[0], scope) != SUCCESS)) { ret = FAILURE; } else { - ZVAL_LONG(&op1, 0); - ret = sub_function(result, &op1, &op2); + ZVAL_LONG(&op1, -1); + ret = mul_function(result, &op1, &op2); zval_ptr_dtor_nogc(&op2); } break; From 66ce20571836659dab569d6b81973d78ca3b1b00 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Wed, 29 Mar 2023 14:37:52 +0200 Subject: [PATCH 12/51] Fix incorrect zval type_flags in preg_replace_callback_array() for immutable arrays The ZVAL_ARR macro always set the zval type_info to IS_ARRAY_EX, even if the hash table is immutable. Since in preg_replace_callback_array() we can return the passed array directly, and that passed array can be immutable, we need to reset the type_flags to keep the VM from performing ref-counting on the array. Fixes GH-10968 Closes GH-10970 --- NEWS | 3 +++ ext/pcre/php_pcre.c | 7 ++++++- ext/pcre/tests/gh10968.phpt | 11 +++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 ext/pcre/tests/gh10968.phpt diff --git a/NEWS b/NEWS index 99ef4c45288ce..ec9ae488a2ad3 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,9 @@ PHP NEWS . Fixed bug #80602 (Segfault when using DOMChildNode::before()). (Nathan Freeman) +- PCRE: + . Fixed bug GH-10968 (Segfault in preg_replace_callback_array()). (ilutov) + 13 Apr 2023, PHP 8.1.18 - Core: diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index a8d3559ef5beb..6249a80797076 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -2479,7 +2479,12 @@ PHP_FUNCTION(preg_replace_callback_array) } if (subject_ht) { - RETURN_ARR(subject_ht); + RETVAL_ARR(subject_ht); + // Unset the type_flags of immutable arrays to prevent the VM from performing refcounting + if (GC_FLAGS(subject_ht) & IS_ARRAY_IMMUTABLE) { + Z_TYPE_FLAGS_P(return_value) = 0; + } + return; } else { RETURN_STR(subject_str); } diff --git a/ext/pcre/tests/gh10968.phpt b/ext/pcre/tests/gh10968.phpt new file mode 100644 index 0000000000000..873d17e79da86 --- /dev/null +++ b/ext/pcre/tests/gh10968.phpt @@ -0,0 +1,11 @@ +--TEST-- +GH-10968: preg_replace_callback_array() segmentation fault +--FILE-- + +--EXPECT-- +array(0) { +} +string(0) "" From cf9b030a5785fb2358d24de93cf0b342da824c49 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 1 Apr 2023 14:25:38 +0200 Subject: [PATCH 13/51] Fix GH-8841: php-cli core dump calling a badly formed function It's actually not php-cli specific, nor SAPI specific. We should delay the registration of the function into the function table until after the compilation was successful, otherwise the function is mistakingly registered and a NULL dereference will happen when trying to call it. I based my test of Nikita's test, so credits to him for the test: https://github.com/php/php-src/pull/8933#issuecomment-1259881008 Closes GH-10989. --- NEWS | 2 ++ Zend/tests/gh8841.phpt | 30 ++++++++++++++++++++++++++++++ Zend/zend_compile.c | 28 +++++++++++++++------------- 3 files changed, 47 insertions(+), 13 deletions(-) create mode 100644 Zend/tests/gh8841.phpt diff --git a/NEWS b/NEWS index ec9ae488a2ad3..1dcf1768f0fc9 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,8 @@ PHP NEWS - Core: . Fix inconsistent float negation in constant expressions. (ilutov) + . Fixed bug GH-8841 (php-cli core dump calling a badly formed function). + (nielsdos) - DOM: . Fixed bug #80602 (Segfault when using DOMChildNode::before()). diff --git a/Zend/tests/gh8841.phpt b/Zend/tests/gh8841.phpt new file mode 100644 index 0000000000000..d99ca62c28773 --- /dev/null +++ b/Zend/tests/gh8841.phpt @@ -0,0 +1,30 @@ +--TEST-- +GH-8841 (php-cli core dump calling a badly formed function) +--FILE-- + +--EXPECTF-- +Fatal error: A void function must not return a value in %s on line %d +Before calling g() +After calling g() +Before calling f() + +Fatal error: Uncaught Error: Call to undefined function f() in %s:%d +Stack trace: +#0 [internal function]: {closure}() +#1 {main} + thrown in %s on line %d diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 0774fb6d19a25..14888722e13cc 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -7126,7 +7126,7 @@ static uint32_t zend_add_dynamic_func_def(zend_op_array *def) { return def_offset; } -static void zend_begin_func_decl(znode *result, zend_op_array *op_array, zend_ast_decl *decl, bool toplevel) /* {{{ */ +static zend_string *zend_begin_func_decl(znode *result, zend_op_array *op_array, zend_ast_decl *decl, bool toplevel) /* {{{ */ { zend_string *unqualified_name, *name, *lcname; zend_op *opline; @@ -7157,11 +7157,7 @@ static void zend_begin_func_decl(znode *result, zend_op_array *op_array, zend_as zend_register_seen_symbol(lcname, ZEND_SYMBOL_FUNCTION); if (toplevel) { - if (UNEXPECTED(zend_hash_add_ptr(CG(function_table), lcname, op_array) == NULL)) { - do_bind_function_error(lcname, op_array, 1); - } - zend_string_release_ex(lcname, 0); - return; + return lcname; } uint32_t func_ref = zend_add_dynamic_func_def(op_array); @@ -7175,7 +7171,8 @@ static void zend_begin_func_decl(znode *result, zend_op_array *op_array, zend_as LITERAL_STR(opline->op1, zend_string_copy(lcname)); opline->op2.num = func_ref; } - zend_string_release_ex(lcname, 0); + + return lcname; } /* }}} */ @@ -7187,7 +7184,7 @@ static void zend_compile_func_decl(znode *result, zend_ast *ast, bool toplevel) zend_ast *stmt_ast = decl->child[2]; zend_ast *return_type_ast = decl->child[3]; bool is_method = decl->kind == ZEND_AST_METHOD; - zend_string *method_lcname = NULL; + zend_string *lcname; zend_class_entry *orig_class_entry = CG(active_class_entry); zend_op_array *orig_op_array = CG(active_op_array); @@ -7219,9 +7216,9 @@ static void zend_compile_func_decl(znode *result, zend_ast *ast, bool toplevel) if (is_method) { bool has_body = stmt_ast != NULL; - method_lcname = zend_begin_method_decl(op_array, decl->name, has_body); + lcname = zend_begin_method_decl(op_array, decl->name, has_body); } else { - zend_begin_func_decl(result, op_array, decl, toplevel); + lcname = zend_begin_func_decl(result, op_array, decl, toplevel); if (decl->kind == ZEND_AST_ARROW_FUNC) { find_implicit_binds(&info, params_ast, stmt_ast); compile_implicit_lexical_binds(&info, result, op_array); @@ -7264,7 +7261,7 @@ static void zend_compile_func_decl(znode *result, zend_ast *ast, bool toplevel) } zend_compile_params(params_ast, return_type_ast, - is_method && zend_string_equals_literal(method_lcname, ZEND_TOSTRING_FUNC_NAME) ? IS_STRING : 0); + is_method && zend_string_equals_literal(lcname, ZEND_TOSTRING_FUNC_NAME) ? IS_STRING : 0); if (CG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) { zend_mark_function_as_generator(); zend_emit_op(NULL, ZEND_GENERATOR_CREATE, NULL, NULL); @@ -7280,9 +7277,14 @@ static void zend_compile_func_decl(znode *result, zend_ast *ast, bool toplevel) if (is_method) { CG(zend_lineno) = decl->start_lineno; zend_check_magic_method_implementation( - CG(active_class_entry), (zend_function *) op_array, method_lcname, E_COMPILE_ERROR); - zend_string_release_ex(method_lcname, 0); + CG(active_class_entry), (zend_function *) op_array, lcname, E_COMPILE_ERROR); + } else if (toplevel) { + /* Only register the function after a successful compile */ + if (UNEXPECTED(zend_hash_add_ptr(CG(function_table), lcname, op_array) == NULL)) { + do_bind_function_error(lcname, op_array, true); + } } + zend_string_release_ex(lcname, 0); /* put the implicit return on the really last line */ CG(zend_lineno) = decl->end_lineno; From 79c5b32d15922f3e6792a1ef6ec8402859acd3ca Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 1 Apr 2023 15:02:30 +0200 Subject: [PATCH 14/51] Fix GH-10990: mail() throws TypeError after iterating over $additional_headers array by reference We should dereference the values, otherwise references don't work. Closes GH-10991. --- NEWS | 4 ++++ ext/standard/mail.c | 2 ++ ext/standard/tests/mail/gh10990.phpt | 17 +++++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 ext/standard/tests/mail/gh10990.phpt diff --git a/NEWS b/NEWS index 1dcf1768f0fc9..18696f340e82b 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,10 @@ PHP NEWS - PCRE: . Fixed bug GH-10968 (Segfault in preg_replace_callback_array()). (ilutov) +- Standard: + . Fixed bug GH-10990 (mail() throws TypeError after iterating over + $additional_headers array by reference). (nielsdos) + 13 Apr 2023, PHP 8.1.18 - Core: diff --git a/ext/standard/mail.c b/ext/standard/mail.c index 003fad3ea18c5..4299c10bc2e8e 100644 --- a/ext/standard/mail.c +++ b/ext/standard/mail.c @@ -136,6 +136,7 @@ static void php_mail_build_headers_elems(smart_str *s, zend_string *key, zval *v zend_type_error("Header \"%s\" must only contain numeric keys, \"%s\" found", ZSTR_VAL(key), ZSTR_VAL(tmp_key)); break; } + ZVAL_DEREF(tmp_val); if (Z_TYPE_P(tmp_val) != IS_STRING) { zend_type_error("Header \"%s\" must only contain values of type string, %s found", ZSTR_VAL(key), zend_zval_type_name(tmp_val)); break; @@ -157,6 +158,7 @@ PHPAPI zend_string *php_mail_build_headers(HashTable *headers) zend_type_error("Header name cannot be numeric, " ZEND_LONG_FMT " given", idx); break; } + ZVAL_DEREF(val); /* https://tools.ietf.org/html/rfc2822#section-3.6 */ if (zend_string_equals_literal_ci(key, "orig-date")) { PHP_MAIL_BUILD_HEADER_CHECK("orig-date", s, key, val); diff --git a/ext/standard/tests/mail/gh10990.phpt b/ext/standard/tests/mail/gh10990.phpt new file mode 100644 index 0000000000000..4f74c17c22bda --- /dev/null +++ b/ext/standard/tests/mail/gh10990.phpt @@ -0,0 +1,17 @@ +--TEST-- +GH-10990 (mail() throws TypeError after iterating over $additional_headers array by reference) +--INI-- +sendmail_path=rubbish 2>/dev/null +--SKIPIF-- + +--FILE-- + &$from]; +var_dump(mail('test@example.com', 'Test', 'Test', $headers)); +?> +--EXPECT-- +bool(false) From dd29b66dfae343906595ebf0a89e7ec20c2852c2 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Fri, 31 Mar 2023 00:27:30 +0200 Subject: [PATCH 15/51] Fix GH-10983: State-dependant segfault in ReflectionObject::getProperties This is a variant of GH-10200, but in a different place. Basically, simplexml may create a properties table that's packed instead of associative. But the macro that was used to loop over the properties table assumed that it was always associative. Replace it by the macro that figures it out automatically which one of the two it is. For test: Co-authored-by: jnvsor Closes GH-10984. --- NEWS | 4 ++++ ext/reflection/php_reflection.c | 2 +- ext/simplexml/tests/gh10983.phpt | 23 +++++++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 ext/simplexml/tests/gh10983.phpt diff --git a/NEWS b/NEWS index f6be31bc60240..2bad4ec55e0e9 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,10 @@ PHP NEWS - PCRE: . Fixed bug GH-10968 (Segfault in preg_replace_callback_array()). (ilutov) +- Reflection: + . Fixed bug GH-10983 (State-dependant segfault in + ReflectionObject::getProperties). (nielsdos) + - SPL: . Handle indirect zvals and use up-to-date properties in SplFixedArray::__serialize. (nielsdos) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 38d86c32ab6b8..668ad768b384a 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -4686,7 +4686,7 @@ ZEND_METHOD(ReflectionClass, getProperties) if (Z_TYPE(intern->obj) != IS_UNDEF && (filter & ZEND_ACC_PUBLIC) != 0) { HashTable *properties = Z_OBJ_HT(intern->obj)->get_properties(Z_OBJ(intern->obj)); zval *prop; - ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(properties, key, prop) { + ZEND_HASH_FOREACH_STR_KEY_VAL(properties, key, prop) { _adddynproperty(prop, key, ce, return_value); } ZEND_HASH_FOREACH_END(); } diff --git a/ext/simplexml/tests/gh10983.phpt b/ext/simplexml/tests/gh10983.phpt new file mode 100644 index 0000000000000..ae6da92d7de2f --- /dev/null +++ b/ext/simplexml/tests/gh10983.phpt @@ -0,0 +1,23 @@ +--TEST-- +GH-10983 (State-dependant segfault in ReflectionObject::getProperties) +--EXTENSIONS-- +simplexml +--FILE-- + +XML; + +$simplexml = simplexml_load_string($xml); + +var_dump($simplexml['name']); +$reflector = new ReflectionObject($simplexml['name']); +$rprops = $reflector->getProperties(); + +?> +--EXPECT-- +object(SimpleXMLElement)#2 (1) { + [0]=> + string(4) "test" +} From 84b4020eb4a8ebc45cb80164d4589cbf818f47f2 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Wed, 29 Mar 2023 20:51:14 +0200 Subject: [PATCH 16/51] Fix add_function_array() assertion when op2 contains op1 Fixes GH-10085 Closes GH-10975 Co-authored-by: Dmitry Stogov --- NEWS | 2 ++ Zend/tests/gh10085_1.phpt | 22 ++++++++++++++++++++++ Zend/tests/gh10085_2.phpt | 25 +++++++++++++++++++++++++ Zend/zend_operators.c | 18 ++++++++++++------ 4 files changed, 61 insertions(+), 6 deletions(-) create mode 100644 Zend/tests/gh10085_1.phpt create mode 100644 Zend/tests/gh10085_2.phpt diff --git a/NEWS b/NEWS index 18696f340e82b..8752a5009000e 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,8 @@ PHP NEWS . Fix inconsistent float negation in constant expressions. (ilutov) . Fixed bug GH-8841 (php-cli core dump calling a badly formed function). (nielsdos) + . Fixed bug GH-10085 (Assertion when adding two arrays with += where the first + array is contained in the second). (ilutov) - DOM: . Fixed bug #80602 (Segfault when using DOMChildNode::before()). diff --git a/Zend/tests/gh10085_1.phpt b/Zend/tests/gh10085_1.phpt new file mode 100644 index 0000000000000..cc11c96a09d32 --- /dev/null +++ b/Zend/tests/gh10085_1.phpt @@ -0,0 +1,22 @@ +--TEST-- +GH-10085: Assertion in add_function_array() +--FILE-- + +--EXPECT-- +array(2) { + [0]=> + array(2) { + [0]=> + array(0) { + } + [1]=> + int(0) + } + [1]=> + int(0) +} diff --git a/Zend/tests/gh10085_2.phpt b/Zend/tests/gh10085_2.phpt new file mode 100644 index 0000000000000..7895999f2cd05 --- /dev/null +++ b/Zend/tests/gh10085_2.phpt @@ -0,0 +1,25 @@ +--TEST-- +GH-10085: Assertion in add_function_array() +--FILE-- + +--EXPECT-- +array(2) { + [0]=> + array(2) { + [0]=> + array(0) { + } + [1]=> + int(0) + } + [1]=> + int(0) +} diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index ef5c50c4336d2..387cc8baa7450 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -965,16 +965,22 @@ static ZEND_COLD zend_never_inline void ZEND_FASTCALL zend_binop_error(const cha static zend_never_inline void ZEND_FASTCALL add_function_array(zval *result, zval *op1, zval *op2) /* {{{ */ { - if (result == op1 && Z_ARR_P(op1) == Z_ARR_P(op2)) { - /* $a += $a */ - return; - } if (result != op1) { ZVAL_ARR(result, zend_array_dup(Z_ARR_P(op1))); + zend_hash_merge(Z_ARRVAL_P(result), Z_ARRVAL_P(op2), zval_add_ref, 0); + } else if (Z_ARR_P(op1) == Z_ARR_P(op2)) { + /* $a += $a */ } else { - SEPARATE_ARRAY(result); + /* We have to duplicate op1 (even with refcount == 1) because it may be an element of op2 + * and therefore its reference counter may be increased by zend_hash_merge(). That leads to + * an assertion in _zend_hash_add_or_update_i() that only allows adding elements to hash + * tables with RC1. See GH-10085 and Zend/tests/gh10085*.phpt */ + zval tmp; + ZVAL_ARR(&tmp, zend_array_dup(Z_ARR_P(op1))); + zend_hash_merge(Z_ARRVAL(tmp), Z_ARRVAL_P(op2), zval_add_ref, 0); + zval_ptr_dtor(result); + ZVAL_COPY_VALUE(result, &tmp); } - zend_hash_merge(Z_ARRVAL_P(result), Z_ARRVAL_P(op2), zval_add_ref, 0); } /* }}} */ From 8a749c79d02b373e8bae6999ab7a7ad621b57e6a Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 3 Apr 2023 18:15:41 +0300 Subject: [PATCH 17/51] Tracing JIT: Fixed incorrect code generation fofr SEND-ing of result of ASSIGN to typed reference --- ext/opcache/jit/zend_jit_trace.c | 8 ++++++++ ext/opcache/tests/jit/assign_056.phpt | 21 +++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 ext/opcache/tests/jit/assign_056.phpt diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index eac9719a98c2c..c0dc07d684645 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -4979,6 +4979,14 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par res_addr = 0; } else { res_addr = RES_REG_ADDR(); + if (Z_MODE(res_addr) != IS_REG + && zend_jit_trace_next_is_send_result(opline, p, frame)) { + send_result = 1; + res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_RX, (opline+1)->result.var); + if (!zend_jit_reuse_ip(&dasm_state)) { + goto jit_failure; + } + } } if (!zend_jit_assign_to_typed_ref(&dasm_state, opline, opline->op2_type, op2_addr, res_addr, 1)) { goto jit_failure; diff --git a/ext/opcache/tests/jit/assign_056.phpt b/ext/opcache/tests/jit/assign_056.phpt new file mode 100644 index 0000000000000..5ad56213c305e --- /dev/null +++ b/ext/opcache/tests/jit/assign_056.phpt @@ -0,0 +1,21 @@ +--TEST-- +JIT ASSIGN: ASSING+SEND and typed reference +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_update_protection=0 +opcache.jit_buffer_size=1M +opcache.protect_memory=1 +--FILE-- + +--EXPECT-- +object(Test)#2 (0) { +} From 3a21a8744389fcbf2f40d87d5a3a7e02d56bfce8 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Mon, 3 Apr 2023 16:55:12 +0200 Subject: [PATCH 18/51] [skip ci] Notify Slack on nightly failure --- .github/actions/notify-slack/action.yml | 15 +++++++++ .github/workflows/nightly.yml | 45 +++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 .github/actions/notify-slack/action.yml diff --git a/.github/actions/notify-slack/action.yml b/.github/actions/notify-slack/action.yml new file mode 100644 index 0000000000000..f447894a21d7a --- /dev/null +++ b/.github/actions/notify-slack/action.yml @@ -0,0 +1,15 @@ +name: Notify Slack +inputs: + token: + required: true +runs: + using: composite + steps: + - name: Notify Slack + if: always() + uses: ravsamhq/notify-slack-action@v1 + with: + status: ${{ job.status }} + notify_when: 'failure' + env: + SLACK_WEBHOOK_URL: ${{ inputs.token }} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 22dbe8d061b9b..ac6473ac74862 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -30,6 +30,11 @@ jobs: - name: Generate Matrix id: set-matrix run: php .github/nightly_matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}" + - name: Notify Slack + if: always() + uses: ./.github/actions/notify-slack + with: + token: ${{ secrets.ACTION_MONITORING_SLACK }} LINUX_X64: needs: GENERATE_MATRIX if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }} @@ -104,6 +109,11 @@ jobs: -d opcache.jit=1205 - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files + - name: Notify Slack + if: always() + uses: ./.github/actions/notify-slack + with: + token: ${{ secrets.ACTION_MONITORING_SLACK }} LINUX_X32: needs: GENERATE_MATRIX if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }} @@ -175,6 +185,11 @@ jobs: -d opcache.enable_cli=1 -d opcache.jit_buffer_size=16M -d opcache.jit=1205 + - name: Notify Slack + if: always() + uses: ./.github/actions/notify-slack + with: + token: ${{ secrets.ACTION_MONITORING_SLACK }} MACOS: needs: GENERATE_MATRIX if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }} @@ -233,6 +248,11 @@ jobs: -d opcache.jit=1205 - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files + - name: Notify Slack + if: always() + uses: ./.github/actions/notify-slack + with: + token: ${{ secrets.ACTION_MONITORING_SLACK }} COVERAGE_DEBUG_NTS: if: github.repository_owner == 'php' || github.event_name == 'workflow_dispatch' runs-on: ubuntu-20.04 @@ -267,6 +287,11 @@ jobs: - name: Upload Test Coverage to Codecov.io if: always() run: bash <(curl -s https://codecov.io/bash) + - name: Notify Slack + if: always() + uses: ./.github/actions/notify-slack + with: + token: ${{ secrets.ACTION_MONITORING_SLACK }} COMMUNITY: needs: GENERATE_MATRIX if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }} @@ -382,6 +407,11 @@ jobs: if [ $EXIT_CODE -gt 128 ]; then exit 1 fi + - name: Notify Slack + if: always() + uses: ./.github/actions/notify-slack + with: + token: ${{ secrets.ACTION_MONITORING_SLACK }} OPCACHE_VARIATION: needs: GENERATE_MATRIX if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }} @@ -453,6 +483,11 @@ jobs: -d opcache.file_cache_only=1 - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files + - name: Notify Slack + if: always() + uses: ./.github/actions/notify-slack + with: + token: ${{ secrets.ACTION_MONITORING_SLACK }} MSAN: needs: GENERATE_MATRIX if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }} @@ -545,6 +580,11 @@ jobs: -d opcache.enable_cli=1 - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files + - name: Notify Slack + if: always() + uses: ./.github/actions/notify-slack + with: + token: ${{ secrets.ACTION_MONITORING_SLACK }} LIBMYSQLCLIENT: needs: GENERATE_MATRIX if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }} @@ -600,3 +640,8 @@ jobs: withMysqli: ${{ matrix.branch.ref == 'PHP-8.1' }} - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files + - name: Notify Slack + if: always() + uses: ./.github/actions/notify-slack + with: + token: ${{ secrets.ACTION_MONITORING_SLACK }} From 0579beb84228242466143c685d4034dc4152c3a3 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Thu, 30 Mar 2023 21:28:09 +0200 Subject: [PATCH 19/51] Fix incorrect error handling in dom_zvals_to_fragment() Discovered this pre-existing problem while testing GH-10682. Note: this problem existed *before* that PR. * Not all paths throw a hierarchy request error * xmlFreeNode must be used instead of xmlFree for the fragment to also free its children. * Free up nodes that couldn't be added when xmlAddChild fails. I unified the error handling code that's exactly the same with a goto to prevent at least some of such problems in the future. Closes GH-10981. --- NEWS | 1 + ext/dom/parentnode.c | 33 +++++++++++++-------------------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/NEWS b/NEWS index 8752a5009000e..7de39a848302c 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,7 @@ PHP NEWS - DOM: . Fixed bug #80602 (Segfault when using DOMChildNode::before()). (Nathan Freeman) + . Fixed incorrect error handling in dom_zvals_to_fragment(). (nielsdos) - PCRE: . Fixed bug GH-10968 (Segfault in preg_replace_callback_array()). (ilutov) diff --git a/ext/dom/parentnode.c b/ext/dom/parentnode.c index 29880a54ada66..cf823057d22ae 100644 --- a/ext/dom/parentnode.c +++ b/ext/dom/parentnode.c @@ -162,9 +162,8 @@ xmlNode* dom_zvals_to_fragment(php_libxml_ref_obj *document, xmlNode *contextNod newNode = dom_object_get_node(newNodeObj); if (newNode->doc != documentNode) { - xmlFree(fragment); php_dom_throw_error(WRONG_DOCUMENT_ERR, stricterror); - return NULL; + goto err; } if (newNode->parent != NULL) { @@ -175,10 +174,7 @@ xmlNode* dom_zvals_to_fragment(php_libxml_ref_obj *document, xmlNode *contextNod xmlSetTreeDoc(newNode, documentNode); if (newNode->type == XML_ATTRIBUTE_NODE) { - xmlFree(fragment); - - php_dom_throw_error(HIERARCHY_REQUEST_ERR, stricterror); - return NULL; + goto hierarchy_request_err; } /* @@ -191,21 +187,16 @@ xmlNode* dom_zvals_to_fragment(php_libxml_ref_obj *document, xmlNode *contextNod } if (!xmlAddChild(fragment, newNode)) { - xmlFree(fragment); if (nodesc > 1) { xmlFreeNode(newNode); } - - php_dom_throw_error(HIERARCHY_REQUEST_ERR, stricterror); - return NULL; + goto hierarchy_request_err; } continue; } else { - xmlFree(fragment); - zend_argument_type_error(i + 1, "must be of type DOMNode|string, %s given", zend_zval_type_name(&nodes[i])); - return NULL; + goto err; } } else if (Z_TYPE(nodes[i]) == IS_STRING) { newNode = xmlNewDocText(documentNode, (xmlChar *) Z_STRVAL(nodes[i])); @@ -213,20 +204,22 @@ xmlNode* dom_zvals_to_fragment(php_libxml_ref_obj *document, xmlNode *contextNod xmlSetTreeDoc(newNode, documentNode); if (!xmlAddChild(fragment, newNode)) { - xmlFree(fragment); - - return NULL; + xmlFreeNode(newNode); + goto hierarchy_request_err; } } else { - xmlFree(fragment); - zend_argument_type_error(i + 1, "must be of type DOMNode|string, %s given", zend_zval_type_name(&nodes[i])); - - return NULL; + goto err; } } return fragment; + +hierarchy_request_err: + php_dom_throw_error(HIERARCHY_REQUEST_ERR, stricterror); +err: + xmlFreeNode(fragment); + return NULL; } static void dom_fragment_assign_parent_node(xmlNodePtr parentNode, xmlNodePtr fragment) From b81ce297a1334267baf9e86f3fbb11ee0057a1cc Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 29 Jan 2023 23:32:52 +0100 Subject: [PATCH 20/51] Fix GH-9397: exif read : warnings and errors : Potentially invalid endianess, Illegal IFD size and Undefined index Don't misinterpret DJI info maker note as DJI maker note. The DJI and DJI info maker note both share the "DJI" make string. This caused the current code to try to interpret the DJI info maker note as a DJI maker note. However, the DJI info maker note requires custom parsing. Therefore, the misinterpretation actually caused the current code to believe that there was an unrecoverable error in the IFD for the maker note by returning false in the maker note parser. This in turn caused the inability to parse other EXIF metadata. This patch adds the identification of the DJI info maker note so that it cannot be misinterpreted. Since we don't implement custom parsing, it achieves this by setting the tag list to a special marker value (in this case the NULL pointer). When this marker value is detected, the function will just skip parsing the maker note and return true. Therefore, the other code will believe that the IFD is not corrupt. This approach is similar to handing an unrecognised maker note type (see the loop on top of exif_process_IFD_in_MAKERNOTE() which also returns true and treats it as a string). The end result of this patch is that the DJI info maker note is considered as unknown to the caller of exif_process_IFD_in_MAKERNOTE(), and therefore that the other EXIF metadata can be parsed successfully. Also fix debug output typos in exif. Closes GH-10470. --- NEWS | 4 ++++ ext/exif/exif.c | 16 +++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 7de39a848302c..e05bdac1e3d23 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,10 @@ PHP NEWS (Nathan Freeman) . Fixed incorrect error handling in dom_zvals_to_fragment(). (nielsdos) +- Exif: + . Fixed bug GH-9397 (exif read : warnings and errors : Potentially invalid + endianess, Illegal IFD size and Undefined index). (nielsdos) + - PCRE: . Fixed bug GH-10968 (Segfault in preg_replace_callback_array()). (ilutov) diff --git a/ext/exif/exif.c b/ext/exif/exif.c index 74dba4bf6985f..273149ccbb845 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -1277,6 +1277,9 @@ typedef struct { mn_offset_mode_t offset_mode; } maker_note_type; +/* Some maker notes (e.g. DJI info tag) require custom parsing */ +#define REQUIRES_CUSTOM_PARSING NULL + /* Remember to update PHP_MINFO if updated */ static const maker_note_type maker_note_array[] = { { tag_table_VND_CANON, "Canon", NULL, 0, 0, MN_ORDER_INTEL, MN_OFFSET_NORMAL}, @@ -1287,6 +1290,7 @@ static const maker_note_type maker_note_array[] = { { tag_table_VND_OLYMPUS, "OLYMPUS OPTICAL CO.,LTD", "OLYMP\x00\x01\x00", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL}, { tag_table_VND_SAMSUNG, "SAMSUNG", NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL}, { tag_table_VND_PANASONIC, "Panasonic", "Panasonic\x00\x00\x00", 12, 12, MN_ORDER_NORMAL, MN_OFFSET_NORMAL}, + { REQUIRES_CUSTOM_PARSING, "DJI", "[ae_dbg_info:", 13, 13, MN_ORDER_MOTOROLA, MN_OFFSET_NORMAL}, { tag_table_VND_DJI, "DJI", NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL}, { tag_table_VND_SONY, "SONY", "SONY DSC \x00\x00\x00", 12, 12, MN_ORDER_NORMAL, MN_OFFSET_NORMAL}, { tag_table_VND_SONY, "SONY", NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL}, @@ -3168,10 +3172,16 @@ static bool exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * val return true; } + if (UNEXPECTED(maker_note->tag_table == REQUIRES_CUSTOM_PARSING)) { + /* Custom parsing required, which is not implemented at this point + * Return true so that other metadata can still be parsed. */ + return true; + } + dir_start = value_ptr + maker_note->offset; #ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process %s @x%04X + 0x%04X=%d: %s", exif_get_sectionname(section_index), (intptr_t)dir_start-(intptr_t)info->offset_base+maker_note->offset+displacement, value_len, value_len, exif_char_dump(value_ptr, value_len, (intptr_t)dir_start-(intptr_t)info->offset_base+maker_note->offset+displacement)); + exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process %s @0x%04X + 0x%04X=%d: %s", exif_get_sectionname(section_index), (intptr_t)dir_start-(intptr_t)info->offset_base+maker_note->offset+displacement, value_len, value_len, exif_char_dump(value_ptr, value_len, (intptr_t)dir_start-(intptr_t)info->offset_base+maker_note->offset+displacement)); #endif ImageInfo->sections_found |= FOUND_MAKERNOTE; @@ -3330,7 +3340,7 @@ static bool exif_process_IFD_TAG_impl(image_info_type *ImageInfo, char *dir_entr #ifdef EXIF_DEBUG dump_data = exif_dump_data(&dump_free, format, components, ImageInfo->motorola_intel, value_ptr); exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, - "Process tag(x%04X=%s,@x%04X + x%04X(=%d)): %s%s %s", + "Process tag(x%04X=%s,@0x%04X + x%04X(=%d)): %s%s %s", tag, exif_get_tagname_debug(tag, tag_table), offset_val+displacement, byte_count, byte_count, (components>1)&&format!=TAG_FMT_UNDEFINED&&format!=TAG_FMT_STRING?"ARRAY OF ":"", exif_get_tagformat(format), dump_data); if (dump_free) { efree(dump_data); @@ -4173,7 +4183,7 @@ static bool exif_process_IFD_in_TIFF_impl(image_info_type *ImageInfo, size_t dir } entry_offset = php_ifd_get32u(dir_entry+8, ImageInfo->motorola_intel); #ifdef EXIF_DEBUG - exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Next IFD: %s @x%04X", exif_get_sectionname(sub_section_index), entry_offset); + exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Next IFD: %s @0x%04X", exif_get_sectionname(sub_section_index), entry_offset); #endif exif_process_IFD_in_TIFF(ImageInfo, entry_offset, sub_section_index); if (section_index!=SECTION_THUMBNAIL && entry_tag==TAG_SUB_IFD) { From 15802dfc62c2c5ee371032dd34110abdad6f367e Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Thu, 6 Apr 2023 15:59:34 +0100 Subject: [PATCH 21/51] Add FPM FastCGI env var test for Apache without path info fix --- ...pif-apache-handler-with-pi-with-pt-pd.phpt | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 sapi/fpm/tests/fcgi-env-nopif-apache-handler-with-pi-with-pt-pd.phpt diff --git a/sapi/fpm/tests/fcgi-env-nopif-apache-handler-with-pi-with-pt-pd.phpt b/sapi/fpm/tests/fcgi-env-nopif-apache-handler-with-pi-with-pt-pd.phpt new file mode 100644 index 0000000000000..a2aa4164fc3bc --- /dev/null +++ b/sapi/fpm/tests/fcgi-env-nopif-apache-handler-with-pi-with-pt-pd.phpt @@ -0,0 +1,58 @@ +--TEST-- +FPM: FastCGI env var without path info fix for Apache handler with PATH_INFO, PATH_TRANSLATED and path discard +--SKIPIF-- + +--FILE-- +createSourceFileAndScriptName(); +$tester->start(); +$tester->expectLogStartNotices(); +$tester + ->request( + headers: [ + 'PATH_INFO' => '/pinfo', + 'PATH_TRANSLATED' => __DIR__ . '/pinfo', + ], + uri: $scriptName . '/pinfo', + scriptFilename: "proxy:fcgi://" . $tester->getAddr() . $sourceFilePath, + scriptName: $scriptName, + ) + ->expectBody([$scriptName, $sourceFilePath, '/pinfo', '/pinfo']); +$tester->terminate(); +$tester->close(); + +?> +Done +--EXPECT-- +Done +--CLEAN-- + From ebb3213f7930e57b8a199e17d69f13c5f4d9d2a9 Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Fri, 7 Apr 2023 12:28:42 +0100 Subject: [PATCH 22/51] Add FPM FCGI env Apache handler UDS test --- .../fcgi-env-pif-apache-handler-uds.phpt | 53 +++++++++++++++++++ ... fcgi-env-pif-apache-handler-with-pi.phpt} | 2 +- 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 sapi/fpm/tests/fcgi-env-pif-apache-handler-uds.phpt rename sapi/fpm/tests/{fcgi-env-pif-apache-handler-basic.phpt => fcgi-env-pif-apache-handler-with-pi.phpt} (94%) diff --git a/sapi/fpm/tests/fcgi-env-pif-apache-handler-uds.phpt b/sapi/fpm/tests/fcgi-env-pif-apache-handler-uds.phpt new file mode 100644 index 0000000000000..b80fdef3ffdf6 --- /dev/null +++ b/sapi/fpm/tests/fcgi-env-pif-apache-handler-uds.phpt @@ -0,0 +1,53 @@ +--TEST-- +FPM: FastCGI env var path info fix for Apache handler using Unix Domain Socket +--SKIPIF-- + +--FILE-- +createSourceFileAndScriptName(); +$tester->start(); +$tester->expectLogStartNotices(); +$tester + ->request( + uri: $scriptName, + address: '{{ADDR:UDS}}', + scriptFilename: "proxy:fcgi://localhost" . $sourceFilePath, + scriptName: $scriptName, + ) + ->expectBody([$scriptName, $sourceFilePath, $scriptName]); +$tester->terminate(); +$tester->close(); + +?> +Done +--EXPECT-- +Done +--CLEAN-- + diff --git a/sapi/fpm/tests/fcgi-env-pif-apache-handler-basic.phpt b/sapi/fpm/tests/fcgi-env-pif-apache-handler-with-pi.phpt similarity index 94% rename from sapi/fpm/tests/fcgi-env-pif-apache-handler-basic.phpt rename to sapi/fpm/tests/fcgi-env-pif-apache-handler-with-pi.phpt index a99f373cf3321..2d8433123cb2d 100644 --- a/sapi/fpm/tests/fcgi-env-pif-apache-handler-basic.phpt +++ b/sapi/fpm/tests/fcgi-env-pif-apache-handler-with-pi.phpt @@ -1,5 +1,5 @@ --TEST-- -FPM: FastCGI env var path info fix for Apache handler basic +FPM: FastCGI env var path info fix for Apache handler with PATH_INFO set --SKIPIF-- --FILE-- From e67bb14ab42232eefe301e699a755333492b403b Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Fri, 7 Apr 2023 16:52:39 +0100 Subject: [PATCH 23/51] Fixed tests and remove the XFAIL 'Various bugs exist'. They did, but they were in the tests --- .../tests/DateTime_add-fall-type2-type3.phpt | 42 +++++++++---------- .../tests/DateTime_add-fall-type3-type2.phpt | 6 +-- .../tests/DateTime_add-fall-type3-type3.phpt | 6 +-- .../DateTime_add-spring-type2-type3.phpt | 22 +++++----- .../DateTime_add-spring-type3-type2.phpt | 8 ++-- .../DateTime_add-spring-type3-type3.phpt | 8 ++-- .../tests/DateTime_diff-fall-type2-type3.phpt | 6 +-- .../tests/DateTime_diff-fall-type3-type2.phpt | 6 +-- .../tests/DateTime_diff-fall-type3-type3.phpt | 4 +- .../DateTime_diff-spring-type2-type3.phpt | 10 ++--- .../DateTime_diff-spring-type3-type2.phpt | 10 ++--- .../DateTime_diff-spring-type3-type3.phpt | 10 ++--- .../tests/DateTime_sub-fall-type2-type3.phpt | 6 +-- .../tests/DateTime_sub-fall-type3-type2.phpt | 40 +++++++++--------- .../tests/DateTime_sub-fall-type3-type3.phpt | 6 +-- .../DateTime_sub-spring-type2-type3.phpt | 8 ++-- .../DateTime_sub-spring-type3-type2.phpt | 22 +++++----- .../DateTime_sub-spring-type3-type3.phpt | 8 ++-- ext/date/tests/examine_diff.inc | 1 - ...ime_and_daylight_saving_time-type3-fa.phpt | 7 ++++ 20 files changed, 104 insertions(+), 132 deletions(-) diff --git a/ext/date/tests/DateTime_add-fall-type2-type3.phpt b/ext/date/tests/DateTime_add-fall-type2-type3.phpt index 077dd565d1dba..10e4ed36e7c5e 100644 --- a/ext/date/tests/DateTime_add-fall-type2-type3.phpt +++ b/ext/date/tests/DateTime_add-fall-type2-type3.phpt @@ -2,8 +2,6 @@ DateTime::add() -- fall type2 type3 --CREDITS-- Daniel Convissor ---XFAIL-- -Various bugs exist --FILE-- ---XFAIL-- -Various bugs exist --FILE-- ---XFAIL-- -Various bugs exist --FILE-- ---XFAIL-- -Various bugs exist --FILE-- ---XFAIL-- -Various bugs exist --FILE-- ---XFAIL-- -Various bugs exist --FILE-- ---XFAIL-- -Various bugs exist --FILE-- ---XFAIL-- -Various bugs exist --FILE-- ---XFAIL-- -Various bugs exist --FILE-- ---XFAIL-- -Various bugs exist --FILE-- ---XFAIL-- -Various bugs exist --FILE-- ---XFAIL-- -Various bugs exist --FILE-- ---XFAIL-- -Various bugs exist --FILE-- ---XFAIL-- -Various bugs exist --FILE-- ---XFAIL-- -Various bugs exist --FILE-- ---XFAIL-- -Various bugs exist --FILE-- ---XFAIL-- -Various bugs exist --FILE-- add($expect_interval); $result_end_date = $start->format('Y-m-d H:i:s T'); echo "ADD: $start_date + $expect_spec = **$result_end_date**\n"; - // echo "ADD: $start_date + $expect_spec = **$end_date**\n"; } if (PHPT_DATETIME_SHOW == PHPT_DATETIME_SHOW_SUB) { $end->sub($expect_interval); diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fa.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fa.phpt index df67b5a89db75..45d0d13ce921a 100644 --- a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fa.phpt +++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fa.phpt @@ -25,6 +25,12 @@ $interval = new DateInterval($interval_spec); echo 'fa2 ' . $start->format($date_format) . " + $interval_spec = " . $start->add($interval)->format($date_format) . "\n"; +$start = new DateTime('2010-03-13 04:30:00'); +$interval_spec = 'PT23H'; +$interval = new DateInterval($interval_spec); +echo 'fa2.5 ' . $start->format($date_format) . " + $interval_spec = " + . $start->add($interval)->format($date_format) . "\n"; + $start = new DateTime('2010-03-13 04:30:00'); $interval_spec = 'PT22H'; $interval = new DateInterval($interval_spec); @@ -52,6 +58,7 @@ echo 'fa6 ' . $start->format($date_format) . " + $interval_spec = " --EXPECT-- fa1 2010-03-14 01:59:59 EST America/New_York + PT1S = 2010-03-14 03:00:00 EDT America/New_York fa2 2010-03-13 04:30:00 EST America/New_York + P1D = 2010-03-14 04:30:00 EDT America/New_York +fa2.5 2010-03-13 04:30:00 EST America/New_York + PT23H = 2010-03-14 04:30:00 EDT America/New_York fa3 2010-03-13 04:30:00 EST America/New_York + PT22H = 2010-03-14 03:30:00 EDT America/New_York fa4 2010-03-13 04:30:00 EST America/New_York + PT21H = 2010-03-14 01:30:00 EST America/New_York fa5 2010-03-13 01:30:00 EST America/New_York + P1D = 2010-03-14 01:30:00 EST America/New_York From 51faf04dbdf70bb91e436c5658fd8ca56ccc62ef Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Wed, 15 Mar 2023 21:18:37 +0100 Subject: [PATCH 24/51] Fix GH-10737: PHP 8.1.16 segfaults on line 597 of sapi/apache2handler/sapi_apache2.c The TSRM keeps a hashtable mapping the thread IDs to the thread resource pointers. It's possible that the thread disappears without us knowing, and then another thread gets spawned some time later with the same ID as the disappeared thread. Note that since it's a new thread the TSRM key pointer and cached pointer will be NULL. The Apache request handler `php_handler()` will try to fetch some fields from the SAPI globals. It uses a lazy thread resource allocation by calling `ts_resource(0);`. This allocates a thread resource and sets up the TSRM pointers if they haven't been set up yet. At least, that's what's supposed to happen. But since we are in a situation where the thread ID still has the resources of the *old* thread associated in the hashtable, the loop in `ts_resource_ex` will find that thread resource and assume the thread has been setup already. But this is not the case since this thread is actually a new thread, just reusing the ID of the old one, without any relation whatsoever to the old thread. Because of this assumption, the TSRM pointers will not be setup, leading to a NULL pointer dereference when trying to access the SAPI globals. We can easily detect this scenario: if we're in the fallback path, and the pointer is NULL, and we're looking for our own thread resource, we know we're actually reusing a thread ID. In that case, we'll free up the old thread resources gracefully (gracefully because there might still be resources open like database connection which need to be shut down cleanly). After freeing the resources, we'll create the new resources for this thread as if the stale resources never existed in the first place. From that point forward, it is as if that situation never occurred. The fact that this situation happens isn't that bad because a child process containing threads will eventually be respawned anyway by the SAPI, so the stale thread resources won't remain forever. Note that we can't simply assign our own TSRM pointers to the existing thread resource for our ID, since it was actually from a different thread (just with the same ID!). Furthermore, the dynamically loaded extensions have their own pointer, which is only set when their constructor is called, so we'd have to call their constructor anyway... I also tried to call the dtor and then the ctor again for those resources on the pre-existing thread resource to reuse storage, but that didn't work properly because other code doesn't expect something like that to happen, which breaks assumptions, and this in turn caused Valgrind to (rightfully) complain about memory bugs. Note 2: I also had to fix a bug in the core globals destruction because it always assumed that the thread destroying them was the owning thread, which on TSRM shutdown isn't always the case. A similar bug was fixed recently with the JIT globals. Closes GH-10863. --- NEWS | 2 + TSRM/TSRM.c | 114 +++++++++++++++++++++++++++++------------------ main/main.c | 2 +- main/php_ticks.c | 4 +- main/php_ticks.h | 2 +- 5 files changed, 76 insertions(+), 48 deletions(-) diff --git a/NEWS b/NEWS index e05bdac1e3d23..41acc3f4d15b3 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,8 @@ PHP NEWS (nielsdos) . Fixed bug GH-10085 (Assertion when adding two arrays with += where the first array is contained in the second). (ilutov) + . Fixed bug GH-10737 (PHP 8.1.16 segfaults on line 597 of + sapi/apache2handler/sapi_apache2.c). (nielsdos) - DOM: . Fixed bug #80602 (Segfault when using DOMChildNode::before()). diff --git a/TSRM/TSRM.c b/TSRM/TSRM.c index 7cd924318ed4c..62be0a4214815 100644 --- a/TSRM/TSRM.c +++ b/TSRM/TSRM.c @@ -161,6 +161,23 @@ TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debu return 1; }/*}}}*/ +static void ts_free_resources(tsrm_tls_entry *thread_resources) +{ + /* Need to destroy in reverse order to respect dependencies. */ + for (int i = thread_resources->count - 1; i >= 0; i--) { + if (!resource_types_table[i].done) { + if (resource_types_table[i].dtor) { + resource_types_table[i].dtor(thread_resources->storage[i]); + } + + if (!resource_types_table[i].fast_offset) { + free(thread_resources->storage[i]); + } + } + } + + free(thread_resources->storage); +} /* Shutdown TSRM (call once for the entire process) */ TSRM_API void tsrm_shutdown(void) @@ -183,25 +200,13 @@ TSRM_API void tsrm_shutdown(void) tsrm_tls_entry *p = tsrm_tls_table[i], *next_p; while (p) { - int j; - next_p = p->next; - for (j=0; jcount; j++) { - if (p->storage[j]) { - if (resource_types_table) { - if (!resource_types_table[j].done) { - if (resource_types_table[j].dtor) { - resource_types_table[j].dtor(p->storage[j]); - } - - if (!resource_types_table[j].fast_offset) { - free(p->storage[j]); - } - } - } - } + if (resource_types_table) { + /* This call will already free p->storage for us */ + ts_free_resources(p); + } else { + free(p->storage); } - free(p->storage); free(p); p = next_p; } @@ -367,7 +372,13 @@ TSRM_API ts_rsrc_id ts_allocate_fast_id(ts_rsrc_id *rsrc_id, size_t *offset, siz return *rsrc_id; }/*}}}*/ +static void set_thread_local_storage_resource_to(tsrm_tls_entry *thread_resource) +{ + tsrm_tls_set(thread_resource); + TSRMLS_CACHE = thread_resource; +} +/* Must be called with tsmm_mutex held */ static void allocate_new_resource(tsrm_tls_entry **thread_resources_ptr, THREAD_T thread_id) {/*{{{*/ int i; @@ -383,8 +394,7 @@ static void allocate_new_resource(tsrm_tls_entry **thread_resources_ptr, THREAD_ (*thread_resources_ptr)->next = NULL; /* Set thread local storage to this new thread resources structure */ - tsrm_tls_set(*thread_resources_ptr); - TSRMLS_CACHE = *thread_resources_ptr; + set_thread_local_storage_resource_to(*thread_resources_ptr); if (tsrm_new_thread_begin_handler) { tsrm_new_thread_begin_handler(thread_id); @@ -407,17 +417,14 @@ static void allocate_new_resource(tsrm_tls_entry **thread_resources_ptr, THREAD_ if (tsrm_new_thread_end_handler) { tsrm_new_thread_end_handler(thread_id); } - - tsrm_mutex_unlock(tsmm_mutex); }/*}}}*/ - /* fetches the requested resource for the current thread */ TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id) {/*{{{*/ THREAD_T thread_id; int hash_value; - tsrm_tls_entry *thread_resources; + tsrm_tls_entry *thread_resources, **last_thread_resources; if (!th_id) { /* Fast path for looking up the resources for the current @@ -448,25 +455,55 @@ TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id) if (!thread_resources) { allocate_new_resource(&tsrm_tls_table[hash_value], thread_id); + tsrm_mutex_unlock(tsmm_mutex); return ts_resource_ex(id, &thread_id); } else { - do { - if (thread_resources->thread_id == thread_id) { - break; - } + last_thread_resources = &tsrm_tls_table[hash_value]; + while (thread_resources->thread_id != thread_id) { + last_thread_resources = &thread_resources->next; if (thread_resources->next) { thread_resources = thread_resources->next; } else { allocate_new_resource(&thread_resources->next, thread_id); + tsrm_mutex_unlock(tsmm_mutex); return ts_resource_ex(id, &thread_id); - /* - * thread_resources = thread_resources->next; - * break; - */ } - } while (thread_resources); + } + } + + /* It's possible that the current thread resources are requested, and that we get here. + * This means that the TSRM key pointer and cached pointer are NULL, but there is still + * a thread resource associated with this ID in the hashtable. This can occur if a thread + * goes away, but its resources are never cleaned up, and then that thread ID is reused. + * Since we don't always have a way to know when a thread goes away, we can't clean up + * the thread's resources before the new thread spawns. + * To solve this issue, we'll free up the old thread resources gracefully (gracefully + * because there might still be resources open like database connection which need to + * be shut down cleanly). After freeing up, we'll create the new resources for this thread + * as if the stale resources never existed in the first place. From that point forward, + * it is as if that situation never occurred. + * The fact that this situation happens isn't that bad because a child process containing + * threads will eventually be respawned anyway by the SAPI, so the stale threads won't last + * forever. */ + TSRM_ASSERT(thread_resources->thread_id == thread_id); + if (thread_id == tsrm_thread_id() && !tsrm_tls_get()) { + tsrm_tls_entry *next = thread_resources->next; + /* In case that extensions don't use the pointer passed from the dtor, but incorrectly + * use the global pointer, we need to setup the global pointer temporarily here. */ + set_thread_local_storage_resource_to(thread_resources); + /* Free up the old resource from the old thread instance */ + ts_free_resources(thread_resources); + free(thread_resources); + /* Allocate a new resource at the same point in the linked list, and relink the next pointer */ + allocate_new_resource(last_thread_resources, thread_id); + thread_resources = *last_thread_resources; + thread_resources->next = next; + /* We don't have to tail-call ts_resource_ex, we can take the fast path to the return + * because we already have the correct pointer. */ } + tsrm_mutex_unlock(tsmm_mutex); + /* Read a specific resource from the thread's resources. * This is called outside of a mutex, so have to be aware about external * changes to the structure as we read it. @@ -479,7 +516,6 @@ TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id) void ts_free_thread(void) {/*{{{*/ tsrm_tls_entry *thread_resources; - int i; THREAD_T thread_id = tsrm_thread_id(); int hash_value; tsrm_tls_entry *last=NULL; @@ -492,17 +528,7 @@ void ts_free_thread(void) while (thread_resources) { if (thread_resources->thread_id == thread_id) { - for (i=0; icount; i++) { - if (resource_types_table[i].dtor) { - resource_types_table[i].dtor(thread_resources->storage[i]); - } - } - for (i=0; icount; i++) { - if (!resource_types_table[i].fast_offset) { - free(thread_resources->storage[i]); - } - } - free(thread_resources->storage); + ts_free_resources(thread_resources); if (last) { last->next = thread_resources->next; } else { diff --git a/main/main.c b/main/main.c index 3d7ca29138387..4868d2df40039 100644 --- a/main/main.c +++ b/main/main.c @@ -1936,7 +1936,7 @@ static void core_globals_dtor(php_core_globals *core_globals) free(core_globals->php_binary); } - php_shutdown_ticks(); + php_shutdown_ticks(core_globals); } /* }}} */ diff --git a/main/php_ticks.c b/main/php_ticks.c index 004314583bdb0..70201ddecd08d 100644 --- a/main/php_ticks.c +++ b/main/php_ticks.c @@ -34,9 +34,9 @@ void php_deactivate_ticks(void) zend_llist_clean(&PG(tick_functions)); } -void php_shutdown_ticks(void) +void php_shutdown_ticks(php_core_globals *core_globals) { - zend_llist_destroy(&PG(tick_functions)); + zend_llist_destroy(&core_globals->tick_functions); } static int php_compare_tick_functions(void *elem1, void *elem2) diff --git a/main/php_ticks.h b/main/php_ticks.h index 5edf7a483bbac..270ea5348fd2a 100644 --- a/main/php_ticks.h +++ b/main/php_ticks.h @@ -19,7 +19,7 @@ int php_startup_ticks(void); void php_deactivate_ticks(void); -void php_shutdown_ticks(void); +void php_shutdown_ticks(php_core_globals *core_globals); void php_run_ticks(int count); BEGIN_EXTERN_C() From 7cef7cb0ee02993fa97bbc0d00ec25470bdb2ed2 Mon Sep 17 00:00:00 2001 From: Alex Dowad Date: Mon, 10 Apr 2023 19:47:03 +0200 Subject: [PATCH 25/51] Add more details in UPGRADING on mb_check_encoding changes --- UPGRADING | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/UPGRADING b/UPGRADING index 05b33b231ee34..b025364400f4b 100644 --- a/UPGRADING +++ b/UPGRADING @@ -219,7 +219,8 @@ PHP 8.2 UPGRADE NOTES is still accepted, but it is recommended to use the new standard variant. - MBString - . mb_check_encoding() now checks input encoding more strictly. + . mb_check_encoding() now checks input encoding more strictly for + certain text encodings, including ISO-2022-JP and UTF-7. . mb_detect_encoding() now checks input encoding more strictly when strict detection is enabled. . mb_convert_encoding() checks the input encoding more strictly From 0c65b396d6fe4263af80a9ecdf637104a3c41084 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 10 Apr 2023 23:19:17 +0300 Subject: [PATCH 26/51] Allow FETCH_OBJ_W and FETCH_STATIC_PROP_W to return INDIRECT/UNDEF zval for uninitialized typed properties (#11048) --- Zend/Optimizer/zend_inference.c | 6 +++ Zend/zend_execute.c | 7 +-- Zend/zend_object_handlers.c | 2 + Zend/zend_vm_def.h | 6 +-- Zend/zend_vm_execute.h | 54 +++++++++---------- ext/opcache/jit/zend_jit_trace.c | 6 +-- .../tests/jit/fetch_static_prop_001.phpt | 20 +++++++ 7 files changed, 63 insertions(+), 38 deletions(-) create mode 100644 ext/opcache/tests/jit/fetch_static_prop_001.phpt diff --git a/Zend/Optimizer/zend_inference.c b/Zend/Optimizer/zend_inference.c index f85a1adea701e..ba7c302582f64 100644 --- a/Zend/Optimizer/zend_inference.c +++ b/Zend/Optimizer/zend_inference.c @@ -3436,6 +3436,9 @@ static zend_always_inline int _zend_update_type_info( tmp |= zend_fetch_prop_type(script, prop_info, &ce); if (opline->result_type == IS_VAR) { tmp |= MAY_BE_REF | MAY_BE_INDIRECT; + if ((opline->extended_value & ZEND_FETCH_OBJ_FLAGS) == ZEND_FETCH_DIM_WRITE) { + tmp |= MAY_BE_UNDEF; + } } else if (!(opline->op1_type & (IS_VAR|IS_TMP_VAR)) || !(t1 & MAY_BE_RC1)) { zend_class_entry *ce = NULL; @@ -3473,6 +3476,9 @@ static zend_always_inline int _zend_update_type_info( zend_fetch_static_prop_info(script, op_array, ssa, opline), &ce); if (opline->result_type == IS_VAR) { tmp |= MAY_BE_REF | MAY_BE_INDIRECT; + if ((opline->extended_value & ZEND_FETCH_OBJ_FLAGS) == ZEND_FETCH_DIM_WRITE) { + tmp |= MAY_BE_UNDEF; + } } else { if (!result_may_be_separated(ssa, ssa_op)) { tmp &= ~MAY_BE_RC1; diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index a46a93ad96fcc..ad4396e5d9e07 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -3087,7 +3087,7 @@ static zend_never_inline bool zend_handle_fetch_obj_flags( return 1; } -static zend_always_inline void zend_fetch_property_address(zval *result, zval *container, uint32_t container_op_type, zval *prop_ptr, uint32_t prop_op_type, void **cache_slot, int type, uint32_t flags, bool init_undef OPLINE_DC EXECUTE_DATA_DC) +static zend_always_inline void zend_fetch_property_address(zval *result, zval *container, uint32_t container_op_type, zval *prop_ptr, uint32_t prop_op_type, void **cache_slot, int type, uint32_t flags OPLINE_DC EXECUTE_DATA_DC) { zval *ptr; zend_object *zobj; @@ -3203,9 +3203,6 @@ static zend_always_inline void zend_fetch_property_address(zval *result, zval *c } } } - if (init_undef && UNEXPECTED(Z_TYPE_P(ptr) == IS_UNDEF)) { - ZVAL_NULL(ptr); - } end: if (prop_op_type != IS_CONST) { @@ -3219,7 +3216,7 @@ static zend_always_inline void zend_assign_to_property_reference(zval *container void **cache_addr = (prop_op_type == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_RETURNS_FUNCTION) : NULL; zend_fetch_property_address(variable_ptr, container, container_op_type, prop_ptr, prop_op_type, - cache_addr, BP_VAR_W, 0, 0 OPLINE_CC EXECUTE_DATA_CC); + cache_addr, BP_VAR_W, 0 OPLINE_CC EXECUTE_DATA_CC); if (EXPECTED(Z_TYPE_P(variable_ptr) == IS_INDIRECT)) { variable_ptr = Z_INDIRECT_P(variable_ptr); diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 60d27b7c91145..8f75aa0bd6903 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -1037,6 +1037,8 @@ ZEND_API zval *zend_std_get_property_ptr_ptr(zend_object *zobj, zend_string *nam } else if (prop_info && UNEXPECTED(prop_info->flags & ZEND_ACC_READONLY)) { /* Readonly property, delegate to read_property + write_property. */ retval = NULL; + } else if (!prop_info || !ZEND_TYPE_IS_SET(prop_info->type)) { + ZVAL_NULL(retval); } } else { /* we do have getter - fail and let it try again with usual get/set */ diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index e6ace6ce3a9ae..a2db0e30da7ac 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -2157,7 +2157,7 @@ ZEND_VM_HANDLER(85, ZEND_FETCH_OBJ_W, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, FETCH zend_fetch_property_address( result, container, OP1_TYPE, property, OP2_TYPE, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS) : NULL), - BP_VAR_W, opline->extended_value & ZEND_FETCH_OBJ_FLAGS, 1 OPLINE_CC EXECUTE_DATA_CC); + BP_VAR_W, opline->extended_value & ZEND_FETCH_OBJ_FLAGS OPLINE_CC EXECUTE_DATA_CC); FREE_OP2(); if (OP1_TYPE == IS_VAR) { FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); @@ -2174,7 +2174,7 @@ ZEND_VM_HANDLER(88, ZEND_FETCH_OBJ_RW, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, CACH container = GET_OP1_OBJ_ZVAL_PTR_PTR_UNDEF(BP_VAR_RW); property = GET_OP2_ZVAL_PTR(BP_VAR_R); result = EX_VAR(opline->result.var); - zend_fetch_property_address(result, container, OP1_TYPE, property, OP2_TYPE, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0, 1 OPLINE_CC EXECUTE_DATA_CC); + zend_fetch_property_address(result, container, OP1_TYPE, property, OP2_TYPE, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC); FREE_OP2(); if (OP1_TYPE == IS_VAR) { FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); @@ -2321,7 +2321,7 @@ ZEND_VM_HANDLER(97, ZEND_FETCH_OBJ_UNSET, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, C container = GET_OP1_OBJ_ZVAL_PTR_PTR_UNDEF(BP_VAR_UNSET); property = GET_OP2_ZVAL_PTR(BP_VAR_R); result = EX_VAR(opline->result.var); - zend_fetch_property_address(result, container, OP1_TYPE, property, OP2_TYPE, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0, 1 OPLINE_CC EXECUTE_DATA_CC); + zend_fetch_property_address(result, container, OP1_TYPE, property, OP2_TYPE, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0 OPLINE_CC EXECUTE_DATA_CC); FREE_OP2(); if (OP1_TYPE == IS_VAR) { FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 61921b608aaf3..388d19e3d692b 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -22808,7 +22808,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HAN zend_fetch_property_address( result, container, IS_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS) : NULL), - BP_VAR_W, opline->extended_value & ZEND_FETCH_OBJ_FLAGS, 1 OPLINE_CC EXECUTE_DATA_CC); + BP_VAR_W, opline->extended_value & ZEND_FETCH_OBJ_FLAGS OPLINE_CC EXECUTE_DATA_CC); if (IS_VAR == IS_VAR) { FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); @@ -22825,7 +22825,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_CONST_HA container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); property = RT_CONSTANT(opline, opline->op2); result = EX_VAR(opline->result.var); - zend_fetch_property_address(result, container, IS_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0, 1 OPLINE_CC EXECUTE_DATA_CC); + zend_fetch_property_address(result, container, IS_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC); if (IS_VAR == IS_VAR) { FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); @@ -22859,7 +22859,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); property = RT_CONSTANT(opline, opline->op2); result = EX_VAR(opline->result.var); - zend_fetch_property_address(result, container, IS_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0, 1 OPLINE_CC EXECUTE_DATA_CC); + zend_fetch_property_address(result, container, IS_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0 OPLINE_CC EXECUTE_DATA_CC); if (IS_VAR == IS_VAR) { FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); @@ -25506,7 +25506,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_TMPVAR_HA zend_fetch_property_address( result, container, IS_VAR, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS) : NULL), - BP_VAR_W, opline->extended_value & ZEND_FETCH_OBJ_FLAGS, 1 OPLINE_CC EXECUTE_DATA_CC); + BP_VAR_W, opline->extended_value & ZEND_FETCH_OBJ_FLAGS OPLINE_CC EXECUTE_DATA_CC); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); if (IS_VAR == IS_VAR) { FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); @@ -25523,7 +25523,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_TMPVAR_H container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); result = EX_VAR(opline->result.var); - zend_fetch_property_address(result, container, IS_VAR, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0, 1 OPLINE_CC EXECUTE_DATA_CC); + zend_fetch_property_address(result, container, IS_VAR, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); if (IS_VAR == IS_VAR) { FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); @@ -25557,7 +25557,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMPVA container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); result = EX_VAR(opline->result.var); - zend_fetch_property_address(result, container, IS_VAR, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0, 1 OPLINE_CC EXECUTE_DATA_CC); + zend_fetch_property_address(result, container, IS_VAR, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0 OPLINE_CC EXECUTE_DATA_CC); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); if (IS_VAR == IS_VAR) { FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); @@ -29714,7 +29714,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CV_HANDLE zend_fetch_property_address( result, container, IS_VAR, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS) : NULL), - BP_VAR_W, opline->extended_value & ZEND_FETCH_OBJ_FLAGS, 1 OPLINE_CC EXECUTE_DATA_CC); + BP_VAR_W, opline->extended_value & ZEND_FETCH_OBJ_FLAGS OPLINE_CC EXECUTE_DATA_CC); if (IS_VAR == IS_VAR) { FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); @@ -29731,7 +29731,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_CV_HANDL container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); result = EX_VAR(opline->result.var); - zend_fetch_property_address(result, container, IS_VAR, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0, 1 OPLINE_CC EXECUTE_DATA_CC); + zend_fetch_property_address(result, container, IS_VAR, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC); if (IS_VAR == IS_VAR) { FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); @@ -29765,7 +29765,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV_HA container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC); property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); result = EX_VAR(opline->result.var); - zend_fetch_property_address(result, container, IS_VAR, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0, 1 OPLINE_CC EXECUTE_DATA_CC); + zend_fetch_property_address(result, container, IS_VAR, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0 OPLINE_CC EXECUTE_DATA_CC); if (IS_VAR == IS_VAR) { FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); @@ -32151,7 +32151,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST_ zend_fetch_property_address( result, container, IS_UNUSED, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS) : NULL), - BP_VAR_W, opline->extended_value & ZEND_FETCH_OBJ_FLAGS, 1 OPLINE_CC EXECUTE_DATA_CC); + BP_VAR_W, opline->extended_value & ZEND_FETCH_OBJ_FLAGS OPLINE_CC EXECUTE_DATA_CC); if (IS_UNUSED == IS_VAR) { FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); @@ -32168,7 +32168,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CONST container = &EX(This); property = RT_CONSTANT(opline, opline->op2); result = EX_VAR(opline->result.var); - zend_fetch_property_address(result, container, IS_UNUSED, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0, 1 OPLINE_CC EXECUTE_DATA_CC); + zend_fetch_property_address(result, container, IS_UNUSED, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC); if (IS_UNUSED == IS_VAR) { FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); @@ -32315,7 +32315,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CO container = &EX(This); property = RT_CONSTANT(opline, opline->op2); result = EX_VAR(opline->result.var); - zend_fetch_property_address(result, container, IS_UNUSED, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0, 1 OPLINE_CC EXECUTE_DATA_CC); + zend_fetch_property_address(result, container, IS_UNUSED, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0 OPLINE_CC EXECUTE_DATA_CC); if (IS_UNUSED == IS_VAR) { FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); @@ -34004,7 +34004,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMPVAR zend_fetch_property_address( result, container, IS_UNUSED, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS) : NULL), - BP_VAR_W, opline->extended_value & ZEND_FETCH_OBJ_FLAGS, 1 OPLINE_CC EXECUTE_DATA_CC); + BP_VAR_W, opline->extended_value & ZEND_FETCH_OBJ_FLAGS OPLINE_CC EXECUTE_DATA_CC); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); if (IS_UNUSED == IS_VAR) { FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); @@ -34021,7 +34021,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_TMPVA container = &EX(This); property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); result = EX_VAR(opline->result.var); - zend_fetch_property_address(result, container, IS_UNUSED, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0, 1 OPLINE_CC EXECUTE_DATA_CC); + zend_fetch_property_address(result, container, IS_UNUSED, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); if (IS_UNUSED == IS_VAR) { FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); @@ -34168,7 +34168,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TM container = &EX(This); property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); result = EX_VAR(opline->result.var); - zend_fetch_property_address(result, container, IS_UNUSED, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0, 1 OPLINE_CC EXECUTE_DATA_CC); + zend_fetch_property_address(result, container, IS_UNUSED, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0 OPLINE_CC EXECUTE_DATA_CC); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); if (IS_UNUSED == IS_VAR) { FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); @@ -36474,7 +36474,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV_HAN zend_fetch_property_address( result, container, IS_UNUSED, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS) : NULL), - BP_VAR_W, opline->extended_value & ZEND_FETCH_OBJ_FLAGS, 1 OPLINE_CC EXECUTE_DATA_CC); + BP_VAR_W, opline->extended_value & ZEND_FETCH_OBJ_FLAGS OPLINE_CC EXECUTE_DATA_CC); if (IS_UNUSED == IS_VAR) { FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); @@ -36491,7 +36491,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CV_HA container = &EX(This); property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); result = EX_VAR(opline->result.var); - zend_fetch_property_address(result, container, IS_UNUSED, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0, 1 OPLINE_CC EXECUTE_DATA_CC); + zend_fetch_property_address(result, container, IS_UNUSED, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC); if (IS_UNUSED == IS_VAR) { FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); @@ -36638,7 +36638,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV container = &EX(This); property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); result = EX_VAR(opline->result.var); - zend_fetch_property_address(result, container, IS_UNUSED, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0, 1 OPLINE_CC EXECUTE_DATA_CC); + zend_fetch_property_address(result, container, IS_UNUSED, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0 OPLINE_CC EXECUTE_DATA_CC); if (IS_UNUSED == IS_VAR) { FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); @@ -40674,7 +40674,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CONST_HAND zend_fetch_property_address( result, container, IS_CV, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS) : NULL), - BP_VAR_W, opline->extended_value & ZEND_FETCH_OBJ_FLAGS, 1 OPLINE_CC EXECUTE_DATA_CC); + BP_VAR_W, opline->extended_value & ZEND_FETCH_OBJ_FLAGS OPLINE_CC EXECUTE_DATA_CC); if (IS_CV == IS_VAR) { FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); @@ -40691,7 +40691,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_CONST_HAN container = EX_VAR(opline->op1.var); property = RT_CONSTANT(opline, opline->op2); result = EX_VAR(opline->result.var); - zend_fetch_property_address(result, container, IS_CV, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0, 1 OPLINE_CC EXECUTE_DATA_CC); + zend_fetch_property_address(result, container, IS_CV, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC); if (IS_CV == IS_VAR) { FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); @@ -40838,7 +40838,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST_ container = EX_VAR(opline->op1.var); property = RT_CONSTANT(opline, opline->op2); result = EX_VAR(opline->result.var); - zend_fetch_property_address(result, container, IS_CV, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0, 1 OPLINE_CC EXECUTE_DATA_CC); + zend_fetch_property_address(result, container, IS_CV, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0 OPLINE_CC EXECUTE_DATA_CC); if (IS_CV == IS_VAR) { FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); @@ -44452,7 +44452,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_TMPVAR_HAN zend_fetch_property_address( result, container, IS_CV, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS) : NULL), - BP_VAR_W, opline->extended_value & ZEND_FETCH_OBJ_FLAGS, 1 OPLINE_CC EXECUTE_DATA_CC); + BP_VAR_W, opline->extended_value & ZEND_FETCH_OBJ_FLAGS OPLINE_CC EXECUTE_DATA_CC); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); if (IS_CV == IS_VAR) { FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); @@ -44469,7 +44469,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_TMPVAR_HA container = EX_VAR(opline->op1.var); property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); result = EX_VAR(opline->result.var); - zend_fetch_property_address(result, container, IS_CV, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0, 1 OPLINE_CC EXECUTE_DATA_CC); + zend_fetch_property_address(result, container, IS_CV, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); if (IS_CV == IS_VAR) { FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); @@ -44616,7 +44616,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMPVAR container = EX_VAR(opline->op1.var); property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC); result = EX_VAR(opline->result.var); - zend_fetch_property_address(result, container, IS_CV, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0, 1 OPLINE_CC EXECUTE_DATA_CC); + zend_fetch_property_address(result, container, IS_CV, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0 OPLINE_CC EXECUTE_DATA_CC); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); if (IS_CV == IS_VAR) { FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); @@ -49767,7 +49767,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CV_HANDLER zend_fetch_property_address( result, container, IS_CV, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS) : NULL), - BP_VAR_W, opline->extended_value & ZEND_FETCH_OBJ_FLAGS, 1 OPLINE_CC EXECUTE_DATA_CC); + BP_VAR_W, opline->extended_value & ZEND_FETCH_OBJ_FLAGS OPLINE_CC EXECUTE_DATA_CC); if (IS_CV == IS_VAR) { FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); @@ -49784,7 +49784,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_CV_HANDLE container = EX_VAR(opline->op1.var); property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); result = EX_VAR(opline->result.var); - zend_fetch_property_address(result, container, IS_CV, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0, 1 OPLINE_CC EXECUTE_DATA_CC); + zend_fetch_property_address(result, container, IS_CV, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC); if (IS_CV == IS_VAR) { FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); @@ -49931,7 +49931,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_CV_HAN container = EX_VAR(opline->op1.var); property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC); result = EX_VAR(opline->result.var); - zend_fetch_property_address(result, container, IS_CV, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0, 1 OPLINE_CC EXECUTE_DATA_CC); + zend_fetch_property_address(result, container, IS_CV, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0 OPLINE_CC EXECUTE_DATA_CC); if (IS_CV == IS_VAR) { FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var); diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index c0dc07d684645..d2e3e1e1c3185 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -7305,7 +7305,7 @@ static void zend_jit_dump_trace(zend_jit_trace_rec *trace_buffer, zend_ssa *tssa fprintf(stderr, " op1(%sobject of class %s)", ref, ZSTR_VAL(p->ce->name)); } else { - const char *type = (op1_type == 0) ? "undef" : zend_get_type_by_const(op1_type & ~(IS_TRACE_REFERENCE|IS_TRACE_INDIRECT|IS_TRACE_PACKED)); + const char *type = ((op1_type & ~IS_TRACE_INDIRECT) == 0) ? "undef" : zend_get_type_by_const(op1_type & ~(IS_TRACE_REFERENCE|IS_TRACE_INDIRECT|IS_TRACE_PACKED)); fprintf(stderr, " op1(%s%s%s)", ref, (op1_type & IS_TRACE_PACKED) ? "packed " : "", type); } } @@ -7318,7 +7318,7 @@ static void zend_jit_dump_trace(zend_jit_trace_rec *trace_buffer, zend_ssa *tssa fprintf(stderr, " op2(%sobject of class %s)", ref, ZSTR_VAL(p->ce->name)); } else { - const char *type = (op2_type == 0) ? "undef" : zend_get_type_by_const(op2_type & ~(IS_TRACE_REFERENCE|IS_TRACE_INDIRECT)); + const char *type = ((op2_type & ~IS_TRACE_INDIRECT) == 0) ? "undef" : zend_get_type_by_const(op2_type & ~(IS_TRACE_REFERENCE|IS_TRACE_INDIRECT)); fprintf(stderr, " op2(%s%s)", ref, type); } } @@ -7326,7 +7326,7 @@ static void zend_jit_dump_trace(zend_jit_trace_rec *trace_buffer, zend_ssa *tssa const char *ref = (op3_type & IS_TRACE_INDIRECT) ? ((op3_type & IS_TRACE_REFERENCE) ? "*&" : "*") : ((op3_type & IS_TRACE_REFERENCE) ? "&" : ""); - const char *type = (op3_type == 0) ? "undef" : zend_get_type_by_const(op3_type & ~(IS_TRACE_REFERENCE|IS_TRACE_INDIRECT)); + const char *type = ((op3_type & ~IS_TRACE_INDIRECT) == 0) ? "undef" : zend_get_type_by_const(op3_type & ~(IS_TRACE_REFERENCE|IS_TRACE_INDIRECT)); fprintf(stderr, " op3(%s%s)", ref, type); } } diff --git a/ext/opcache/tests/jit/fetch_static_prop_001.phpt b/ext/opcache/tests/jit/fetch_static_prop_001.phpt new file mode 100644 index 0000000000000..db781ac993cea --- /dev/null +++ b/ext/opcache/tests/jit/fetch_static_prop_001.phpt @@ -0,0 +1,20 @@ +--TEST-- +FETCH_STATIC_PROP_W should not return UNDEF +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_update_protection=0 +opcache.jit_buffer_size=1M +--FILE-- + +--EXPECT-- +array(1) { + [0]=> + int(2) +} From 4be6435c9f9d9aa6140abadc8862939d29fec139 Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Tue, 11 Apr 2023 11:58:11 +0100 Subject: [PATCH 27/51] Use curl from brew on MacOS CI This fixes issue in curl ext SSL client cert setting test. Closes GH-11056 --- .github/actions/brew/action.yml | 1 + .github/actions/configure-macos/action.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/actions/brew/action.yml b/.github/actions/brew/action.yml index 8bdbeec7ab6b8..51d37aa56d470 100644 --- a/.github/actions/brew/action.yml +++ b/.github/actions/brew/action.yml @@ -12,6 +12,7 @@ runs: re2c brew install \ openssl@1.1 \ + curl \ krb5 \ bzip2 \ enchant \ diff --git a/.github/actions/configure-macos/action.yml b/.github/actions/configure-macos/action.yml index 57a9b63a06ea2..317d705645985 100644 --- a/.github/actions/configure-macos/action.yml +++ b/.github/actions/configure-macos/action.yml @@ -11,6 +11,7 @@ runs: set -x export PATH="/usr/local/opt/bison/bin:$PATH" export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/openssl@1.1/lib/pkgconfig" + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/curl/lib/pkgconfig" export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/krb5/lib/pkgconfig" export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libffi/lib/pkgconfig" export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libxml2/lib/pkgconfig" From 450fcc4c9b4e700e2bba39ec24a975a68919aad6 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Tue, 11 Apr 2023 22:17:47 +0200 Subject: [PATCH 28/51] [ci skip] UPDATE NEWS ElliotNB helped me a lot debugging this by constantly testing the patches. It is only fair that he is mentioned too, as I couldn't have solved it without his help. --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 41acc3f4d15b3..5b74dae32335b 100644 --- a/NEWS +++ b/NEWS @@ -9,7 +9,7 @@ PHP NEWS . Fixed bug GH-10085 (Assertion when adding two arrays with += where the first array is contained in the second). (ilutov) . Fixed bug GH-10737 (PHP 8.1.16 segfaults on line 597 of - sapi/apache2handler/sapi_apache2.c). (nielsdos) + sapi/apache2handler/sapi_apache2.c). (nielsdos, ElliotNB) - DOM: . Fixed bug #80602 (Segfault when using DOMChildNode::before()). From dd44a9330e7443d3b88acc8c5c24503562b5d1e8 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Wed, 12 Apr 2023 12:36:46 +0200 Subject: [PATCH 29/51] Fix test bug60120.phpt The process cmd was broken. We're now also checking that the process output is actually what we expect. Closes GH-11064 --- ext/standard/tests/file/bug60120.phpt | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/ext/standard/tests/file/bug60120.phpt b/ext/standard/tests/file/bug60120.phpt index 0236e9e1ea7c7..811ac786c8e5f 100644 --- a/ext/standard/tests/file/bug60120.phpt +++ b/ext/standard/tests/file/bug60120.phpt @@ -6,6 +6,7 @@ $php = getenv('TEST_PHP_EXECUTABLE'); if (!$php) { die("skip No php executable defined\n"); } +if (PHP_OS_FAMILY === 'Windows') die('skip not for Windows'); ?> --FILE-- = $stdinLen) { fclose($writePipes[0]); @@ -58,12 +62,21 @@ while ($pipes || $writePipes) { foreach ($r as $pipe) { $type = array_search($pipe, $pipes); $data = fread($pipe, 8192); - if (false === $data || feof($pipe)) { + if (feof($pipe)) { fclose($pipe); unset($pipes[$type]); + } elseif (false === $data) { + die('Failed to read from pipe'); + } else { + $procOutput[$type] = ($procOutput[$type] ?? '') . $data; } } } +foreach ($procOutput as $output) { + if ($output !== $stdin) { + die('Output does not match input: ' . $output); + } +} echo "OK."; ?> --EXPECT-- From 4b22c3e3ad5fa7088469315cc96353da747c91f6 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Thu, 13 Apr 2023 13:13:47 +0200 Subject: [PATCH 30/51] [skip ci] Skip bug45161.phpt on Windows See GH-10753 The test is insanely slow on Windows and it's unclear why. It might be a curl issue. --- ext/curl/tests/bug45161.phpt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/curl/tests/bug45161.phpt b/ext/curl/tests/bug45161.phpt index 9ba8f5f90249c..7e67b6d741ed5 100644 --- a/ext/curl/tests/bug45161.phpt +++ b/ext/curl/tests/bug45161.phpt @@ -2,6 +2,10 @@ Bug #45161 (Reusing a curl handle leaks memory) --EXTENSIONS-- curl +--SKIPIF-- + --FILE-- Date: Tue, 11 Apr 2023 19:33:46 +0200 Subject: [PATCH 31/51] [skip ci] Fix Slack notification ravsamhq/notify-slack-action doesn't work on MacOS, so we use curl directly. --- .github/actions/apt-x32/action.yml | 1 + .github/actions/notify-slack/action.yml | 11 +++-------- .github/workflows/nightly.yml | 18 +++++++++--------- 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/.github/actions/apt-x32/action.yml b/.github/actions/apt-x32/action.yml index 2cde60fce55b0..879300f992747 100644 --- a/.github/actions/apt-x32/action.yml +++ b/.github/actions/apt-x32/action.yml @@ -13,6 +13,7 @@ runs: apt-get install -y \ autoconf \ bison \ + curl \ g++-multilib \ gcc-multilib \ language-pack-de \ diff --git a/.github/actions/notify-slack/action.yml b/.github/actions/notify-slack/action.yml index f447894a21d7a..1ff425b51c6ac 100644 --- a/.github/actions/notify-slack/action.yml +++ b/.github/actions/notify-slack/action.yml @@ -5,11 +5,6 @@ inputs: runs: using: composite steps: - - name: Notify Slack - if: always() - uses: ravsamhq/notify-slack-action@v1 - with: - status: ${{ job.status }} - notify_when: 'failure' - env: - SLACK_WEBHOOK_URL: ${{ inputs.token }} + - shell: bash + run: >- + curl -X POST -H 'Content-type: application/json' --data '{"attachments": [{"text": "Job in *nightly* failed", "footer": "", "color": "danger", "mrkdwn_in": ["text"]}]}' ${{ inputs.token }} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index ac6473ac74862..63fce11ac0225 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -31,7 +31,7 @@ jobs: id: set-matrix run: php .github/nightly_matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}" - name: Notify Slack - if: always() + if: failure() uses: ./.github/actions/notify-slack with: token: ${{ secrets.ACTION_MONITORING_SLACK }} @@ -110,7 +110,7 @@ jobs: - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files - name: Notify Slack - if: always() + if: failure() uses: ./.github/actions/notify-slack with: token: ${{ secrets.ACTION_MONITORING_SLACK }} @@ -186,7 +186,7 @@ jobs: -d opcache.jit_buffer_size=16M -d opcache.jit=1205 - name: Notify Slack - if: always() + if: failure() uses: ./.github/actions/notify-slack with: token: ${{ secrets.ACTION_MONITORING_SLACK }} @@ -249,7 +249,7 @@ jobs: - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files - name: Notify Slack - if: always() + if: failure() uses: ./.github/actions/notify-slack with: token: ${{ secrets.ACTION_MONITORING_SLACK }} @@ -288,7 +288,7 @@ jobs: if: always() run: bash <(curl -s https://codecov.io/bash) - name: Notify Slack - if: always() + if: failure() uses: ./.github/actions/notify-slack with: token: ${{ secrets.ACTION_MONITORING_SLACK }} @@ -408,7 +408,7 @@ jobs: exit 1 fi - name: Notify Slack - if: always() + if: failure() uses: ./.github/actions/notify-slack with: token: ${{ secrets.ACTION_MONITORING_SLACK }} @@ -484,7 +484,7 @@ jobs: - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files - name: Notify Slack - if: always() + if: failure() uses: ./.github/actions/notify-slack with: token: ${{ secrets.ACTION_MONITORING_SLACK }} @@ -581,7 +581,7 @@ jobs: - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files - name: Notify Slack - if: always() + if: failure() uses: ./.github/actions/notify-slack with: token: ${{ secrets.ACTION_MONITORING_SLACK }} @@ -641,7 +641,7 @@ jobs: - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files - name: Notify Slack - if: always() + if: failure() uses: ./.github/actions/notify-slack with: token: ${{ secrets.ACTION_MONITORING_SLACK }} From fc32d39b7f450a331dc1e307c59fa6b8c0f97114 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 8 Apr 2023 15:23:58 +0200 Subject: [PATCH 32/51] Fix GH-11028: Heap Buffer Overflow in zval_undefined_cv. For analysis see https://github.com/php/php-src/issues/11028#issuecomment-1508460440 Closes GH-11083. --- NEWS | 1 + Zend/tests/generators/gh11028_1.phpt | 35 ++++++++++++++++++++++++++++ Zend/tests/generators/gh11028_2.phpt | 24 +++++++++++++++++++ Zend/tests/generators/gh11028_3.phpt | 21 +++++++++++++++++ Zend/zend_generators.c | 13 ++++++++++- 5 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 Zend/tests/generators/gh11028_1.phpt create mode 100644 Zend/tests/generators/gh11028_2.phpt create mode 100644 Zend/tests/generators/gh11028_3.phpt diff --git a/NEWS b/NEWS index 5b74dae32335b..746746e801f98 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,7 @@ PHP NEWS array is contained in the second). (ilutov) . Fixed bug GH-10737 (PHP 8.1.16 segfaults on line 597 of sapi/apache2handler/sapi_apache2.c). (nielsdos, ElliotNB) + . Fixed bug GH-11028 (Heap Buffer Overflow in zval_undefined_cv.). (nielsdos) - DOM: . Fixed bug #80602 (Segfault when using DOMChildNode::before()). diff --git a/Zend/tests/generators/gh11028_1.phpt b/Zend/tests/generators/gh11028_1.phpt new file mode 100644 index 0000000000000..e1e7aa5019e54 --- /dev/null +++ b/Zend/tests/generators/gh11028_1.phpt @@ -0,0 +1,35 @@ +--TEST-- +GH-11028 (Heap Buffer Overflow in zval_undefined_cv with generators) - other types variant +--FILE-- + 0; + } finally { + return []; + } +} + +function test($msg, $x) { + echo "yield $msg\n"; + try { + var_dump([...generator($x)]); + } catch (Throwable $e) { + echo $e->getMessage(), "\n"; + } +} + +test("null", null); +test("false", false); +test("true", true); +test("object", new stdClass); +?> +--EXPECT-- +yield null +Keys must be of type int|string during array unpacking +yield false +Keys must be of type int|string during array unpacking +yield true +Keys must be of type int|string during array unpacking +yield object +Keys must be of type int|string during array unpacking diff --git a/Zend/tests/generators/gh11028_2.phpt b/Zend/tests/generators/gh11028_2.phpt new file mode 100644 index 0000000000000..27b36c711f5c1 --- /dev/null +++ b/Zend/tests/generators/gh11028_2.phpt @@ -0,0 +1,24 @@ +--TEST-- +GH-11028 (Heap Buffer Overflow in zval_undefined_cv with generators) - original variant +--FILE-- + 0; + } finally { + return []; + } + })()), + ]; +})()[0]; +?> +--EXPECTF-- +Warning: Undefined variable $a in %s on line %d + +Fatal error: Uncaught Error: Keys must be of type int|string during array unpacking in %s:%d +Stack trace: +#0 %s(%d): {closure}() +#1 {main} + thrown in %s on line %d diff --git a/Zend/tests/generators/gh11028_3.phpt b/Zend/tests/generators/gh11028_3.phpt new file mode 100644 index 0000000000000..7ea1aac6f6cfc --- /dev/null +++ b/Zend/tests/generators/gh11028_3.phpt @@ -0,0 +1,21 @@ +--TEST-- +GH-11028 (Heap Buffer Overflow in zval_undefined_cv with generators) - throw in finally variant +--FILE-- + 0; + } finally { + throw new Exception("exception"); + return []; + } +} + +try { + var_dump([...generator()]); +} catch (Throwable $e) { + echo $e->getMessage(), "\n"; +} +?> +--EXPECT-- +exception diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c index 5d7bef3854f5e..a3610fa8f7b13 100644 --- a/Zend/zend_generators.c +++ b/Zend/zend_generators.c @@ -279,14 +279,25 @@ static void zend_generator_dtor_storage(zend_object *object) /* {{{ */ ZEND_CALL_VAR(ex, ex->func->op_array.opcodes[try_catch->finally_end].op1.var); zend_generator_cleanup_unfinished_execution(generator, ex, try_catch->finally_op); - Z_OBJ_P(fast_call) = EG(exception); + zend_object *old_exception = EG(exception); + const zend_op *old_opline_before_exception = EG(opline_before_exception); EG(exception) = NULL; + Z_OBJ_P(fast_call) = NULL; Z_OPLINE_NUM_P(fast_call) = (uint32_t)-1; ex->opline = &ex->func->op_array.opcodes[try_catch->finally_op]; generator->flags |= ZEND_GENERATOR_FORCED_CLOSE; zend_generator_resume(generator); + if (old_exception) { + EG(opline_before_exception) = old_opline_before_exception; + if (EG(exception)) { + zend_exception_set_previous(EG(exception), old_exception); + } else { + EG(exception) = old_exception; + } + } + /* TODO: If we hit another yield inside try/finally, * should we also jump to the next finally block? */ break; From 0ac55e9bfbc37c74af15d668ce89731cf85a04f6 Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Sat, 15 Apr 2023 15:08:24 +0100 Subject: [PATCH 33/51] Add zend_test_crash funtion to segfault PHP process This is useful for testing PHP-FPM handling of crashed children. Closes GH-11082 --- Zend/tests/arginfo_zpp_mismatch.inc | 1 + ext/zend_test/test.c | 17 +++++++++++++++++ ext/zend_test/test.stub.php | 2 ++ ext/zend_test/test_arginfo.h | 8 +++++++- 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/Zend/tests/arginfo_zpp_mismatch.inc b/Zend/tests/arginfo_zpp_mismatch.inc index 221c347aaa915..023bfefa5d501 100644 --- a/Zend/tests/arginfo_zpp_mismatch.inc +++ b/Zend/tests/arginfo_zpp_mismatch.inc @@ -9,6 +9,7 @@ function skipFunction($function): bool { /* intentionally violate invariants */ || $function === 'zend_create_unterminated_string' || $function === 'zend_test_array_return' + || $function === 'zend_test_crash' || $function === 'zend_leak_bytes' /* mess with output */ || (is_string($function) && str_starts_with($function, 'ob_')) diff --git a/ext/zend_test/test.c b/ext/zend_test/test.c index d80ed25f933f0..41e17d5cb9104 100644 --- a/ext/zend_test/test.c +++ b/ext/zend_test/test.c @@ -327,6 +327,23 @@ static ZEND_FUNCTION(zend_get_map_ptr_last) RETURN_LONG(CG(map_ptr_last)); } +static ZEND_FUNCTION(zend_test_crash) +{ + zend_string *message; + + ZEND_PARSE_PARAMETERS_START(0, 1) + Z_PARAM_OPTIONAL + Z_PARAM_STR_OR_NULL(message) + ZEND_PARSE_PARAMETERS_END(); + + if (message) { + php_printf("%s", ZSTR_VAL(message)); + } + + char *invalid = (char *) 1; + php_printf("%s", invalid); +} + static zend_object *zend_test_class_new(zend_class_entry *class_type) { zend_object *obj = zend_objects_new(class_type); diff --git a/ext/zend_test/test.stub.php b/ext/zend_test/test.stub.php index c95c650ad7207..fc35f5743ef28 100644 --- a/ext/zend_test/test.stub.php +++ b/ext/zend_test/test.stub.php @@ -119,6 +119,8 @@ function zend_get_current_func_name(): string {} function zend_call_method(string $class, string $method, mixed $arg1 = UNKNOWN, mixed $arg2 = UNKNOWN): mixed {} function zend_get_map_ptr_last(): int {} + + function zend_test_crash(?string $message = null): void {} } namespace ZendTestNS { diff --git a/ext/zend_test/test_arginfo.h b/ext/zend_test/test_arginfo.h index 766c0b08dd158..08b2d9d8e87f9 100644 --- a/ext/zend_test/test_arginfo.h +++ b/ext/zend_test/test_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 614310958c6e2acde46c9b7932ba894caf72d6df */ + * Stub hash: 47eb58d644268f4fdce7a6b5007f7755ebfcb197 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_test_array_return, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() @@ -82,6 +82,10 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_get_map_ptr_last, 0, 0, IS_LONG, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_test_crash, 0, 0, IS_VOID, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, message, IS_STRING, 1, "null") +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ZendTestNS2_ZendSubNS_namespaced_func, 0, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() @@ -143,6 +147,7 @@ static ZEND_FUNCTION(zend_test_parameter_with_attribute); static ZEND_FUNCTION(zend_get_current_func_name); static ZEND_FUNCTION(zend_call_method); static ZEND_FUNCTION(zend_get_map_ptr_last); +static ZEND_FUNCTION(zend_test_crash); static ZEND_FUNCTION(namespaced_func); static ZEND_METHOD(_ZendTestClass, is_object); static ZEND_METHOD(_ZendTestClass, __toString); @@ -182,6 +187,7 @@ static const zend_function_entry ext_functions[] = { ZEND_FE(zend_get_current_func_name, arginfo_zend_get_current_func_name) ZEND_FE(zend_call_method, arginfo_zend_call_method) ZEND_FE(zend_get_map_ptr_last, arginfo_zend_get_map_ptr_last) + ZEND_FE(zend_test_crash, arginfo_zend_test_crash) ZEND_NS_FE("ZendTestNS2\\ZendSubNS", namespaced_func, arginfo_ZendTestNS2_ZendSubNS_namespaced_func) ZEND_FE_END }; From 84be9042f961135d0e550072b9aad03d3ac5dc43 Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Sun, 16 Apr 2023 10:54:39 +0100 Subject: [PATCH 34/51] Add missing zend_test_crash message initialization --- ext/zend_test/test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/zend_test/test.c b/ext/zend_test/test.c index 41e17d5cb9104..32fd153ac2d8c 100644 --- a/ext/zend_test/test.c +++ b/ext/zend_test/test.c @@ -329,7 +329,7 @@ static ZEND_FUNCTION(zend_get_map_ptr_last) static ZEND_FUNCTION(zend_test_crash) { - zend_string *message; + zend_string *message = NULL; ZEND_PARSE_PARAMETERS_START(0, 1) Z_PARAM_OPTIONAL From e8b8341d3d5ffe10360746c343d403c1a77b38f1 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Tue, 4 Apr 2023 18:19:19 +0200 Subject: [PATCH 35/51] Support enums in array_unique Fixes GH-9775 Closes GH-11015 --- NEWS | 2 ++ Zend/tests/gh9775_1.phpt | 56 ++++++++++++++++++++++++++++++++++++++++ Zend/tests/gh9775_2.phpt | 56 ++++++++++++++++++++++++++++++++++++++++ ext/standard/array.c | 22 +++++++++++++++- 4 files changed, 135 insertions(+), 1 deletion(-) create mode 100644 Zend/tests/gh9775_1.phpt create mode 100644 Zend/tests/gh9775_2.phpt diff --git a/NEWS b/NEWS index 746746e801f98..941f610880700 100644 --- a/NEWS +++ b/NEWS @@ -27,6 +27,8 @@ PHP NEWS - Standard: . Fixed bug GH-10990 (mail() throws TypeError after iterating over $additional_headers array by reference). (nielsdos) + . Fixed bug GH-9775 (Duplicates returned by array_unique when using enums). + (ilutov) 13 Apr 2023, PHP 8.1.18 diff --git a/Zend/tests/gh9775_1.phpt b/Zend/tests/gh9775_1.phpt new file mode 100644 index 0000000000000..e2ea5287f5df9 --- /dev/null +++ b/Zend/tests/gh9775_1.phpt @@ -0,0 +1,56 @@ +--TEST-- +GH-9775: Backed enum in array_unique() +--FILE-- + +--EXPECT-- +array(8) { + [0]=> + enum(Test::COURSES_ADMIN) + [1]=> + enum(Test::COURSES_REPORTING_ACCESS) + [2]=> + enum(Test::BUNDLES_ADMIN) + [3]=> + enum(Test::USERS_ADMIN) + [4]=> + enum(Test::B2B_DASHBOARD_ACCESS) + [6]=> + enum(Test::INSTRUCTORS_ADMIN) + [8]=> + enum(Test::COUPONS_ADMIN) + [9]=> + enum(Test::AUTHENTICATED) +} diff --git a/Zend/tests/gh9775_2.phpt b/Zend/tests/gh9775_2.phpt new file mode 100644 index 0000000000000..94ef0029fa93d --- /dev/null +++ b/Zend/tests/gh9775_2.phpt @@ -0,0 +1,56 @@ +--TEST-- +GH-9775: Pure enum in array_unique() +--FILE-- + +--EXPECT-- +array(8) { + [0]=> + enum(Test::COURSES_ADMIN) + [1]=> + enum(Test::COURSES_REPORTING_ACCESS) + [2]=> + enum(Test::BUNDLES_ADMIN) + [3]=> + enum(Test::USERS_ADMIN) + [4]=> + enum(Test::B2B_DASHBOARD_ACCESS) + [6]=> + enum(Test::INSTRUCTORS_ADMIN) + [8]=> + enum(Test::COUPONS_ADMIN) + [9]=> + enum(Test::AUTHENTICATED) +} diff --git a/ext/standard/array.c b/ext/standard/array.c index 9a814ea07da47..fb705cd34c4e8 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -345,7 +345,27 @@ static zend_always_inline int php_array_key_compare_string_locale_unstable_i(Buc static zend_always_inline int php_array_data_compare_unstable_i(Bucket *f, Bucket *s) /* {{{ */ { - return zend_compare(&f->val, &s->val); + int result = zend_compare(&f->val, &s->val); + /* Special enums handling for array_unique. We don't want to add this logic to zend_compare as + * that would be observable via comparison operators. */ + zval *rhs = &s->val; + ZVAL_DEREF(rhs); + if (UNEXPECTED(Z_TYPE_P(rhs) == IS_OBJECT) + && result == ZEND_UNCOMPARABLE + && (Z_OBJCE_P(rhs)->ce_flags & ZEND_ACC_ENUM)) { + zval *lhs = &f->val; + ZVAL_DEREF(lhs); + if (Z_TYPE_P(lhs) == IS_OBJECT && (Z_OBJCE_P(lhs)->ce_flags & ZEND_ACC_ENUM)) { + // Order doesn't matter, we just need to group the same enum values + uintptr_t lhs_uintptr = (uintptr_t)Z_OBJ_P(lhs); + uintptr_t rhs_uintptr = (uintptr_t)Z_OBJ_P(rhs); + return lhs_uintptr == rhs_uintptr ? 0 : (lhs_uintptr < rhs_uintptr ? -1 : 1); + } else { + // Shift enums to the end of the array + return -1; + } + } + return result; } /* }}} */ From 31e21f7dbce5ff270c20e7642407a2c2405a6aaf Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 14 Apr 2023 10:23:21 +0200 Subject: [PATCH 36/51] Fix GH-11071: Revert "Fix [-Wundef] warning in INTL extension" This reverts commit ea8686540ac43e59dd3f8784e29a0c06e3446df2. --- ext/intl/php_intl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c index 5826c2e3372f1..a15e166041334 100644 --- a/ext/intl/php_intl.c +++ b/ext/intl/php_intl.c @@ -286,7 +286,7 @@ PHP_RSHUTDOWN_FUNCTION( intl ) /* {{{ PHP_MINFO_FUNCTION */ PHP_MINFO_FUNCTION( intl ) { -#ifndef UCONFIG_NO_FORMATTING +#if !UCONFIG_NO_FORMATTING UErrorCode status = U_ZERO_ERROR; const char *tzdata_ver = NULL; #endif @@ -297,7 +297,7 @@ PHP_MINFO_FUNCTION( intl ) #ifdef U_ICU_DATA_VERSION php_info_print_table_row( 2, "ICU Data version", U_ICU_DATA_VERSION ); #endif -#ifndef UCONFIG_NO_FORMATTING +#if !UCONFIG_NO_FORMATTING tzdata_ver = ucal_getTZDataVersion(&status); if (U_ZERO_ERROR == status) { php_info_print_table_row( 2, "ICU TZData version", tzdata_ver); From 6e8f0f53b157a982895a380f28de6aba7005d3d8 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 18 Apr 2023 11:45:50 +0200 Subject: [PATCH 37/51] [ci skip] NEWS for 11071 --- NEWS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NEWS b/NEWS index 941f610880700..17294b8297422 100644 --- a/NEWS +++ b/NEWS @@ -21,6 +21,9 @@ PHP NEWS . Fixed bug GH-9397 (exif read : warnings and errors : Potentially invalid endianess, Illegal IFD size and Undefined index). (nielsdos) +- Intl: + . Fixed bug GH-11071 (TZData version not displayed anymore). (Remi) + - PCRE: . Fixed bug GH-10968 (Segfault in preg_replace_callback_array()). (ilutov) From 6adf2f65a18079a6f865da5413bde4089db7dc42 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 18 Apr 2023 11:46:18 +0200 Subject: [PATCH 38/51] [ci skip] NEWS for 11071 --- NEWS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NEWS b/NEWS index e9d351c30311d..f50c774b2b025 100644 --- a/NEWS +++ b/NEWS @@ -21,6 +21,9 @@ PHP NEWS . Fixed bug GH-9397 (exif read : warnings and errors : Potentially invalid endianess, Illegal IFD size and Undefined index). (nielsdos) +- Intl: + . Fixed bug GH-11071 (TZData version not displayed anymore). (Remi) + - PCRE: . Fixed bug GH-10968 (Segfault in preg_replace_callback_array()). (ilutov) From 44eef677b077b9635dc98513d2e9f405631ee986 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Mon, 17 Apr 2023 18:42:10 +0100 Subject: [PATCH 39/51] Import timelib 2022.06 --- ext/date/lib/interval.c | 119 ++++++++++++---------------------------- ext/date/lib/timelib.h | 6 +- 2 files changed, 37 insertions(+), 88 deletions(-) diff --git a/ext/date/lib/interval.c b/ext/date/lib/interval.c index e3bf5101b1ddd..da9262da999b6 100644 --- a/ext/date/lib/interval.c +++ b/ext/date/lib/interval.c @@ -36,25 +36,6 @@ static void swap_times(timelib_time **one, timelib_time **two, timelib_rel_time rt->invert = 1; } -static void swap_if_negative(timelib_rel_time *rt) -{ - if (rt->y == 0 && rt->m == 0 && rt->d == 0 && rt->h == 0 && rt->i == 0 && rt->s == 0 && rt->us == 0) { - return; - } - if (rt->y >= 0 && rt->m >= 0 && rt->d >= 0 && rt->h >= 0 && rt->i >= 0 && rt->s >= 0 && rt->us >= 0) { - return; - } - - rt->invert = 1 - rt->invert; - rt->y = 0 - rt->y; - rt->m = 0 - rt->m; - rt->d = 0 - rt->d; - rt->h = 0 - rt->h; - rt->i = 0 - rt->i; - rt->s = 0 - rt->s; - rt->us = 0 - rt->us; -} - static void sort_old_to_new(timelib_time **one, timelib_time **two, timelib_rel_time *rt) { /* Check whether date/times need to be inverted. If both times are @@ -115,80 +96,48 @@ static timelib_rel_time *timelib_diff_with_tzid(timelib_time *one, timelib_time rt->days = timelib_diff_days(one, two); /* Fall Back: Cater for transition period, where rt->invert is 0, but there are negative numbers */ - if (one->dst == 1 && two->dst == 0) { - /* First for two "Type 3" times */ - if (one->zone_type == TIMELIB_ZONETYPE_ID && two->zone_type == TIMELIB_ZONETYPE_ID) { - int success = timelib_get_time_zone_offset_info(two->sse, two->tz_info, &trans_offset, &trans_transition_time, NULL); - if ( - success && - one->sse < trans_transition_time && - one->sse >= trans_transition_time + dst_corr - ) { - timelib_sll flipped = SECS_PER_HOUR + (rt->i * 60) + (rt->s); - rt->h = flipped / SECS_PER_HOUR; - rt->i = (flipped - rt->h * SECS_PER_HOUR) / 60; - rt->s = flipped % 60; - } - } else if (rt->h == 0 && (rt->i < 0 || rt->s < 0)) { - /* Then for all the others */ - timelib_sll flipped = SECS_PER_HOUR + (rt->i * 60) + (rt->s); - rt->h = flipped / SECS_PER_HOUR; - rt->i = (flipped - rt->h * SECS_PER_HOUR) / 60; - rt->s = flipped % 60; - dst_corr += SECS_PER_HOUR; - dst_h_corr++; - } + if (two->sse < one->sse) { + timelib_sll flipped = llabs((rt->i * 60) + (rt->s) - dst_corr); + rt->h = flipped / SECS_PER_HOUR; + rt->i = (flipped - rt->h * SECS_PER_HOUR) / 60; + rt->s = flipped % 60; + + rt->invert = 1 - rt->invert; } timelib_do_rel_normalize(rt->invert ? one : two, rt); - /* Do corrections for "Type 3" times with the same TZID */ - if (one->zone_type == TIMELIB_ZONETYPE_ID && two->zone_type == TIMELIB_ZONETYPE_ID && strcmp(one->tz_info->name, two->tz_info->name) == 0) { - if (one->dst == 1 && two->dst == 0) { /* Fall Back */ - if (two->tz_info) { - int success = timelib_get_time_zone_offset_info(two->sse, two->tz_info, &trans_offset, &trans_transition_time, NULL); - - if ( - success && - two->sse >= trans_transition_time && - ((two->sse - one->sse + dst_corr) % SECS_PER_DAY) > (two->sse - trans_transition_time) - ) { - rt->h -= dst_h_corr; - rt->i -= dst_m_corr; - } + if (one->dst == 1 && two->dst == 0) { /* Fall Back */ + if (two->tz_info) { + if ((two->sse - one->sse + dst_corr) < SECS_PER_DAY) { + rt->h -= dst_h_corr; + rt->i -= dst_m_corr; } - } else if (one->dst == 0 && two->dst == 1) { /* Spring Forward */ - if (two->tz_info) { - int success = timelib_get_time_zone_offset_info(two->sse, two->tz_info, &trans_offset, &trans_transition_time, NULL); - - if ( - success && - !((one->sse + SECS_PER_DAY > trans_transition_time) && (one->sse + SECS_PER_DAY <= (trans_transition_time + dst_corr))) && - two->sse >= trans_transition_time && - ((two->sse - one->sse + dst_corr) % SECS_PER_DAY) > (two->sse - trans_transition_time) - ) { - rt->h -= dst_h_corr; - rt->i -= dst_m_corr; - } + } + } else if (one->dst == 0 && two->dst == 1) { /* Spring Forward */ + if (two->tz_info) { + int success = timelib_get_time_zone_offset_info(two->sse, two->tz_info, &trans_offset, &trans_transition_time, NULL); + + if ( + success && + !((one->sse + SECS_PER_DAY > trans_transition_time) && (one->sse + SECS_PER_DAY <= (trans_transition_time + dst_corr))) && + two->sse >= trans_transition_time && + ((two->sse - one->sse + dst_corr) % SECS_PER_DAY) > (two->sse - trans_transition_time) + ) { + rt->h -= dst_h_corr; + rt->i -= dst_m_corr; } - } else if (two->sse - one->sse >= SECS_PER_DAY) { - /* Check whether we're in the period to the next transition time */ - if (timelib_get_time_zone_offset_info(two->sse - two->z, two->tz_info, &trans_offset, &trans_transition_time, NULL)) { - dst_corr = one->z - trans_offset; - - if (two->sse >= trans_transition_time - dst_corr && two->sse < trans_transition_time) { - rt->d--; - rt->h = 24; - } + } + } else if (two->sse - one->sse >= SECS_PER_DAY) { + /* Check whether we're in the period to the next transition time */ + if (timelib_get_time_zone_offset_info(two->sse - two->z, two->tz_info, &trans_offset, &trans_transition_time, NULL)) { + dst_corr = one->z - trans_offset; + + if (two->sse >= trans_transition_time - dst_corr && two->sse < trans_transition_time) { + rt->d--; + rt->h = 24; } } - } else { - rt->h -= dst_h_corr; - rt->i -= dst_m_corr; - - swap_if_negative(rt); - - timelib_do_rel_normalize(rt->invert ? one : two, rt); } return rt; diff --git a/ext/date/lib/timelib.h b/ext/date/lib/timelib.h index 41321ee39824b..97837fcee6cb6 100644 --- a/ext/date/lib/timelib.h +++ b/ext/date/lib/timelib.h @@ -30,9 +30,9 @@ # include "timelib_config.h" #endif -#define TIMELIB_VERSION 202205 -#define TIMELIB_EXTENDED_VERSION 20220501 -#define TIMELIB_ASCII_VERSION "2022.05" +#define TIMELIB_VERSION 202206 +#define TIMELIB_EXTENDED_VERSION 20220601 +#define TIMELIB_ASCII_VERSION "2022.06" #include #include From cc7b799c44da67c916df3015a316f1cd1bf9d217 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Mon, 17 Apr 2023 18:42:24 +0100 Subject: [PATCH 40/51] Fixed tests --- ext/date/tests/DateTime_diff-fall-type3-type3.phpt | 6 ++---- .../rfc-datetime_and_daylight_saving_time-type3-bd2.phpt | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ext/date/tests/DateTime_diff-fall-type3-type3.phpt b/ext/date/tests/DateTime_diff-fall-type3-type3.phpt index c360cd4337eea..d69e3808e8410 100644 --- a/ext/date/tests/DateTime_diff-fall-type3-type3.phpt +++ b/ext/date/tests/DateTime_diff-fall-type3-type3.phpt @@ -2,8 +2,6 @@ DateTime::diff() -- fall type3 type3 --CREDITS-- Daniel Convissor ---XFAIL-- -Various bugs exist --FILE-- format($date_format) . ' - ' . $start->format($date_format) echo "\n"; ?> --EXPECT-- -bd0 2010-11-07 01:00:00 EST America/New_York - 2010-11-07 01:59:59 EDT America/New_York = P0DT0H59M59S +bd0 2010-11-07 01:00:00 EST America/New_York - 2010-11-07 01:59:59 EDT America/New_York = P0DT0H0M1S bd5 2010-11-07 01:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT22H bd6 2010-11-07 01:30:00 EDT America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT21H bd8a 2010-11-07 01:00:00 EST America/New_York - 2010-11-06 01:00:00 EDT America/New_York = P1DT0H From 1dcab8a534aba77cbe62d2d7d150256607d19894 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Tue, 18 Apr 2023 13:48:29 +0100 Subject: [PATCH 41/51] Add NEWS entry --- NEWS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS b/NEWS index f50c774b2b025..bd9252a37ead4 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,10 @@ PHP NEWS sapi/apache2handler/sapi_apache2.c). (nielsdos, ElliotNB) . Fixed bug GH-11028 (Heap Buffer Overflow in zval_undefined_cv.). (nielsdos) +- Date: + . Fixed bug where the diff() method would not return the right result around + DST changeover for date/times associated with a timezone identifier. (Derick) + - DOM: . Fixed bug #80602 (Segfault when using DOMChildNode::before()). (Nathan Freeman) From af6b4136915c08cb05335b7ba32ed45ade5f1d30 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Wed, 19 Apr 2023 16:23:52 +0200 Subject: [PATCH 42/51] [skip ci] Add all conflict to curl --- ext/curl/tests/CONFLICTS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/curl/tests/CONFLICTS b/ext/curl/tests/CONFLICTS index 13368f82902d8..0702cb5bfbb01 100644 --- a/ext/curl/tests/CONFLICTS +++ b/ext/curl/tests/CONFLICTS @@ -1 +1 @@ -curl +all From 0ab51a9561a5bbcd0efd99c75ce0191257330688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Fri, 14 Oct 2022 15:58:36 +0200 Subject: [PATCH 43/51] Fix mysql tests with non-standard server port Closes GH-9744 --- ext/mysqli/tests/bug73462.phpt | 6 +++--- ext/mysqli/tests/bug73949.phpt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/mysqli/tests/bug73462.phpt b/ext/mysqli/tests/bug73462.phpt index aa54dbbe5d5cc..a5ae94acffa80 100644 --- a/ext/mysqli/tests/bug73462.phpt +++ b/ext/mysqli/tests/bug73462.phpt @@ -11,14 +11,14 @@ require_once('skipifconnectfailure.inc'); require_once("connect.inc"); /* Initial persistent connection */ - $mysql_1 = new mysqli('p:'.$host, $user, $passwd, $db); + $mysql_1 = new mysqli('p:'.$host, $user, $passwd, $db, $port); $result = $mysql_1->query("SHOW STATUS LIKE 'Connections'"); $c1 = $result->fetch_row(); $result->free(); $mysql_1->close(); /* Failed connection to invalid host */ - $mysql_2 = @new mysqli(' !!! invalid !!! ', $user, $passwd, $db); + $mysql_2 = @new mysqli(' !!! invalid !!! ', $user, $passwd, $db, $port); try { $mysql_2->close(); } catch (Error $exception) { @@ -26,7 +26,7 @@ require_once('skipifconnectfailure.inc'); } /* Re-use persistent connection */ - $mysql_3 = new mysqli('p:'.$host, $user, $passwd, $db); + $mysql_3 = new mysqli('p:'.$host, $user, $passwd, $db, $port); $error = mysqli_connect_errno(); $result = $mysql_3->query("SHOW STATUS LIKE 'Connections'"); $c3 = $result->fetch_row(); diff --git a/ext/mysqli/tests/bug73949.phpt b/ext/mysqli/tests/bug73949.phpt index b706ab20e8819..7c5364c274730 100644 --- a/ext/mysqli/tests/bug73949.phpt +++ b/ext/mysqli/tests/bug73949.phpt @@ -14,7 +14,7 @@ class cc{ function __construct($c=null){ } }; -$i=mysqli_connect('p:'.$host, $user, $passwd, $db); +$i=mysqli_connect('p:'.$host, $user, $passwd, $db, $port); $res=mysqli_query($i, "SHOW STATUS LIKE 'Connections'"); $t=array(new stdClass); while($db= mysqli_fetch_object($res,'cc',$t)){} From 91d3aaaa93bb3ca39de6abdc987315b30e60b99a Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Thu, 20 Apr 2023 18:01:43 +1000 Subject: [PATCH 44/51] Bump OCI8 version to make a PECL release for 8.2 --- ext/oci8/README.md | 10 +-- ext/oci8/oci8.c | 2 + ext/oci8/package.xml | 112 ++++++++++++++++++-------------- ext/oci8/php_oci8.h | 2 +- ext/oci8/tests/driver_name.phpt | 6 +- 5 files changed, 75 insertions(+), 57 deletions(-) diff --git a/ext/oci8/README.md b/ext/oci8/README.md index eb2149e21dd95..d0c0c3be09609 100644 --- a/ext/oci8/README.md +++ b/ext/oci8/README.md @@ -4,16 +4,16 @@ Use the OCI8 extension to access Oracle Database. Documentation is at https://www.php.net/oci8 -Use `pecl install oci8` to install for PHP 8. +Use `pecl install oci8` to install for PHP 8.2. -Use `pecl install oci8-2.2.0` to install for PHP 7. +Use `pecl install oci8-3.2.1` to install for PHP 8.1. -Use `pecl install oci8-2.0.12` to install for PHP 5.2 - PHP 5.6. +Use `pecl install oci8-3.0.1` to install for PHP 8.0. -Use `pecl install oci8-1.4.10` to install for PHP 4.3.9 - PHP 5.1. +Use `pecl install oci8-2.2.0` to install for PHP 7. The OCI8 extension can be linked with Oracle client libraries from Oracle -Database 10.2 or later. These libraries are found in your database +Database 11.2 or later. These libraries are found in your database installation, or in the free Oracle Instant Client from https://www.oracle.com/database/technologies/instant-client.html Install the 'Basic' or 'Basic Light' Instant Client package. If building from diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index 98e1821568d7d..01cb1c8ad9277 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -51,6 +51,8 @@ #error Use PHP OCI8 2.2 for your version of PHP #elif PHP_MAJOR_VERSION == 8 && PHP_MINOR_VERSION < 1 #error Use PHP OCI8 3.0 for your version of PHP +#elif PHP_MAJOR_VERSION == 8 && PHP_MINOR_VERSION < 2 +#error Use PHP OCI8 3.2 for your version of PHP #endif #include "php_oci8.h" diff --git a/ext/oci8/package.xml b/ext/oci8/package.xml index f5ba6005b61c3..63a020750623c 100644 --- a/ext/oci8/package.xml +++ b/ext/oci8/package.xml @@ -10,16 +10,14 @@ http://pear.php.net/dtd/package-2.0.xsd"> The OCI8 extension lets you access Oracle Database. -Use 'pecl install oci8' to install for PHP 8.1. +Use 'pecl install oci8' to install for PHP 8.2. + +Use 'pecl install oci8-3.2.1' to install for PHP 8.1. Use 'pecl install oci8-3.0.1' to install for PHP 8.0. Use 'pecl install oci8-2.2.0' to install for PHP 7. -Use 'pecl install oci8-2.0.12' to install for PHP 5.2 - PHP 5.6. - -Use 'pecl install oci8-1.4.10' to install for PHP 4.3.9 - PHP 5.1. - The current OCI8 extension can be linked with Oracle Client libraries from Oracle Database 11.2 or later. (OCI8 3.0 and earlier can be linked with 10g or later). The Oracle Client libraries are in the free Oracle Instant Client from https://www.oracle.com/database/technologies/instant-client.html. They are also included in your database installation. Oracle's standard cross-version connectivity applies. For example, PHP OCI8 linked with Oracle Client 19c can connect to Oracle Database 11.2 onward. See Oracle's note "Oracle Client / Server Interoperability Support" (ID 207303.1) for details. @@ -55,12 +53,12 @@ Oracle's standard cross-version connectivity applies. For example, PHP OCI8 lin no - 2021-12-12 + 2023-04-22 - 3.2.1 - 3.2.1 + 3.3.0 + 3.3.0 stable @@ -68,7 +66,7 @@ Oracle's standard cross-version connectivity applies. For example, PHP OCI8 lin PHP - This version is for PHP 8.1 only. + This version is for PHP 8.2 only. Requires Oracle Client libraries from 11.2 or later. @@ -91,14 +89,14 @@ Oracle's standard cross-version connectivity applies. For example, PHP OCI8 lin - - + - + - + + @@ -111,12 +109,12 @@ Oracle's standard cross-version connectivity applies. For example, PHP OCI8 lin - + - + @@ -148,8 +146,8 @@ Oracle's standard cross-version connectivity applies. For example, PHP OCI8 lin - + @@ -173,43 +171,44 @@ Oracle's standard cross-version connectivity applies. For example, PHP OCI8 lin - - + - + - + - + - + - + - + - + - + - + - + + - + + + - @@ -219,20 +218,19 @@ Oracle's standard cross-version connectivity applies. For example, PHP OCI8 lin - + - + + - - @@ -240,6 +238,7 @@ Oracle's standard cross-version connectivity applies. For example, PHP OCI8 lin + @@ -258,21 +257,21 @@ Oracle's standard cross-version connectivity applies. For example, PHP OCI8 lin - + - - + + @@ -281,7 +280,6 @@ Oracle's standard cross-version connectivity applies. For example, PHP OCI8 lin - @@ -289,14 +287,15 @@ Oracle's standard cross-version connectivity applies. For example, PHP OCI8 lin - + + - + @@ -375,33 +374,33 @@ Oracle's standard cross-version connectivity applies. For example, PHP OCI8 lin - - + + - - + - - + + + - + @@ -412,8 +411,8 @@ Oracle's standard cross-version connectivity applies. For example, PHP OCI8 lin - + @@ -452,6 +451,23 @@ Oracle's standard cross-version connectivity applies. For example, PHP OCI8 lin + + + 3.2.1 + 3.2.1 + + + stable + stable + + PHP + + This version is for PHP 8.1 only. + + Requires Oracle Client libraries from 11.2 or later. + + + 3.2.0 diff --git a/ext/oci8/php_oci8.h b/ext/oci8/php_oci8.h index 5ed8c7bbe72c5..c87c2084d7fd5 100644 --- a/ext/oci8/php_oci8.h +++ b/ext/oci8/php_oci8.h @@ -40,7 +40,7 @@ */ #undef PHP_OCI8_VERSION #endif -#define PHP_OCI8_VERSION "3.2.1" +#define PHP_OCI8_VERSION "3.3.0" extern zend_module_entry oci8_module_entry; #define phpext_oci8_ptr &oci8_module_entry diff --git a/ext/oci8/tests/driver_name.phpt b/ext/oci8/tests/driver_name.phpt index 80b4740bc140b..32cb75a5dc0eb 100644 --- a/ext/oci8/tests/driver_name.phpt +++ b/ext/oci8/tests/driver_name.phpt @@ -57,11 +57,11 @@ function get_attr($conn) ?> --EXPECT-- **Test 1.1 - Default values for the attribute ************** -The value of DRIVER_NAME is PHP OCI8 : 3.2.1 +The value of DRIVER_NAME is PHP OCI8 : 3.3.0 ***Test 1.2 - Get the values from different connections ************** Testing with oci_pconnect() -The value of DRIVER_NAME is PHP OCI8 : 3.2.1 +The value of DRIVER_NAME is PHP OCI8 : 3.3.0 Testing with oci_new_connect() -The value of DRIVER_NAME is PHP OCI8 : 3.2.1 +The value of DRIVER_NAME is PHP OCI8 : 3.3.0 Done From 5855bdcd6c83ce272075bdde42af55e423e441fb Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Thu, 20 Apr 2023 10:18:18 +0200 Subject: [PATCH 45/51] Fix reference returned from CallbackFilterIterator::accept() Fixes oss-fuzz #58181 --- Zend/tests/oss_fuzz_58181.phpt | 14 ++++++++++++++ ext/spl/spl_iterators.c | 2 ++ 2 files changed, 16 insertions(+) create mode 100644 Zend/tests/oss_fuzz_58181.phpt diff --git a/Zend/tests/oss_fuzz_58181.phpt b/Zend/tests/oss_fuzz_58181.phpt new file mode 100644 index 0000000000000..36a0ba16d623e --- /dev/null +++ b/Zend/tests/oss_fuzz_58181.phpt @@ -0,0 +1,14 @@ +--TEST-- +oss-fuzz #58181: Fix unexpected reference returned from CallbackFilterIterator::accept() +--FILE-- + true); + $iterator->rewind(); +} + +test(['a', 'b']); +?> +--EXPECTF-- +Notice: Only variable references should be returned by reference in %s on line %d diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index 9c7ca4e324481..97253cfe93283 100644 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -1787,6 +1787,8 @@ PHP_METHOD(CallbackFilterIterator, accept) if (zend_call_function(fci, fcc) != SUCCESS || Z_ISUNDEF_P(return_value)) { RETURN_FALSE; + } else if (Z_ISREF_P(return_value)) { + zend_unwrap_reference(return_value); } } /* }}} */ From 4c38a79f09d51c483f133c79b47b792f8dc90ebf Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Thu, 20 Apr 2023 15:41:50 +0200 Subject: [PATCH 46/51] Fix incorrect CG(memoize_mode) state after bailout in ??= Fixes GH-11108 Closes GH-11109 --- NEWS | 2 ++ Zend/tests/gh11108.phpt | 11 +++++++++++ Zend/tests/gh11108_shutdown.inc | 5 +++++ Zend/tests/gh11108_test.inc | 3 +++ Zend/zend.c | 1 + 5 files changed, 22 insertions(+) create mode 100644 Zend/tests/gh11108.phpt create mode 100644 Zend/tests/gh11108_shutdown.inc create mode 100644 Zend/tests/gh11108_test.inc diff --git a/NEWS b/NEWS index 17294b8297422..cb6c70b760845 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,8 @@ PHP NEWS . Fixed bug GH-10737 (PHP 8.1.16 segfaults on line 597 of sapi/apache2handler/sapi_apache2.c). (nielsdos, ElliotNB) . Fixed bug GH-11028 (Heap Buffer Overflow in zval_undefined_cv.). (nielsdos) + . Fixed bug GH-11108 (Incorrect CG(memoize_mode) state after bailout in ??=). + (ilutov) - DOM: . Fixed bug #80602 (Segfault when using DOMChildNode::before()). diff --git a/Zend/tests/gh11108.phpt b/Zend/tests/gh11108.phpt new file mode 100644 index 0000000000000..efbd12dc367fa --- /dev/null +++ b/Zend/tests/gh11108.phpt @@ -0,0 +1,11 @@ +--TEST-- +GH-11108: Incorrect CG(memoize_mode) state after bailout in ??= +--FILE-- + +--EXPECTF-- +Fatal error: Cannot use [] for reading in %s on line %d diff --git a/Zend/tests/gh11108_shutdown.inc b/Zend/tests/gh11108_shutdown.inc new file mode 100644 index 0000000000000..34f8131d4a840 --- /dev/null +++ b/Zend/tests/gh11108_shutdown.inc @@ -0,0 +1,5 @@ + Date: Fri, 21 Apr 2023 11:29:56 +0100 Subject: [PATCH 47/51] Import timelib 2022.07 to address OSS fuzz issue --- NEWS | 2 ++ ext/date/lib/timelib.h | 6 +++--- ext/date/lib/tm2unixtime.c | 24 +++++++++++++++++++----- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/NEWS b/NEWS index c12c97fcf2a45..e7c600b29fa6d 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,8 @@ PHP NEWS - Date: . Fixed bug where the diff() method would not return the right result around DST changeover for date/times associated with a timezone identifier. (Derick) + . Fixed out-of-range bug when converting to/from around the LONG_MIN unix + timestamp. (Derick) - DOM: . Fixed bug #80602 (Segfault when using DOMChildNode::before()). diff --git a/ext/date/lib/timelib.h b/ext/date/lib/timelib.h index 97837fcee6cb6..e385b2e3468c2 100644 --- a/ext/date/lib/timelib.h +++ b/ext/date/lib/timelib.h @@ -30,9 +30,9 @@ # include "timelib_config.h" #endif -#define TIMELIB_VERSION 202206 -#define TIMELIB_EXTENDED_VERSION 20220601 -#define TIMELIB_ASCII_VERSION "2022.06" +#define TIMELIB_VERSION 202207 +#define TIMELIB_EXTENDED_VERSION 20220701 +#define TIMELIB_ASCII_VERSION "2022.07" #include #include diff --git a/ext/date/lib/tm2unixtime.c b/ext/date/lib/tm2unixtime.c index 37bfc98fa1d60..f13a9412406f3 100644 --- a/ext/date/lib/tm2unixtime.c +++ b/ext/date/lib/tm2unixtime.c @@ -32,8 +32,16 @@ static int days_in_month[13] = { 31, 31, 28, 31, 30, 31, 30, 31, 3 static void do_range_limit(timelib_sll start, timelib_sll end, timelib_sll adj, timelib_sll *a, timelib_sll *b) { if (*a < start) { - *b -= (start - *a - 1) / adj + 1; - *a += adj * ((start - *a - 1) / adj + 1); + /* We calculate 'a + 1' first as 'start - *a - 1' causes an int64_t overflows if *a is + * LONG_MIN. 'start' is 0 in this context, and '0 - LONG_MIN > LONG_MAX'. */ + timelib_sll a_plus_1 = *a + 1; + + *b -= (start - a_plus_1) / adj + 1; + + /* This code add the extra 'adj' separately, as otherwise this can overflow int64_t in + * situations where *b is near LONG_MIN. */ + *a += adj * ((start - a_plus_1) / adj); + *a += adj; } if (*a >= end) { *b += *a / adj; @@ -462,9 +470,15 @@ void timelib_update_ts(timelib_time* time, timelib_tzinfo* tzi) do_adjust_relative(time); do_adjust_special(time); - time->sse = - (timelib_epoch_days_from_time(time) * SECS_PER_DAY) + - timelib_hms_to_seconds(time->h, time->i, time->s); + /* You might be wondering, why this code does this in two steps. This is because + * timelib_epoch_days_from_time(time) * SECS_PER_DAY with the lowest limit of + * timelib_epoch_days_from_time() is less than the range of an int64_t. This then overflows. In + * order to be able to still allow for any time in that day that only halfly fits in the int64_t + * range, we add the time element first, which is always positive, and then twice half the value + * of the earliest day as expressed as unix timestamp. */ + time->sse = timelib_hms_to_seconds(time->h, time->i, time->s); + time->sse += timelib_epoch_days_from_time(time) * (SECS_PER_DAY / 2); + time->sse += timelib_epoch_days_from_time(time) * (SECS_PER_DAY / 2); // This modifies time->sse, if needed do_adjust_timezone(time, tzi); From 691ff9f845f11ed6f5d187d7a781ad86d689bf76 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 4 Mar 2023 01:45:46 +0100 Subject: [PATCH 48/51] Set error_log to an empty value if the test relies on that feature Some tests fail if the error_log is overriden by the loaded ini configuration. Explicitly set it to an empty value to prevent the failures. See https://github.com/php/php-src/issues/10737#issuecomment-1452899299 Closes GH-10772. --- Zend/tests/bug39542.phpt | 2 ++ Zend/tests/bug79919.phpt | 2 ++ ext/opcache/tests/jit/bug80861.phpt | 1 + 3 files changed, 5 insertions(+) diff --git a/Zend/tests/bug39542.phpt b/Zend/tests/bug39542.phpt index 79c1c56e9185b..d2023673ef0b5 100644 --- a/Zend/tests/bug39542.phpt +++ b/Zend/tests/bug39542.phpt @@ -1,5 +1,7 @@ --TEST-- Bug #39542 (Behaviour of require_once/include_once different to < 5.2.0) +--INI-- +error_log= --FILE-- Date: Tue, 25 Apr 2023 16:18:30 +0200 Subject: [PATCH 49/51] PHP-8.1 is now for PHP 8.1.20-dev --- NEWS | 5 ++++- Zend/zend.h | 2 +- configure.ac | 2 +- main/php_version.h | 6 +++--- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index cb6c70b760845..49a182e388476 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,9 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -?? ??? ????, PHP 8.1.19 +?? ??? ????, PHP 8.1.20 + + +11 May 2023, PHP 8.1.19 - Core: . Fix inconsistent float negation in constant expressions. (ilutov) diff --git a/Zend/zend.h b/Zend/zend.h index 863d06499c9c8..5c3c1de49d5ce 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -20,7 +20,7 @@ #ifndef ZEND_H #define ZEND_H -#define ZEND_VERSION "4.1.19-dev" +#define ZEND_VERSION "4.1.20-dev" #define ZEND_ENGINE_3 diff --git a/configure.ac b/configure.ac index 235a0bb304d97..166d313f133bc 100644 --- a/configure.ac +++ b/configure.ac @@ -17,7 +17,7 @@ dnl Basic autoconf initialization, generation of config.nice. dnl ---------------------------------------------------------------------------- AC_PREREQ([2.68]) -AC_INIT([PHP],[8.1.19-dev],[https://github.com/php/php-src/issues],[php],[https://www.php.net]) +AC_INIT([PHP],[8.1.20-dev],[https://github.com/php/php-src/issues],[php],[https://www.php.net]) AC_CONFIG_SRCDIR([main/php_version.h]) AC_CONFIG_AUX_DIR([build]) AC_PRESERVE_HELP_ORDER diff --git a/main/php_version.h b/main/php_version.h index d42ff869a27b1..8b01d87fbacc1 100644 --- a/main/php_version.h +++ b/main/php_version.h @@ -2,7 +2,7 @@ /* edit configure.ac to change version number */ #define PHP_MAJOR_VERSION 8 #define PHP_MINOR_VERSION 1 -#define PHP_RELEASE_VERSION 19 +#define PHP_RELEASE_VERSION 20 #define PHP_EXTRA_VERSION "-dev" -#define PHP_VERSION "8.1.19-dev" -#define PHP_VERSION_ID 80119 +#define PHP_VERSION "8.1.20-dev" +#define PHP_VERSION_ID 80120 From 8340d75d17e97c63fe5c1d0d4acf4d1fe039f57e Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Mon, 1 May 2023 13:16:13 +0200 Subject: [PATCH 50/51] Endless recursion when using + on array in foreach This reverts commit 84b4020eb4a8ebc45cb80164d4589cbf818f47f2. Fixes GH-11171 --- Zend/tests/gh10085_1.phpt | 22 ---------------------- Zend/tests/gh10085_2.phpt | 25 ------------------------- Zend/tests/gh11171.phpt | 15 +++++++++++++++ Zend/zend_operators.c | 18 ++++++------------ 4 files changed, 21 insertions(+), 59 deletions(-) delete mode 100644 Zend/tests/gh10085_1.phpt delete mode 100644 Zend/tests/gh10085_2.phpt create mode 100644 Zend/tests/gh11171.phpt diff --git a/Zend/tests/gh10085_1.phpt b/Zend/tests/gh10085_1.phpt deleted file mode 100644 index cc11c96a09d32..0000000000000 --- a/Zend/tests/gh10085_1.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -GH-10085: Assertion in add_function_array() ---FILE-- - ---EXPECT-- -array(2) { - [0]=> - array(2) { - [0]=> - array(0) { - } - [1]=> - int(0) - } - [1]=> - int(0) -} diff --git a/Zend/tests/gh10085_2.phpt b/Zend/tests/gh10085_2.phpt deleted file mode 100644 index 7895999f2cd05..0000000000000 --- a/Zend/tests/gh10085_2.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -GH-10085: Assertion in add_function_array() ---FILE-- - ---EXPECT-- -array(2) { - [0]=> - array(2) { - [0]=> - array(0) { - } - [1]=> - int(0) - } - [1]=> - int(0) -} diff --git a/Zend/tests/gh11171.phpt b/Zend/tests/gh11171.phpt new file mode 100644 index 0000000000000..8bda7da0b7b41 --- /dev/null +++ b/Zend/tests/gh11171.phpt @@ -0,0 +1,15 @@ +--TEST-- +GH-11171: Test +--FILE-- + +--EXPECT-- +array(1) { + [0]=> + &string(4) "test" +} diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 35df118cb2172..02ca378bd854f 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -1015,22 +1015,16 @@ static ZEND_COLD zend_never_inline void ZEND_FASTCALL zend_binop_error(const cha static zend_never_inline void ZEND_FASTCALL add_function_array(zval *result, zval *op1, zval *op2) /* {{{ */ { + if (result == op1 && Z_ARR_P(op1) == Z_ARR_P(op2)) { + /* $a += $a */ + return; + } if (result != op1) { ZVAL_ARR(result, zend_array_dup(Z_ARR_P(op1))); - zend_hash_merge(Z_ARRVAL_P(result), Z_ARRVAL_P(op2), zval_add_ref, 0); - } else if (Z_ARR_P(op1) == Z_ARR_P(op2)) { - /* $a += $a */ } else { - /* We have to duplicate op1 (even with refcount == 1) because it may be an element of op2 - * and therefore its reference counter may be increased by zend_hash_merge(). That leads to - * an assertion in _zend_hash_add_or_update_i() that only allows adding elements to hash - * tables with RC1. See GH-10085 and Zend/tests/gh10085*.phpt */ - zval tmp; - ZVAL_ARR(&tmp, zend_array_dup(Z_ARR_P(op1))); - zend_hash_merge(Z_ARRVAL(tmp), Z_ARRVAL_P(op2), zval_add_ref, 0); - zval_ptr_dtor(result); - ZVAL_COPY_VALUE(result, &tmp); + SEPARATE_ARRAY(result); } + zend_hash_merge(Z_ARRVAL_P(result), Z_ARRVAL_P(op2), zval_add_ref, 0); } /* }}} */ From 007ab4dc8d8488d768fac3c26ba1143483ce78ac Mon Sep 17 00:00:00 2001 From: Sergey Panteleev Date: Tue, 9 May 2023 09:23:26 +0300 Subject: [PATCH 51/51] Update versions for PHP 8.2.6 --- NEWS | 2 +- Zend/zend.h | 2 +- configure.ac | 2 +- main/php_version.h | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index e7c600b29fa6d..84b4fe5d409b1 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,6 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -?? ??? ????, PHP 8.2.6 +11 May 2023, PHP 8.2.6 - Core: . Fix inconsistent float negation in constant expressions. (ilutov) diff --git a/Zend/zend.h b/Zend/zend.h index f5ea5dc911603..e5f913a9f905c 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -20,7 +20,7 @@ #ifndef ZEND_H #define ZEND_H -#define ZEND_VERSION "4.2.6-dev" +#define ZEND_VERSION "4.2.6" #define ZEND_ENGINE_3 diff --git a/configure.ac b/configure.ac index 899ead28d3dbf..d0e2f225b2835 100644 --- a/configure.ac +++ b/configure.ac @@ -17,7 +17,7 @@ dnl Basic autoconf initialization, generation of config.nice. dnl ---------------------------------------------------------------------------- AC_PREREQ([2.68]) -AC_INIT([PHP],[8.2.6-dev],[https://github.com/php/php-src/issues],[php],[https://www.php.net]) +AC_INIT([PHP],[8.2.6],[https://github.com/php/php-src/issues],[php],[https://www.php.net]) AC_CONFIG_SRCDIR([main/php_version.h]) AC_CONFIG_AUX_DIR([build]) AC_PRESERVE_HELP_ORDER diff --git a/main/php_version.h b/main/php_version.h index 1ce7c926d8697..f4efb4a69112d 100644 --- a/main/php_version.h +++ b/main/php_version.h @@ -3,6 +3,6 @@ #define PHP_MAJOR_VERSION 8 #define PHP_MINOR_VERSION 2 #define PHP_RELEASE_VERSION 6 -#define PHP_EXTRA_VERSION "-dev" -#define PHP_VERSION "8.2.6-dev" +#define PHP_EXTRA_VERSION "" +#define PHP_VERSION "8.2.6" #define PHP_VERSION_ID 80206