mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-25 09:55:41 +00:00
Compare commits
176
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e330d3d48 | ||
|
|
d466e966ef | ||
|
|
b8048de333 | ||
|
|
c099c71ea5 | ||
|
|
f930ff52f4 | ||
|
|
f5939563f6 | ||
|
|
f15ab32af8 | ||
|
|
53140e5c56 | ||
|
|
2adf1c4d23 | ||
|
|
6c48da9a50 | ||
|
|
6adb885966 | ||
|
|
d31fc591e0 | ||
|
|
5b51b633e2 | ||
|
|
49762c84e0 | ||
|
|
45b4368d5c | ||
|
|
8654c32b58 | ||
|
|
8c6a7c3326 | ||
|
|
56cdbe63c2 | ||
|
|
3d9c02364d | ||
|
|
d0d60503b5 | ||
|
|
9e6358af36 | ||
|
|
f133f0024e | ||
|
|
ad000a63e8 | ||
|
|
ab5b6702d7 | ||
|
|
31dd45564c | ||
|
|
2aecf3aba9 | ||
|
|
63f6608f89 | ||
|
|
08073b0658 | ||
|
|
16c7c71693 | ||
|
|
788065fb8c | ||
|
|
5009b9811d | ||
|
|
2831334bd3 | ||
|
|
7df594b943 | ||
|
|
6facfa59a5 | ||
|
|
409965fe1c | ||
|
|
0966941130 | ||
|
|
2826364298 | ||
|
|
e5c95234d8 | ||
|
|
d76f7c6c63 | ||
|
|
392dada1d6 | ||
|
|
8308196c97 | ||
|
|
8ebadd1128 | ||
|
|
cec8b24c84 | ||
|
|
7b464ce6f3 | ||
|
|
f649adedfe | ||
|
|
674d44ad7c | ||
|
|
b9738f5802 | ||
|
|
5e2ea00b15 | ||
|
|
13bfa9f5ac | ||
|
|
e3632fdc0d | ||
|
|
079905acd5 | ||
|
|
fe1bfb78d6 | ||
|
|
b93e4aa11c | ||
|
|
c2935499b1 | ||
|
|
ef1e4891b4 | ||
|
|
8226e704e4 | ||
|
|
494615fcb8 | ||
|
|
6ccd675776 | ||
|
|
a62c06c4cf | ||
|
|
560ff9725e | ||
|
|
392ad206a4 | ||
|
|
136f51f1e1 | ||
|
|
fd08f062ae | ||
|
|
b836d9cdc1 | ||
|
|
a1f2f8f06e | ||
|
|
49cbd23155 | ||
|
|
372b678e56 | ||
|
|
2c2cbbbf55 | ||
|
|
67421a780d | ||
|
|
f720fb1e21 | ||
|
|
db9776c53c | ||
|
|
dd3c664f8f | ||
|
|
2dc170e25d | ||
|
|
f1bf4bf6eb | ||
|
|
9be31a582a | ||
|
|
5a9475f4b9 | ||
|
|
7e2bd95fa5 | ||
|
|
9eff906a02 | ||
|
|
3046e35718 | ||
|
|
b67fc51859 | ||
|
|
25ec7eb346 | ||
|
|
5c90f8eb66 | ||
|
|
2bcbc95f03 | ||
|
|
0f79b1bf30 | ||
|
|
f79c774274 | ||
|
|
07bda97e76 | ||
|
|
018251a7c4 | ||
|
|
1752393bb4 | ||
|
|
f6dea34831 | ||
|
|
bc529b92ee | ||
|
|
0dda4a844e | ||
|
|
38c0a53b60 | ||
|
|
06e78cad83 | ||
|
|
ae2150692a | ||
|
|
4bec59f175 | ||
|
|
2c5860517c | ||
|
|
c05a069adf | ||
|
|
18172303f4 | ||
|
|
b48f2625b5 | ||
|
|
0cecf83b26 | ||
|
|
1aa419dcdc | ||
|
|
c47b18a222 | ||
|
|
27bb3289ac | ||
|
|
37d11d123e | ||
|
|
7e39e6934d | ||
|
|
c62cd9a43a | ||
|
|
cbb0efaeeb | ||
|
|
eb846939b1 | ||
|
|
3e35b08980 | ||
|
|
0f078f6e78 | ||
|
|
bacfae8baf | ||
|
|
22dec2b323 | ||
|
|
864f5ef12f | ||
|
|
897d99c7a4 | ||
|
|
189f625e2b | ||
|
|
3d50131ef7 | ||
|
|
b94c28b0e6 | ||
|
|
0e413241ec | ||
|
|
9705e631a4 | ||
|
|
a62154564d | ||
|
|
5cb4686753 | ||
|
|
6d5cddabaf | ||
|
|
c14eb8de97 | ||
|
|
b74a300edf | ||
|
|
a65b8abf2c | ||
|
|
d348cfb96f | ||
|
|
eb23c60087 | ||
|
|
b771a18133 | ||
|
|
0e6c0654ed | ||
|
|
a5a15965da | ||
|
|
518a160b65 | ||
|
|
621598eaa8 | ||
|
|
87691e74e5 | ||
|
|
17a9f1401a | ||
|
|
e1202733a5 | ||
|
|
b5d2cbe027 | ||
|
|
249e49092d | ||
|
|
fac43d6515 | ||
|
|
c8e9aa854c | ||
|
|
65bbc67063 | ||
|
|
3444b90746 | ||
|
|
d2cfb63f02 | ||
|
|
861fa60814 | ||
|
|
600f1f898f | ||
|
|
bb735c9e9e | ||
|
|
3d81c54879 | ||
|
|
db420cb6a1 | ||
|
|
1979c5d16f | ||
|
|
8c4b0ddde5 | ||
|
|
ff2140c49d | ||
|
|
c55d09c2f5 | ||
|
|
fee38633d2 | ||
|
|
23c65a8173 | ||
|
|
bb30fe9e2b | ||
|
|
e1da72bdf1 | ||
|
|
e981f5af51 | ||
|
|
c7141412ce | ||
|
|
b4f501d5a4 | ||
|
|
9b92c1d154 | ||
|
|
3b46fbfc36 | ||
|
|
f6eac76b65 | ||
|
|
e72e3370c6 | ||
|
|
a2c41c0ea6 | ||
|
|
39d04f15f8 | ||
|
|
9083e178f6 | ||
|
|
ea2a125789 | ||
|
|
2c9926f156 | ||
|
|
4a55794b98 | ||
|
|
b9dfa12853 | ||
|
|
6dcc0b859f | ||
|
|
29f4939923 | ||
|
|
ee243bc471 | ||
|
|
8d2a9d8859 | ||
|
|
5fa6dcd972 | ||
|
|
6d4965febd | ||
|
|
4c9ba3e042 |
No files matched your search
@@ -1,5 +1,230 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
19 Mar 2020, PHP 7.3.16
|
||||
|
||||
- Core:
|
||||
. Fixed bug #63206 (restore_error_handler does not restore previous errors
|
||||
mask). (Mark Plomer)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #66322 (COMPersistHelper::SaveToFile can save to wrong location).
|
||||
(cmb)
|
||||
. Fixed bug #79242 (COM error constants don't match com_exception codes on
|
||||
x86). (cmb)
|
||||
. Fixed bug #79248 (Traversing empty VT_ARRAY throws com_exception). (cmb)
|
||||
. Fixed bug #79299 (com_print_typeinfo prints duplicate variables). (Litiano
|
||||
Moura)
|
||||
. Fixed bug #79332 (php_istreams are never freed). (cmb)
|
||||
. Fixed bug #79333 (com_print_typeinfo() leaks memory). (cmb)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug #77569: (Write Access Violation in DomImplementation). (Nikita,
|
||||
cmb)
|
||||
. Fixed bug #79271 (DOMDocumentType::$childNodes is NULL). (cmb)
|
||||
|
||||
- Enchant:
|
||||
. Fixed bug #79311 (enchant_dict_suggest() fails on big endian architecture).
|
||||
(cmb)
|
||||
|
||||
- EXIF:
|
||||
. Fixed bug #79282 (Use-of-uninitialized-value in exif). (CVE-2020-7064)
|
||||
(Nikita)
|
||||
|
||||
- MBstring:
|
||||
. Fixed bug #79371 (mb_strtolower (UTF-32LE): stack-buffer-overflow at
|
||||
php_unicode_tolower_full). (CVE-2020-7065) (cmb)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #64032 (mysqli reports different client_version). (cmb)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #79188 (Memory corruption in preg_replace/preg_replace_callback
|
||||
and unicode). (Nikita)
|
||||
|
||||
- PDO_ODBC:
|
||||
. Fixed bug #79038 (PDOStatement::nextRowset() leaks column values). (cmb)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #79062 (Property with heredoc default value returns false for
|
||||
getDocComment). (Nikita)
|
||||
|
||||
- SQLite3:
|
||||
. Fixed bug #79294 (::columnType() may fail after SQLite3Stmt::reset()). (cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #79329 (get_headers() silently truncates after a null byte).
|
||||
(CVE-2020-7066) (cmb)
|
||||
. Fixed bug #79254 (getenv() w/o arguments not showing changes). (cmb)
|
||||
. Fixed bug #79265 (Improper injection of Host header when using fopen for
|
||||
http requests). (Miguel Xavier Penha Neto)
|
||||
|
||||
20 Feb 2020, PHP 7.3.15
|
||||
|
||||
- Core:
|
||||
. Fixed bug #71876 (Memory corruption htmlspecialchars(): charset `*' not
|
||||
supported). (Nikita)
|
||||
. Fixed bug #79146 (cscript can fail to run on some systems). (clarodeus)
|
||||
. Fixed bug #78323 (Code 0 is returned on invalid options). (Ivan Mikheykin)
|
||||
. Fixed bug #76047 (Use-after-free when accessing already destructed
|
||||
backtrace arguments). (Nikita)
|
||||
|
||||
- CURL:
|
||||
. Fixed bug #79078 (Hypothetical use-after-free in curl_multi_add_handle()).
|
||||
(cmb)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #79212 (NumberFormatter::format() may detect wrong type). (cmb)
|
||||
|
||||
- Libxml:
|
||||
. Fixed bug #79191 (Error in SoapClient ctor disables DOMDocument::save()).
|
||||
(Nikita, cmb)
|
||||
|
||||
- MBString:
|
||||
. Fixed bug #79154 (mb_convert_encoding() can modify $from_encoding). (cmb)
|
||||
|
||||
- MySQLnd:
|
||||
. Fixed bug #79084 (mysqlnd may fetch wrong column indexes with MYSQLI_BOTH).
|
||||
(cmb)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #79145 (openssl memory leak). (cmb, Nikita)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #79082 (Files added to tar with Phar::buildFromIterator have
|
||||
all-access permissions). (CVE-2020-7063) (stas)
|
||||
. Fixed bug #79171 (heap-buffer-overflow in phar_extract_file).
|
||||
(CVE-2020-7061) (cmb)
|
||||
. Fixed bug #76584 (PharFileInfo::decompress not working). (cmb)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #79115 (ReflectionClass::isCloneable call reflected class
|
||||
__destruct). (Nikita)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #79221 (Null Pointer Dereference in PHP Session Upload Progress).
|
||||
(CVE-2020-7062) (stas)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #79151 (heap use after free caused by
|
||||
spl_dllist_it_helper_move_forward). (Nikita)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #78902 (Memory leak when using stream_filter_append). (liudaixiao)
|
||||
|
||||
- Testing:
|
||||
. Fixed bug #78090 (bug45161.phpt takes forever to finish). (cmb)
|
||||
|
||||
- XSL:
|
||||
. Fixed bug #70078 (XSL callbacks with nodes as parameter leak memory). (cmb)
|
||||
|
||||
23 Jan 2020, PHP 7.3.14
|
||||
|
||||
- Core
|
||||
. Fixed bug #78999 (Cycle leak when using function result as temporary).
|
||||
(Dmitry)
|
||||
|
||||
- CURL:
|
||||
. Fixed bug #79033 (Curl timeout error with specific url and post). (cmb)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #79015 (undefined-behavior in php_date.c). (cmb)
|
||||
|
||||
- DBA:
|
||||
. Fixed bug #78808 ([LMDB] MDB_MAP_FULL: Environment mapsize limit reached).
|
||||
(cmb)
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #74170 (locale information change after mime_content_type).
|
||||
(Sergei Turchanov)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #78923 (Artifacts when convoluting image with transparency).
|
||||
(wilson chen)
|
||||
. Fixed bug #79067 (gdTransformAffineCopy() may use unitialized values). (cmb)
|
||||
. Fixed bug #79068 (gdTransformAffineCopy() changes interpolation method).
|
||||
(cmb)
|
||||
|
||||
- Libxml:
|
||||
. Fixed bug #79029 (Use After Free's in XMLReader / XMLWriter). (Laruence)
|
||||
|
||||
- Mbstring:
|
||||
. Fixed bug #79037 (global buffer-overflow in `mbfl_filt_conv_big5_wchar`).
|
||||
(CVE-2020-7060) (Nikita)
|
||||
|
||||
- OPcache:
|
||||
. Fixed bug #79040 (Warning Opcode handlers are unusable due to ASLR). (cmb)
|
||||
|
||||
- Pcntl:
|
||||
. Fixed bug #78402 (Converting null to string in error message is bad DX).
|
||||
(SATŌ Kentarō)
|
||||
|
||||
- PDO_PgSQL:
|
||||
. Fixed bug #78983 (pdo_pgsql config.w32 cannot find libpq-fe.h). (SATŌ
|
||||
Kentarō)
|
||||
. Fixed bug #78980 (pgsqlGetNotify() overlooks dead connection). (SATŌ
|
||||
Kentarō)
|
||||
. Fixed bug #78982 (pdo_pgsql returns dead persistent connection). (SATŌ
|
||||
Kentarō)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #79091 (heap use-after-free in session_create_id()). (cmb, Nikita)
|
||||
|
||||
- Shmop:
|
||||
. Fixed bug #78538 (shmop memory leak). (cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #79099 (OOB read in php_strip_tags_ex). (CVE-2020-7059). (cmb)
|
||||
. Fixed bug #54298 (Using empty additional_headers adding extraneous CRLF).
|
||||
(cmb)
|
||||
|
||||
18 Dec 2019, PHP 7.3.13
|
||||
|
||||
- Bcmath:
|
||||
. Fixed bug #78878 (Buffer underflow in bc_shift_addsub). (CVE-2019-11046).
|
||||
(cmb)
|
||||
|
||||
- Core:
|
||||
. Fixed bug #78862 (link() silently truncates after a null byte on Windows).
|
||||
(CVE-2019-11044). (cmb)
|
||||
. Fixed bug #78863 (DirectoryIterator class silently truncates after a null
|
||||
byte). (CVE-2019-11045). (cmb)
|
||||
. Fixed bug #78943 (mail() may release string with refcount==1 twice).
|
||||
(CVE-2019-11049). (cmb)
|
||||
. Fixed bug #78787 (Segfault with trait overriding inherited private shadow
|
||||
property). (Nikita)
|
||||
. Fixed bug #78868 (Calling __autoload() with incorrect EG(fake_scope) value).
|
||||
(Antony Dovgal, Dmitry)
|
||||
. Fixed bug #78296 (is_file fails to detect file). (cmb)
|
||||
|
||||
- EXIF:
|
||||
. Fixed bug #78793 (Use-after-free in exif parsing under memory sanitizer).
|
||||
(CVE-2019-11050). (Nikita)
|
||||
. Fixed bug #78910 (Heap-buffer-overflow READ in exif). (CVE-2019-11047).
|
||||
(Nikita)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #78849 (GD build broken with -D SIGNED_COMPARE_SLOW). (cmb)
|
||||
|
||||
- MBString:
|
||||
. Upgraded bundled Oniguruma to 6.9.4. (cmb)
|
||||
|
||||
- OPcache:
|
||||
. Fixed potential ASLR related invalid opline handler issues. (cmb)
|
||||
. Fixed $x = (bool)$x; with opcache (should emit undeclared variable notice).
|
||||
(Tyson Andre)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #78853 (preg_match() may return integer > 1). (cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #78759 (array_search in $GLOBALS). (Nikita)
|
||||
. Fixed bug #77638 (var_export'ing certain class instances segfaults). (cmb)
|
||||
. Fixed bug #78840 (imploding $GLOBALS crashes). (cmb)
|
||||
. Fixed bug #78833 (Integer overflow in pack causes out-of-bound access).
|
||||
(cmb)
|
||||
. Fixed bug #78814 (strip_tags allows / in tag name => whitelist bypass).
|
||||
(cmb)
|
||||
|
||||
21 Nov 2019, PHP 7.3.12
|
||||
|
||||
- Core:
|
||||
|
||||
+7
-1
@@ -721,6 +721,7 @@ TSRM_API void *shmat(int key, const void *shmaddr, int flags)
|
||||
TSRM_API int shmdt(const void *shmaddr)
|
||||
{/*{{{*/
|
||||
shm_pair *shm = shm_get(0, (void*)shmaddr);
|
||||
int ret;
|
||||
|
||||
if (!shm->segment) {
|
||||
return -1;
|
||||
@@ -730,7 +731,12 @@ TSRM_API int shmdt(const void *shmaddr)
|
||||
shm->descriptor->shm_lpid = getpid();
|
||||
shm->descriptor->shm_nattch--;
|
||||
|
||||
return UnmapViewOfFile(shm->addr) ? 0 : -1;
|
||||
ret = UnmapViewOfFile(shm->addr) ? 0 : -1;
|
||||
if (!ret && shm->descriptor->shm_nattch <= 0) {
|
||||
ret = UnmapViewOfFile(shm->descriptor) ? 0 : -1;
|
||||
shm->descriptor = NULL;
|
||||
}
|
||||
return ret;
|
||||
}/*}}}*/
|
||||
|
||||
TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf)
|
||||
|
||||
@@ -112,6 +112,12 @@ BCMath:
|
||||
. bcmul() and bcpow() now return numbers with the requested scale. Formerly,
|
||||
the returned numbers may have omitted trailing decimal zeroes.
|
||||
|
||||
DOM:
|
||||
. As of PHP 7.3.16, the value of the $childNodes property of DOMDocument,
|
||||
DOMNode, DOMProcessingInstruction, DOMComment, DOMText, DOMCdataSection and
|
||||
DOMNotation is now an empty DOMNodeList instead of NULL, according to the
|
||||
W3C and WHATWG standards and the PHP manual.
|
||||
|
||||
IMAP:
|
||||
rsh/ssh logins are disabled by default. Use imap.enable_insecure_rsh if you want
|
||||
to enable them. Note that the IMAP library does not filter mailbox names before
|
||||
@@ -490,6 +496,12 @@ JSON:
|
||||
Curl:
|
||||
. libcurl >= 7.15.5 is now required.
|
||||
|
||||
DBA:
|
||||
. As of PHP 7.3.14, dba_open() accepts a fifth optional parameter for lmdb
|
||||
databases which allows to specify the mapsize. The parameter defaults to
|
||||
zero, in which case the compiled in default mapsize (usually 1048576) will
|
||||
be used. The mapsize should be a multiple of the page size of the OS.
|
||||
|
||||
Filter:
|
||||
. FILTER_VALIDATE_FLOAT now also supports a `thousand` option, which
|
||||
defines the set of allowed thousand separator chars. The default (`"',."`)
|
||||
|
||||
@@ -94,7 +94,7 @@ L0:
|
||||
}
|
||||
}));
|
||||
|
||||
assert(0 && ($a = function &(array &$a, X $b = null) use ($c,&$d) : X {
|
||||
assert(0 && ($a = function &(?array &$a, X $b = null) use ($c,&$d) : X {
|
||||
class A {
|
||||
use T1, T2 {
|
||||
T1::foo insteadof foo;
|
||||
@@ -244,7 +244,7 @@ Warning: assert(): assert(0 && ($a = function &(array &$a, X $b = null) use($c,
|
||||
|
||||
})) failed in %sexpect_015.php on line %d
|
||||
|
||||
Warning: assert(): assert(0 && ($a = function &(array &$a, X $b = null) use($c, &$d): X {
|
||||
Warning: assert(): assert(0 && ($a = function &(?array &$a, X $b = null) use($c, &$d): X {
|
||||
class A {
|
||||
use T1, T2 {
|
||||
T1::foo insteadof foo;
|
||||
|
||||
@@ -25,9 +25,8 @@ try {
|
||||
--EXPECTF--
|
||||
1. Exception: aaa in %sbug52361.php:5
|
||||
Stack trace:
|
||||
#0 %sbug52361.php(13): aaa->__destruct()
|
||||
#1 %sbug52361.php(16): bbb()
|
||||
#2 {main}
|
||||
#0 %sbug52361.php(16): aaa->__destruct()
|
||||
#1 {main}
|
||||
2. Exception: bbb in %sbug52361.php:13
|
||||
Stack trace:
|
||||
#0 %sbug52361.php(16): bbb()
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
Bug #63206 Fully support error_handler stacking, even inside the error_handler
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_error_handler(function() {
|
||||
echo 'First handler' . PHP_EOL;
|
||||
});
|
||||
|
||||
set_error_handler(function() {
|
||||
echo 'Second handler' . PHP_EOL;
|
||||
|
||||
set_error_handler(function() {
|
||||
echo 'Internal handler' . PHP_EOL;
|
||||
});
|
||||
|
||||
$triggerInternalNotice++; // warnings while handling the error should go into internal handler
|
||||
|
||||
restore_error_handler();
|
||||
});
|
||||
|
||||
$triggerNotice1++;
|
||||
$triggerNotice2++;
|
||||
?>
|
||||
--EXPECTF--
|
||||
Second handler
|
||||
Internal handler
|
||||
Second handler
|
||||
Internal handler
|
||||
@@ -0,0 +1,26 @@
|
||||
--TEST--
|
||||
Bug #63206 Fully support error_handler stacking, even with null
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_error_handler(function() {
|
||||
echo 'First handler' . PHP_EOL;
|
||||
});
|
||||
|
||||
set_error_handler(function() {
|
||||
echo 'Second handler' . PHP_EOL;
|
||||
});
|
||||
|
||||
set_error_handler(null);
|
||||
|
||||
set_error_handler(function() {
|
||||
echo 'Fourth handler' . PHP_EOL;
|
||||
});
|
||||
|
||||
restore_error_handler();
|
||||
restore_error_handler();
|
||||
|
||||
$triggerNotice++;
|
||||
?>
|
||||
--EXPECTF--
|
||||
Second handler
|
||||
@@ -0,0 +1,26 @@
|
||||
--TEST--
|
||||
Bug #63206 Fully support exception_handler stacking, even with null
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_exception_handler(function() {
|
||||
echo 'First handler' . PHP_EOL;
|
||||
});
|
||||
|
||||
set_exception_handler(function() {
|
||||
echo 'Second handler' . PHP_EOL;
|
||||
});
|
||||
|
||||
set_exception_handler(null);
|
||||
|
||||
set_exception_handler(function() {
|
||||
echo 'Fourth handler' . PHP_EOL;
|
||||
});
|
||||
|
||||
restore_exception_handler();
|
||||
restore_exception_handler();
|
||||
|
||||
throw new Exception();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Second handler
|
||||
@@ -0,0 +1,68 @@
|
||||
--TEST--
|
||||
Bug #76047: Use-after-free when accessing already destructed backtrace arguments
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Vuln {
|
||||
public $a;
|
||||
public function __destruct() {
|
||||
unset($this->a);
|
||||
$backtrace = (new Exception)->getTrace();
|
||||
var_dump($backtrace);
|
||||
}
|
||||
}
|
||||
|
||||
function test($arg) {
|
||||
$arg = str_shuffle(str_repeat('A', 79));
|
||||
$vuln = new Vuln();
|
||||
$vuln->a = $arg;
|
||||
}
|
||||
|
||||
function test2($arg) {
|
||||
$$arg = 1; // Trigger symbol table
|
||||
$arg = str_shuffle(str_repeat('A', 79));
|
||||
$vuln = new Vuln();
|
||||
$vuln->a = $arg;
|
||||
}
|
||||
|
||||
test('x');
|
||||
test2('x');
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(6) {
|
||||
["file"]=>
|
||||
string(%d) "%s"
|
||||
["line"]=>
|
||||
int(%d)
|
||||
["function"]=>
|
||||
string(10) "__destruct"
|
||||
["class"]=>
|
||||
string(4) "Vuln"
|
||||
["type"]=>
|
||||
string(2) "->"
|
||||
["args"]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(6) {
|
||||
["file"]=>
|
||||
string(%d) "%s"
|
||||
["line"]=>
|
||||
int(%d)
|
||||
["function"]=>
|
||||
string(10) "__destruct"
|
||||
["class"]=>
|
||||
string(4) "Vuln"
|
||||
["type"]=>
|
||||
string(2) "->"
|
||||
["args"]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #78787: Segfault with trait overriding inherited private shadow property
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
trait T {
|
||||
private $prop;
|
||||
}
|
||||
class C1 {
|
||||
/** Doc comment */
|
||||
private $prop;
|
||||
}
|
||||
class C2 extends C1 {
|
||||
}
|
||||
class C3 extends C2 {
|
||||
use T;
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -0,0 +1,33 @@
|
||||
--TEST--
|
||||
Bug #78868: Calling __autoload() with incorrect EG(fake_scope) value
|
||||
--FILE--
|
||||
<?php
|
||||
class C {
|
||||
private $private = 1;
|
||||
|
||||
function foo() {
|
||||
$this->private++; //fails with EG(fake_scope) != NULL && EG(fake_scope) != "C"
|
||||
}
|
||||
}
|
||||
|
||||
class A {
|
||||
static $foo = B::foo; //not resolved on include()
|
||||
}
|
||||
|
||||
function main_autoload($class_name) {
|
||||
$c = new C;
|
||||
$c->foo();
|
||||
//doesn't affect the error
|
||||
eval("class B {const foo = 1;}");
|
||||
}
|
||||
|
||||
spl_autoload_register('main_autoload', false);
|
||||
|
||||
$classA = new ReflectionClass("A");
|
||||
$props = $classA->getProperties();
|
||||
$props[0]->setValue(2); //causes constant resolving, which runs autoload, all with EG(fake_scope) == "A"
|
||||
|
||||
echo "OK\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -0,0 +1,36 @@
|
||||
--TEST--
|
||||
Bug #78921: When Reflection triggers class load, property visibility is incorrect
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
spl_autoload_register(function($className) {
|
||||
if ($className == 'PrivateStatic') {
|
||||
class PrivateStatic
|
||||
{
|
||||
const SOME_CONST = 13;
|
||||
private static $privateStaticVarArray = ['a', 'b', 'c'];
|
||||
private static $otherStatic;
|
||||
public static function init()
|
||||
{
|
||||
self::$otherStatic = self::$privateStaticVarArray;
|
||||
}
|
||||
}
|
||||
PrivateStatic::init();
|
||||
}
|
||||
});
|
||||
|
||||
class OtherClass
|
||||
{
|
||||
const MY_CONST = PrivateStatic::SOME_CONST;
|
||||
public static $prop = 'my property';
|
||||
}
|
||||
|
||||
$reflectionClass = new ReflectionClass('OtherClass');
|
||||
$reflectionProperty = $reflectionClass->getProperty('prop');
|
||||
$reflectionProperty->setAccessible(true);
|
||||
$value = $reflectionProperty->getValue();
|
||||
echo "Value is $value\n";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Value is my property
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #78999 (Cycle leak when using function result as temporary)
|
||||
--FILE--
|
||||
<?php
|
||||
function get() {
|
||||
$t = new stdClass;
|
||||
$t->prop = $t;
|
||||
return $t;
|
||||
}
|
||||
var_dump(get());
|
||||
var_dump(gc_collect_cycles());
|
||||
--EXPECT--
|
||||
object(stdClass)#1 (1) {
|
||||
["prop"]=>
|
||||
*RECURSION*
|
||||
}
|
||||
int(1)
|
||||
@@ -0,0 +1,9 @@
|
||||
--TEST--
|
||||
Incorrect constant evaluation of and/or (OSS-Fuzz #19255)
|
||||
--FILE--
|
||||
<?php
|
||||
const C = 0 && __namespace__;
|
||||
var_dump(C);
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
@@ -0,0 +1,28 @@
|
||||
--TEST--
|
||||
Freeing of function "name" when dynamic call fails
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
try {
|
||||
$bar = "bar";
|
||||
("foo" . $bar)();
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
try {
|
||||
$bar = ["bar"];
|
||||
(["foo"] + $bar)();
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
try {
|
||||
(new stdClass)();
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Call to undefined function foobar()
|
||||
Function name must be a string
|
||||
Function name must be a string
|
||||
@@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
Generator exceptions during shutdown should not be swallowed
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
try {
|
||||
echo "before yield\n";
|
||||
yield;
|
||||
echo "after yield\n";
|
||||
} finally {
|
||||
echo "before yield in finally\n";
|
||||
yield;
|
||||
echo "after yield in finally\n";
|
||||
}
|
||||
echo "after finally\n";
|
||||
}
|
||||
|
||||
$gen = gen();
|
||||
$gen->rewind();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
before yield
|
||||
before yield in finally
|
||||
|
||||
Fatal error: Uncaught Error: Cannot yield from finally in a force-closed generator in %s:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
+1
-1
@@ -20,7 +20,7 @@
|
||||
#ifndef ZEND_H
|
||||
#define ZEND_H
|
||||
|
||||
#define ZEND_VERSION "3.3.12"
|
||||
#define ZEND_VERSION "3.3.16"
|
||||
|
||||
#define ZEND_ENGINE_3
|
||||
|
||||
|
||||
@@ -4082,6 +4082,12 @@ ZEND_API int zend_update_static_property_ex(zend_class_entry *scope, zend_string
|
||||
zval *property;
|
||||
zend_class_entry *old_scope = EG(fake_scope);
|
||||
|
||||
if (UNEXPECTED(!(scope->ce_flags & ZEND_ACC_CONSTANTS_UPDATED))) {
|
||||
if (UNEXPECTED(zend_update_class_constants(scope)) != SUCCESS) {
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
EG(fake_scope) = scope;
|
||||
property = zend_std_get_static_property(scope, name, 0);
|
||||
EG(fake_scope) = old_scope;
|
||||
|
||||
@@ -2103,6 +2103,7 @@ static zend_long zend_mm_find_leaks(zend_mm_heap *heap, zend_mm_chunk *p, uint32
|
||||
}
|
||||
}
|
||||
p = p->next;
|
||||
i = ZEND_MM_FIRST_PAGE;
|
||||
} while (p != heap->main_chunk);
|
||||
return count;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1463,7 +1463,7 @@ simple_list:
|
||||
}
|
||||
break;
|
||||
case ZEND_AST_TYPE:
|
||||
switch (ast->attr) {
|
||||
switch (ast->attr & ~ZEND_TYPE_NULLABLE) {
|
||||
case IS_ARRAY: APPEND_STR("array");
|
||||
case IS_CALLABLE: APPEND_STR("callable");
|
||||
EMPTY_SWITCH_DEFAULT_CASE();
|
||||
|
||||
@@ -1665,11 +1665,11 @@ ZEND_FUNCTION(set_error_handler)
|
||||
|
||||
if (Z_TYPE(EG(user_error_handler)) != IS_UNDEF) {
|
||||
ZVAL_COPY(return_value, &EG(user_error_handler));
|
||||
|
||||
zend_stack_push(&EG(user_error_handlers_error_reporting), &EG(user_error_handler_error_reporting));
|
||||
zend_stack_push(&EG(user_error_handlers), &EG(user_error_handler));
|
||||
}
|
||||
|
||||
zend_stack_push(&EG(user_error_handlers_error_reporting), &EG(user_error_handler_error_reporting));
|
||||
zend_stack_push(&EG(user_error_handlers), &EG(user_error_handler));
|
||||
|
||||
if (Z_TYPE_P(error_handler) == IS_NULL) { /* unset user-defined handler */
|
||||
ZVAL_UNDEF(&EG(user_error_handler));
|
||||
return;
|
||||
@@ -1732,10 +1732,10 @@ ZEND_FUNCTION(set_exception_handler)
|
||||
|
||||
if (Z_TYPE(EG(user_exception_handler)) != IS_UNDEF) {
|
||||
ZVAL_COPY(return_value, &EG(user_exception_handler));
|
||||
|
||||
zend_stack_push(&EG(user_exception_handlers), &EG(user_exception_handler));
|
||||
}
|
||||
|
||||
zend_stack_push(&EG(user_exception_handlers), &EG(user_exception_handler));
|
||||
|
||||
if (Z_TYPE_P(exception_handler) == IS_NULL) { /* unset user-defined handler */
|
||||
ZVAL_UNDEF(&EG(user_exception_handler));
|
||||
return;
|
||||
|
||||
+17
-14
@@ -8549,25 +8549,28 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
|
||||
case ZEND_AST_AND:
|
||||
case ZEND_AST_OR:
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i <= 1; i++) {
|
||||
zend_eval_const_expr(&ast->child[i]);
|
||||
if (ast->child[i]->kind == ZEND_AST_ZVAL) {
|
||||
if (zend_is_true(zend_ast_get_zval(ast->child[i])) == (ast->kind == ZEND_AST_OR)) {
|
||||
ZVAL_BOOL(&result, ast->kind == ZEND_AST_OR);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ast->child[0]->kind != ZEND_AST_ZVAL || ast->child[1]->kind != ZEND_AST_ZVAL) {
|
||||
zend_bool child0_is_true, child1_is_true;
|
||||
zend_eval_const_expr(&ast->child[0]);
|
||||
zend_eval_const_expr(&ast->child[1]);
|
||||
if (ast->child[0]->kind != ZEND_AST_ZVAL) {
|
||||
return;
|
||||
}
|
||||
|
||||
child0_is_true = zend_is_true(zend_ast_get_zval(ast->child[0]));
|
||||
if (child0_is_true == (ast->kind == ZEND_AST_OR)) {
|
||||
ZVAL_BOOL(&result, ast->kind == ZEND_AST_OR);
|
||||
break;
|
||||
}
|
||||
|
||||
if (ast->child[1]->kind != ZEND_AST_ZVAL) {
|
||||
return;
|
||||
}
|
||||
|
||||
child1_is_true = zend_is_true(zend_ast_get_zval(ast->child[1]));
|
||||
if (ast->kind == ZEND_AST_OR) {
|
||||
ZVAL_BOOL(&result, zend_is_true(zend_ast_get_zval(ast->child[0])) || zend_is_true(zend_ast_get_zval(ast->child[1])));
|
||||
ZVAL_BOOL(&result, child0_is_true || child1_is_true);
|
||||
} else {
|
||||
ZVAL_BOOL(&result, zend_is_true(zend_ast_get_zval(ast->child[0])) && zend_is_true(zend_ast_get_zval(ast->child[1])));
|
||||
ZVAL_BOOL(&result, child0_is_true && child1_is_true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -836,6 +836,7 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k
|
||||
zend_string *lc_name;
|
||||
zend_fcall_info fcall_info;
|
||||
zend_fcall_info_cache fcall_cache;
|
||||
zend_class_entry *orig_fake_scope;
|
||||
|
||||
if (key) {
|
||||
lc_name = Z_STR_P(key);
|
||||
@@ -922,11 +923,14 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k
|
||||
fcall_cache.called_scope = NULL;
|
||||
fcall_cache.object = NULL;
|
||||
|
||||
orig_fake_scope = EG(fake_scope);
|
||||
EG(fake_scope) = NULL;
|
||||
zend_exception_save();
|
||||
if ((zend_call_function(&fcall_info, &fcall_cache) == SUCCESS) && !EG(exception)) {
|
||||
ce = zend_hash_find_ptr(EG(class_table), lc_name);
|
||||
}
|
||||
zend_exception_restore();
|
||||
EG(fake_scope) = orig_fake_scope;
|
||||
|
||||
zval_ptr_dtor(&args[0]);
|
||||
zval_ptr_dtor_str(&fcall_info.function_name);
|
||||
|
||||
@@ -827,9 +827,10 @@ try_again:
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
if (generator == orig_generator) {
|
||||
zend_generator_close(generator, 0);
|
||||
if (EG(current_execute_data) &&
|
||||
EG(current_execute_data)->func &&
|
||||
ZEND_USER_CODE(EG(current_execute_data)->func->common.type)) {
|
||||
if (!EG(current_execute_data)) {
|
||||
zend_throw_exception_internal(NULL);
|
||||
} else if (EG(current_execute_data)->func &&
|
||||
ZEND_USER_CODE(EG(current_execute_data)->func->common.type)) {
|
||||
zend_rethrow_exception(EG(current_execute_data));
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -1595,10 +1595,14 @@ static void zend_do_traits_property_binding(zend_class_entry *ce) /* {{{ */
|
||||
/* next: check for conflicts with current class */
|
||||
if ((coliding_prop = zend_hash_find_ptr(&ce->properties_info, prop_name)) != NULL) {
|
||||
if (coliding_prop->flags & ZEND_ACC_SHADOW) {
|
||||
zend_string_release_ex(coliding_prop->name, 0);
|
||||
if (coliding_prop->doc_comment) {
|
||||
zend_string_release_ex(coliding_prop->doc_comment, 0);
|
||||
}
|
||||
/* Only free if shadow is coming from direct parent,
|
||||
* otherwise these weren't copied in the first place. */
|
||||
if (coliding_prop->ce == ce->parent) {
|
||||
zend_string_release_ex(coliding_prop->name, 0);
|
||||
if (coliding_prop->doc_comment) {
|
||||
zend_string_release_ex(coliding_prop->doc_comment, 0);
|
||||
}
|
||||
}
|
||||
zend_hash_del(&ce->properties_info, prop_name);
|
||||
flags |= ZEND_ACC_CHANGED;
|
||||
} else {
|
||||
|
||||
@@ -310,7 +310,7 @@ static void zval_ini_dtor(zval *zv)
|
||||
%left '|' '&' '^'
|
||||
%right '~' '!'
|
||||
|
||||
%destructor { zval_ini_dtor(&$$); } TC_RAW TC_CONSTANT TC_NUMBER TC_STRING TC_WHITESPACE TC_LABEL TC_OFFSET TC_VARNAME BOOL_TRUE BOOL_FALSE NULL_NULL
|
||||
%destructor { zval_ini_dtor(&$$); } TC_RAW TC_CONSTANT TC_NUMBER TC_STRING TC_WHITESPACE TC_LABEL TC_OFFSET TC_VARNAME BOOL_TRUE BOOL_FALSE NULL_NULL cfg_var_ref constant_literal constant_string encapsed_list expr option_offset section_string_or_value string_or_value var_string_list var_string_list_section
|
||||
|
||||
%%
|
||||
|
||||
|
||||
+121
-118
@@ -1454,7 +1454,7 @@ yy3:
|
||||
++YYCURSOR;
|
||||
YYDEBUG(4, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 2765 "Zend/zend_language_scanner.l"
|
||||
#line 2768 "Zend/zend_language_scanner.l"
|
||||
{
|
||||
if (YYCURSOR > YYLIMIT) {
|
||||
RETURN_TOKEN(END);
|
||||
@@ -2269,7 +2269,7 @@ yy62:
|
||||
++YYCURSOR;
|
||||
YYDEBUG(63, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 2412 "Zend/zend_language_scanner.l"
|
||||
#line 2415 "Zend/zend_language_scanner.l"
|
||||
{
|
||||
BEGIN(ST_BACKQUOTE);
|
||||
RETURN_TOKEN('`');
|
||||
@@ -4730,6 +4730,7 @@ yy397:
|
||||
|
||||
if (is_heredoc && !SCNG(heredoc_scan_ahead)) {
|
||||
zend_lex_state current_state;
|
||||
zend_string *saved_doc_comment = CG(doc_comment);
|
||||
int heredoc_nesting_level = 1;
|
||||
int first_token = 0;
|
||||
int error = 0;
|
||||
@@ -4740,6 +4741,7 @@ yy397:
|
||||
SCNG(heredoc_indentation) = 0;
|
||||
SCNG(heredoc_indentation_uses_spaces) = 0;
|
||||
LANG_SCNG(on_event) = NULL;
|
||||
CG(doc_comment) = NULL;
|
||||
|
||||
zend_ptr_stack_reverse_apply(¤t_state.heredoc_label_stack, copy_heredoc_label_stack);
|
||||
|
||||
@@ -4789,6 +4791,7 @@ yy397:
|
||||
zend_restore_lexical_state(¤t_state);
|
||||
SCNG(heredoc_scan_ahead) = 0;
|
||||
CG(increment_lineno) = 0;
|
||||
CG(doc_comment) = saved_doc_comment;
|
||||
|
||||
if (PARSER_MODE() && error) {
|
||||
RETURN_TOKEN(T_ERROR);
|
||||
@@ -4797,7 +4800,7 @@ yy397:
|
||||
|
||||
RETURN_TOKEN(T_START_HEREDOC);
|
||||
}
|
||||
#line 4801 "Zend/zend_language_scanner.c"
|
||||
#line 4804 "Zend/zend_language_scanner.c"
|
||||
yy398:
|
||||
YYDEBUG(398, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -4821,7 +4824,7 @@ yy400:
|
||||
{
|
||||
RETURN_TOKEN(T_ARRAY);
|
||||
}
|
||||
#line 4825 "Zend/zend_language_scanner.c"
|
||||
#line 4828 "Zend/zend_language_scanner.c"
|
||||
yy402:
|
||||
YYDEBUG(402, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -4834,7 +4837,7 @@ yy402:
|
||||
{
|
||||
RETURN_TOKEN(T_BREAK);
|
||||
}
|
||||
#line 4838 "Zend/zend_language_scanner.c"
|
||||
#line 4841 "Zend/zend_language_scanner.c"
|
||||
yy404:
|
||||
YYDEBUG(404, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -4853,7 +4856,7 @@ yy405:
|
||||
{
|
||||
RETURN_TOKEN(T_CATCH);
|
||||
}
|
||||
#line 4857 "Zend/zend_language_scanner.c"
|
||||
#line 4860 "Zend/zend_language_scanner.c"
|
||||
yy407:
|
||||
YYDEBUG(407, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -4866,7 +4869,7 @@ yy407:
|
||||
{
|
||||
RETURN_TOKEN(T_CLASS);
|
||||
}
|
||||
#line 4870 "Zend/zend_language_scanner.c"
|
||||
#line 4873 "Zend/zend_language_scanner.c"
|
||||
yy409:
|
||||
YYDEBUG(409, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -4879,7 +4882,7 @@ yy409:
|
||||
{
|
||||
RETURN_TOKEN(T_CLONE);
|
||||
}
|
||||
#line 4883 "Zend/zend_language_scanner.c"
|
||||
#line 4886 "Zend/zend_language_scanner.c"
|
||||
yy411:
|
||||
YYDEBUG(411, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -4892,7 +4895,7 @@ yy411:
|
||||
{
|
||||
RETURN_TOKEN(T_CONST);
|
||||
}
|
||||
#line 4896 "Zend/zend_language_scanner.c"
|
||||
#line 4899 "Zend/zend_language_scanner.c"
|
||||
yy413:
|
||||
YYDEBUG(413, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -4929,7 +4932,7 @@ yy417:
|
||||
{
|
||||
RETURN_TOKEN(T_EMPTY);
|
||||
}
|
||||
#line 4933 "Zend/zend_language_scanner.c"
|
||||
#line 4936 "Zend/zend_language_scanner.c"
|
||||
yy419:
|
||||
YYDEBUG(419, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -4954,7 +4957,7 @@ yy421:
|
||||
{
|
||||
RETURN_TOKEN(T_ENDIF);
|
||||
}
|
||||
#line 4958 "Zend/zend_language_scanner.c"
|
||||
#line 4961 "Zend/zend_language_scanner.c"
|
||||
yy423:
|
||||
YYDEBUG(423, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5000,7 +5003,7 @@ yy427:
|
||||
{
|
||||
RETURN_TOKEN(T_FINAL);
|
||||
}
|
||||
#line 5004 "Zend/zend_language_scanner.c"
|
||||
#line 5007 "Zend/zend_language_scanner.c"
|
||||
yy428:
|
||||
YYDEBUG(428, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5061,7 +5064,7 @@ yy436:
|
||||
{
|
||||
RETURN_TOKEN(T_ISSET);
|
||||
}
|
||||
#line 5065 "Zend/zend_language_scanner.c"
|
||||
#line 5068 "Zend/zend_language_scanner.c"
|
||||
yy438:
|
||||
YYDEBUG(438, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5080,7 +5083,7 @@ yy439:
|
||||
{
|
||||
RETURN_TOKEN(T_PRINT);
|
||||
}
|
||||
#line 5084 "Zend/zend_language_scanner.c"
|
||||
#line 5087 "Zend/zend_language_scanner.c"
|
||||
yy441:
|
||||
YYDEBUG(441, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5135,7 +5138,7 @@ yy448:
|
||||
{
|
||||
RETURN_TOKEN(T_THROW);
|
||||
}
|
||||
#line 5139 "Zend/zend_language_scanner.c"
|
||||
#line 5142 "Zend/zend_language_scanner.c"
|
||||
yy450:
|
||||
YYDEBUG(450, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5148,7 +5151,7 @@ yy450:
|
||||
{
|
||||
RETURN_TOKEN(T_TRAIT);
|
||||
}
|
||||
#line 5152 "Zend/zend_language_scanner.c"
|
||||
#line 5155 "Zend/zend_language_scanner.c"
|
||||
yy452:
|
||||
YYDEBUG(452, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5161,7 +5164,7 @@ yy452:
|
||||
{
|
||||
RETURN_TOKEN(T_UNSET);
|
||||
}
|
||||
#line 5165 "Zend/zend_language_scanner.c"
|
||||
#line 5168 "Zend/zend_language_scanner.c"
|
||||
yy454:
|
||||
YYDEBUG(454, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5174,7 +5177,7 @@ yy454:
|
||||
{
|
||||
RETURN_TOKEN(T_WHILE);
|
||||
}
|
||||
#line 5178 "Zend/zend_language_scanner.c"
|
||||
#line 5181 "Zend/zend_language_scanner.c"
|
||||
yy456:
|
||||
YYDEBUG(456, *YYCURSOR);
|
||||
yyaccept = 6;
|
||||
@@ -5196,7 +5199,7 @@ yy457:
|
||||
{
|
||||
RETURN_TOKEN(T_YIELD);
|
||||
}
|
||||
#line 5200 "Zend/zend_language_scanner.c"
|
||||
#line 5203 "Zend/zend_language_scanner.c"
|
||||
yy458:
|
||||
YYDEBUG(458, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5292,7 +5295,7 @@ yy471:
|
||||
{
|
||||
RETURN_TOKEN(T_BOOL_CAST);
|
||||
}
|
||||
#line 5296 "Zend/zend_language_scanner.c"
|
||||
#line 5299 "Zend/zend_language_scanner.c"
|
||||
yy474:
|
||||
YYDEBUG(474, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5326,7 +5329,7 @@ yy478:
|
||||
{
|
||||
RETURN_TOKEN(T_DOUBLE_CAST);
|
||||
}
|
||||
#line 5330 "Zend/zend_language_scanner.c"
|
||||
#line 5333 "Zend/zend_language_scanner.c"
|
||||
yy480:
|
||||
YYDEBUG(480, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5395,7 +5398,7 @@ yy489:
|
||||
{
|
||||
RETURN_TOKEN(T_ELSEIF);
|
||||
}
|
||||
#line 5399 "Zend/zend_language_scanner.c"
|
||||
#line 5402 "Zend/zend_language_scanner.c"
|
||||
yy491:
|
||||
YYDEBUG(491, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5429,7 +5432,7 @@ yy493:
|
||||
{
|
||||
RETURN_TOKEN(T_ENDFOR);
|
||||
}
|
||||
#line 5433 "Zend/zend_language_scanner.c"
|
||||
#line 5436 "Zend/zend_language_scanner.c"
|
||||
yy494:
|
||||
YYDEBUG(494, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5478,7 +5481,7 @@ yy500:
|
||||
{
|
||||
RETURN_TOKEN(T_GLOBAL);
|
||||
}
|
||||
#line 5482 "Zend/zend_language_scanner.c"
|
||||
#line 5485 "Zend/zend_language_scanner.c"
|
||||
yy502:
|
||||
YYDEBUG(502, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5539,7 +5542,7 @@ yy510:
|
||||
{
|
||||
RETURN_TOKEN(T_PUBLIC);
|
||||
}
|
||||
#line 5543 "Zend/zend_language_scanner.c"
|
||||
#line 5546 "Zend/zend_language_scanner.c"
|
||||
yy512:
|
||||
YYDEBUG(512, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5558,7 +5561,7 @@ yy513:
|
||||
{
|
||||
RETURN_TOKEN(T_RETURN);
|
||||
}
|
||||
#line 5562 "Zend/zend_language_scanner.c"
|
||||
#line 5565 "Zend/zend_language_scanner.c"
|
||||
yy515:
|
||||
YYDEBUG(515, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5571,7 +5574,7 @@ yy515:
|
||||
{
|
||||
RETURN_TOKEN(T_STATIC);
|
||||
}
|
||||
#line 5575 "Zend/zend_language_scanner.c"
|
||||
#line 5578 "Zend/zend_language_scanner.c"
|
||||
yy517:
|
||||
YYDEBUG(517, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5584,7 +5587,7 @@ yy517:
|
||||
{
|
||||
RETURN_TOKEN(T_SWITCH);
|
||||
}
|
||||
#line 5588 "Zend/zend_language_scanner.c"
|
||||
#line 5591 "Zend/zend_language_scanner.c"
|
||||
yy519:
|
||||
YYDEBUG(519, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -5668,7 +5671,7 @@ yy530:
|
||||
{
|
||||
RETURN_TOKEN(T_ARRAY_CAST);
|
||||
}
|
||||
#line 5672 "Zend/zend_language_scanner.c"
|
||||
#line 5675 "Zend/zend_language_scanner.c"
|
||||
yy532:
|
||||
YYDEBUG(532, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -5718,7 +5721,7 @@ yy538:
|
||||
{
|
||||
RETURN_TOKEN(T_UNSET_CAST);
|
||||
}
|
||||
#line 5722 "Zend/zend_language_scanner.c"
|
||||
#line 5725 "Zend/zend_language_scanner.c"
|
||||
yy540:
|
||||
YYDEBUG(540, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5749,7 +5752,7 @@ yy543:
|
||||
{
|
||||
RETURN_TOKEN(T_DECLARE);
|
||||
}
|
||||
#line 5753 "Zend/zend_language_scanner.c"
|
||||
#line 5756 "Zend/zend_language_scanner.c"
|
||||
yy545:
|
||||
YYDEBUG(545, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5762,7 +5765,7 @@ yy545:
|
||||
{
|
||||
RETURN_TOKEN(T_DEFAULT);
|
||||
}
|
||||
#line 5766 "Zend/zend_language_scanner.c"
|
||||
#line 5769 "Zend/zend_language_scanner.c"
|
||||
yy547:
|
||||
YYDEBUG(547, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5799,7 +5802,7 @@ yy551:
|
||||
{
|
||||
RETURN_TOKEN(T_EXTENDS);
|
||||
}
|
||||
#line 5803 "Zend/zend_language_scanner.c"
|
||||
#line 5806 "Zend/zend_language_scanner.c"
|
||||
yy553:
|
||||
YYDEBUG(553, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5812,7 +5815,7 @@ yy553:
|
||||
{
|
||||
RETURN_TOKEN(T_FINALLY);
|
||||
}
|
||||
#line 5816 "Zend/zend_language_scanner.c"
|
||||
#line 5819 "Zend/zend_language_scanner.c"
|
||||
yy555:
|
||||
YYDEBUG(555, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5825,7 +5828,7 @@ yy555:
|
||||
{
|
||||
RETURN_TOKEN(T_FOREACH);
|
||||
}
|
||||
#line 5829 "Zend/zend_language_scanner.c"
|
||||
#line 5832 "Zend/zend_language_scanner.c"
|
||||
yy557:
|
||||
YYDEBUG(557, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5863,7 +5866,7 @@ yy560:
|
||||
{
|
||||
RETURN_TOKEN(T_INCLUDE);
|
||||
}
|
||||
#line 5867 "Zend/zend_language_scanner.c"
|
||||
#line 5870 "Zend/zend_language_scanner.c"
|
||||
yy561:
|
||||
YYDEBUG(561, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5900,7 +5903,7 @@ yy565:
|
||||
{
|
||||
RETURN_TOKEN(T_PRIVATE);
|
||||
}
|
||||
#line 5904 "Zend/zend_language_scanner.c"
|
||||
#line 5907 "Zend/zend_language_scanner.c"
|
||||
yy567:
|
||||
YYDEBUG(567, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5932,7 +5935,7 @@ yy569:
|
||||
{
|
||||
RETURN_TOKEN(T_REQUIRE);
|
||||
}
|
||||
#line 5936 "Zend/zend_language_scanner.c"
|
||||
#line 5939 "Zend/zend_language_scanner.c"
|
||||
yy570:
|
||||
YYDEBUG(570, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -5956,7 +5959,7 @@ yy572:
|
||||
{
|
||||
RETURN_TOKEN(T_DIR);
|
||||
}
|
||||
#line 5960 "Zend/zend_language_scanner.c"
|
||||
#line 5963 "Zend/zend_language_scanner.c"
|
||||
yy574:
|
||||
YYDEBUG(574, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6005,7 +6008,7 @@ yy581:
|
||||
{
|
||||
RETURN_TOKEN(T_STRING_CAST);
|
||||
}
|
||||
#line 6009 "Zend/zend_language_scanner.c"
|
||||
#line 6012 "Zend/zend_language_scanner.c"
|
||||
yy583:
|
||||
YYDEBUG(583, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -6015,7 +6018,7 @@ yy583:
|
||||
{
|
||||
RETURN_TOKEN(T_OBJECT_CAST);
|
||||
}
|
||||
#line 6019 "Zend/zend_language_scanner.c"
|
||||
#line 6022 "Zend/zend_language_scanner.c"
|
||||
yy585:
|
||||
YYDEBUG(585, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6028,7 +6031,7 @@ yy585:
|
||||
{
|
||||
RETURN_TOKEN(T_ABSTRACT);
|
||||
}
|
||||
#line 6032 "Zend/zend_language_scanner.c"
|
||||
#line 6035 "Zend/zend_language_scanner.c"
|
||||
yy587:
|
||||
YYDEBUG(587, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6041,7 +6044,7 @@ yy587:
|
||||
{
|
||||
RETURN_TOKEN(T_CALLABLE);
|
||||
}
|
||||
#line 6045 "Zend/zend_language_scanner.c"
|
||||
#line 6048 "Zend/zend_language_scanner.c"
|
||||
yy589:
|
||||
YYDEBUG(589, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6054,7 +6057,7 @@ yy589:
|
||||
{
|
||||
RETURN_TOKEN(T_CONTINUE);
|
||||
}
|
||||
#line 6058 "Zend/zend_language_scanner.c"
|
||||
#line 6061 "Zend/zend_language_scanner.c"
|
||||
yy591:
|
||||
YYDEBUG(591, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6085,7 +6088,7 @@ yy594:
|
||||
{
|
||||
RETURN_TOKEN(T_ENDWHILE);
|
||||
}
|
||||
#line 6089 "Zend/zend_language_scanner.c"
|
||||
#line 6092 "Zend/zend_language_scanner.c"
|
||||
yy596:
|
||||
YYDEBUG(596, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6098,7 +6101,7 @@ yy596:
|
||||
{
|
||||
RETURN_TOKEN(T_FUNCTION);
|
||||
}
|
||||
#line 6102 "Zend/zend_language_scanner.c"
|
||||
#line 6105 "Zend/zend_language_scanner.c"
|
||||
yy598:
|
||||
YYDEBUG(598, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6170,7 +6173,7 @@ yy608:
|
||||
{
|
||||
RETURN_TOKEN(T_FILE);
|
||||
}
|
||||
#line 6174 "Zend/zend_language_scanner.c"
|
||||
#line 6177 "Zend/zend_language_scanner.c"
|
||||
yy610:
|
||||
YYDEBUG(610, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6195,7 +6198,7 @@ yy612:
|
||||
{
|
||||
RETURN_TOKEN(T_LINE);
|
||||
}
|
||||
#line 6199 "Zend/zend_language_scanner.c"
|
||||
#line 6202 "Zend/zend_language_scanner.c"
|
||||
yy614:
|
||||
YYDEBUG(614, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6236,7 +6239,7 @@ yy619:
|
||||
{
|
||||
RETURN_TOKEN(T_ENDSWITCH);
|
||||
}
|
||||
#line 6240 "Zend/zend_language_scanner.c"
|
||||
#line 6243 "Zend/zend_language_scanner.c"
|
||||
yy621:
|
||||
YYDEBUG(621, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6267,7 +6270,7 @@ yy624:
|
||||
{
|
||||
RETURN_TOKEN(T_INSTEADOF);
|
||||
}
|
||||
#line 6271 "Zend/zend_language_scanner.c"
|
||||
#line 6274 "Zend/zend_language_scanner.c"
|
||||
yy626:
|
||||
YYDEBUG(626, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6280,7 +6283,7 @@ yy626:
|
||||
{
|
||||
RETURN_TOKEN(T_INTERFACE);
|
||||
}
|
||||
#line 6284 "Zend/zend_language_scanner.c"
|
||||
#line 6287 "Zend/zend_language_scanner.c"
|
||||
yy628:
|
||||
YYDEBUG(628, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6293,7 +6296,7 @@ yy628:
|
||||
{
|
||||
RETURN_TOKEN(T_NAMESPACE);
|
||||
}
|
||||
#line 6297 "Zend/zend_language_scanner.c"
|
||||
#line 6300 "Zend/zend_language_scanner.c"
|
||||
yy630:
|
||||
YYDEBUG(630, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6306,7 +6309,7 @@ yy630:
|
||||
{
|
||||
RETURN_TOKEN(T_PROTECTED);
|
||||
}
|
||||
#line 6310 "Zend/zend_language_scanner.c"
|
||||
#line 6313 "Zend/zend_language_scanner.c"
|
||||
yy632:
|
||||
YYDEBUG(632, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6331,7 +6334,7 @@ yy634:
|
||||
{
|
||||
RETURN_TOKEN(T_CLASS_C);
|
||||
}
|
||||
#line 6335 "Zend/zend_language_scanner.c"
|
||||
#line 6338 "Zend/zend_language_scanner.c"
|
||||
yy636:
|
||||
YYDEBUG(636, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6367,7 +6370,7 @@ yy640:
|
||||
{
|
||||
RETURN_TOKEN(T_TRAIT_C);
|
||||
}
|
||||
#line 6371 "Zend/zend_language_scanner.c"
|
||||
#line 6374 "Zend/zend_language_scanner.c"
|
||||
yy642:
|
||||
YYDEBUG(642, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6380,7 +6383,7 @@ yy642:
|
||||
{
|
||||
RETURN_TOKEN(T_ENDDECLARE);
|
||||
}
|
||||
#line 6384 "Zend/zend_language_scanner.c"
|
||||
#line 6387 "Zend/zend_language_scanner.c"
|
||||
yy644:
|
||||
YYDEBUG(644, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6393,7 +6396,7 @@ yy644:
|
||||
{
|
||||
RETURN_TOKEN(T_ENDFOREACH);
|
||||
}
|
||||
#line 6397 "Zend/zend_language_scanner.c"
|
||||
#line 6400 "Zend/zend_language_scanner.c"
|
||||
yy646:
|
||||
YYDEBUG(646, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6406,7 +6409,7 @@ yy646:
|
||||
{
|
||||
RETURN_TOKEN(T_IMPLEMENTS);
|
||||
}
|
||||
#line 6410 "Zend/zend_language_scanner.c"
|
||||
#line 6413 "Zend/zend_language_scanner.c"
|
||||
yy648:
|
||||
YYDEBUG(648, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6425,7 +6428,7 @@ yy649:
|
||||
{
|
||||
RETURN_TOKEN(T_INSTANCEOF);
|
||||
}
|
||||
#line 6429 "Zend/zend_language_scanner.c"
|
||||
#line 6432 "Zend/zend_language_scanner.c"
|
||||
yy651:
|
||||
YYDEBUG(651, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6477,7 +6480,7 @@ yy655:
|
||||
{
|
||||
RETURN_TOKEN(T_METHOD_C);
|
||||
}
|
||||
#line 6481 "Zend/zend_language_scanner.c"
|
||||
#line 6484 "Zend/zend_language_scanner.c"
|
||||
yy657:
|
||||
YYDEBUG(657, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6507,7 +6510,7 @@ yy660:
|
||||
HANDLE_NEWLINES(yytext, yyleng);
|
||||
RETURN_TOKEN(T_YIELD_FROM);
|
||||
}
|
||||
#line 6511 "Zend/zend_language_scanner.c"
|
||||
#line 6514 "Zend/zend_language_scanner.c"
|
||||
yy662:
|
||||
YYDEBUG(662, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6536,7 +6539,7 @@ yy665:
|
||||
{
|
||||
RETURN_TOKEN(T_INCLUDE_ONCE);
|
||||
}
|
||||
#line 6540 "Zend/zend_language_scanner.c"
|
||||
#line 6543 "Zend/zend_language_scanner.c"
|
||||
yy667:
|
||||
YYDEBUG(667, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6549,7 +6552,7 @@ yy667:
|
||||
{
|
||||
RETURN_TOKEN(T_REQUIRE_ONCE);
|
||||
}
|
||||
#line 6553 "Zend/zend_language_scanner.c"
|
||||
#line 6556 "Zend/zend_language_scanner.c"
|
||||
yy669:
|
||||
YYDEBUG(669, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6562,7 +6565,7 @@ yy669:
|
||||
{
|
||||
RETURN_TOKEN(T_FUNC_C);
|
||||
}
|
||||
#line 6566 "Zend/zend_language_scanner.c"
|
||||
#line 6569 "Zend/zend_language_scanner.c"
|
||||
yy671:
|
||||
YYDEBUG(671, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6592,7 +6595,7 @@ yy674:
|
||||
{
|
||||
RETURN_TOKEN(T_NS_C);
|
||||
}
|
||||
#line 6596 "Zend/zend_language_scanner.c"
|
||||
#line 6599 "Zend/zend_language_scanner.c"
|
||||
yy676:
|
||||
YYDEBUG(676, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6610,7 +6613,7 @@ yy677:
|
||||
{
|
||||
RETURN_TOKEN(T_HALT_COMPILER);
|
||||
}
|
||||
#line 6614 "Zend/zend_language_scanner.c"
|
||||
#line 6617 "Zend/zend_language_scanner.c"
|
||||
}
|
||||
/* *********************************** */
|
||||
yyc_ST_LOOKING_FOR_PROPERTY:
|
||||
@@ -6682,7 +6685,7 @@ yy682:
|
||||
yy_pop_state();
|
||||
goto restart;
|
||||
}
|
||||
#line 6686 "Zend/zend_language_scanner.c"
|
||||
#line 6689 "Zend/zend_language_scanner.c"
|
||||
yy683:
|
||||
YYDEBUG(683, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -6698,7 +6701,7 @@ yy683:
|
||||
{
|
||||
goto return_whitespace;
|
||||
}
|
||||
#line 6702 "Zend/zend_language_scanner.c"
|
||||
#line 6705 "Zend/zend_language_scanner.c"
|
||||
yy686:
|
||||
YYDEBUG(686, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6720,7 +6723,7 @@ yy687:
|
||||
yy_pop_state();
|
||||
RETURN_TOKEN_WITH_STR(T_STRING, 0);
|
||||
}
|
||||
#line 6724 "Zend/zend_language_scanner.c"
|
||||
#line 6727 "Zend/zend_language_scanner.c"
|
||||
yy690:
|
||||
YYDEBUG(690, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -6730,7 +6733,7 @@ yy690:
|
||||
{
|
||||
RETURN_TOKEN(T_OBJECT_OPERATOR);
|
||||
}
|
||||
#line 6734 "Zend/zend_language_scanner.c"
|
||||
#line 6737 "Zend/zend_language_scanner.c"
|
||||
}
|
||||
/* *********************************** */
|
||||
yyc_ST_BACKQUOTE:
|
||||
@@ -6783,7 +6786,7 @@ yyc_ST_BACKQUOTE:
|
||||
yy695:
|
||||
YYDEBUG(695, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 2504 "Zend/zend_language_scanner.l"
|
||||
#line 2507 "Zend/zend_language_scanner.l"
|
||||
{
|
||||
if (YYCURSOR > YYLIMIT) {
|
||||
RETURN_TOKEN(END);
|
||||
@@ -6828,7 +6831,7 @@ yy695:
|
||||
RETURN_TOKEN(T_ERROR);
|
||||
}
|
||||
}
|
||||
#line 6832 "Zend/zend_language_scanner.c"
|
||||
#line 6835 "Zend/zend_language_scanner.c"
|
||||
yy696:
|
||||
YYDEBUG(696, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6852,12 +6855,12 @@ yy697:
|
||||
++YYCURSOR;
|
||||
YYDEBUG(698, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 2444 "Zend/zend_language_scanner.l"
|
||||
#line 2447 "Zend/zend_language_scanner.l"
|
||||
{
|
||||
BEGIN(ST_IN_SCRIPTING);
|
||||
RETURN_TOKEN('`');
|
||||
}
|
||||
#line 6861 "Zend/zend_language_scanner.c"
|
||||
#line 6864 "Zend/zend_language_scanner.c"
|
||||
yy699:
|
||||
YYDEBUG(699, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6882,7 +6885,7 @@ yy702:
|
||||
{
|
||||
RETURN_TOKEN_WITH_STR(T_VARIABLE, 1);
|
||||
}
|
||||
#line 6886 "Zend/zend_language_scanner.c"
|
||||
#line 6889 "Zend/zend_language_scanner.c"
|
||||
yy703:
|
||||
YYDEBUG(703, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -6893,19 +6896,19 @@ yy703:
|
||||
yy_push_state(ST_LOOKING_FOR_VARNAME);
|
||||
RETURN_TOKEN(T_DOLLAR_OPEN_CURLY_BRACES);
|
||||
}
|
||||
#line 6897 "Zend/zend_language_scanner.c"
|
||||
#line 6900 "Zend/zend_language_scanner.c"
|
||||
yy705:
|
||||
YYDEBUG(705, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(706, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 2432 "Zend/zend_language_scanner.l"
|
||||
#line 2435 "Zend/zend_language_scanner.l"
|
||||
{
|
||||
yy_push_state(ST_IN_SCRIPTING);
|
||||
yyless(1);
|
||||
RETURN_TOKEN(T_CURLY_OPEN);
|
||||
}
|
||||
#line 6909 "Zend/zend_language_scanner.c"
|
||||
#line 6912 "Zend/zend_language_scanner.c"
|
||||
yy707:
|
||||
YYDEBUG(707, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6925,7 +6928,7 @@ yy709:
|
||||
yy_push_state(ST_VAR_OFFSET);
|
||||
RETURN_TOKEN_WITH_STR(T_VARIABLE, 1);
|
||||
}
|
||||
#line 6929 "Zend/zend_language_scanner.c"
|
||||
#line 6932 "Zend/zend_language_scanner.c"
|
||||
yy711:
|
||||
YYDEBUG(711, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -6949,7 +6952,7 @@ yy712:
|
||||
yy_push_state(ST_LOOKING_FOR_PROPERTY);
|
||||
RETURN_TOKEN_WITH_STR(T_VARIABLE, 1);
|
||||
}
|
||||
#line 6953 "Zend/zend_language_scanner.c"
|
||||
#line 6956 "Zend/zend_language_scanner.c"
|
||||
}
|
||||
/* *********************************** */
|
||||
yyc_ST_DOUBLE_QUOTES:
|
||||
@@ -7002,7 +7005,7 @@ yyc_ST_DOUBLE_QUOTES:
|
||||
yy717:
|
||||
YYDEBUG(717, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 2450 "Zend/zend_language_scanner.l"
|
||||
#line 2453 "Zend/zend_language_scanner.l"
|
||||
{
|
||||
if (GET_DOUBLE_QUOTES_SCANNED_LENGTH()) {
|
||||
YYCURSOR += GET_DOUBLE_QUOTES_SCANNED_LENGTH() - 1;
|
||||
@@ -7055,18 +7058,18 @@ double_quotes_scan_done:
|
||||
RETURN_TOKEN(T_ERROR);
|
||||
}
|
||||
}
|
||||
#line 7059 "Zend/zend_language_scanner.c"
|
||||
#line 7062 "Zend/zend_language_scanner.c"
|
||||
yy718:
|
||||
YYDEBUG(718, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(719, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 2439 "Zend/zend_language_scanner.l"
|
||||
#line 2442 "Zend/zend_language_scanner.l"
|
||||
{
|
||||
BEGIN(ST_IN_SCRIPTING);
|
||||
RETURN_TOKEN('"');
|
||||
}
|
||||
#line 7070 "Zend/zend_language_scanner.c"
|
||||
#line 7073 "Zend/zend_language_scanner.c"
|
||||
yy720:
|
||||
YYDEBUG(720, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -7109,7 +7112,7 @@ yy724:
|
||||
{
|
||||
RETURN_TOKEN_WITH_STR(T_VARIABLE, 1);
|
||||
}
|
||||
#line 7113 "Zend/zend_language_scanner.c"
|
||||
#line 7116 "Zend/zend_language_scanner.c"
|
||||
yy725:
|
||||
YYDEBUG(725, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -7120,19 +7123,19 @@ yy725:
|
||||
yy_push_state(ST_LOOKING_FOR_VARNAME);
|
||||
RETURN_TOKEN(T_DOLLAR_OPEN_CURLY_BRACES);
|
||||
}
|
||||
#line 7124 "Zend/zend_language_scanner.c"
|
||||
#line 7127 "Zend/zend_language_scanner.c"
|
||||
yy727:
|
||||
YYDEBUG(727, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(728, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 2432 "Zend/zend_language_scanner.l"
|
||||
#line 2435 "Zend/zend_language_scanner.l"
|
||||
{
|
||||
yy_push_state(ST_IN_SCRIPTING);
|
||||
yyless(1);
|
||||
RETURN_TOKEN(T_CURLY_OPEN);
|
||||
}
|
||||
#line 7136 "Zend/zend_language_scanner.c"
|
||||
#line 7139 "Zend/zend_language_scanner.c"
|
||||
yy729:
|
||||
YYDEBUG(729, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -7152,7 +7155,7 @@ yy731:
|
||||
yy_push_state(ST_VAR_OFFSET);
|
||||
RETURN_TOKEN_WITH_STR(T_VARIABLE, 1);
|
||||
}
|
||||
#line 7156 "Zend/zend_language_scanner.c"
|
||||
#line 7159 "Zend/zend_language_scanner.c"
|
||||
yy733:
|
||||
YYDEBUG(733, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -7176,7 +7179,7 @@ yy734:
|
||||
yy_push_state(ST_LOOKING_FOR_PROPERTY);
|
||||
RETURN_TOKEN_WITH_STR(T_VARIABLE, 1);
|
||||
}
|
||||
#line 7180 "Zend/zend_language_scanner.c"
|
||||
#line 7183 "Zend/zend_language_scanner.c"
|
||||
}
|
||||
/* *********************************** */
|
||||
yyc_ST_HEREDOC:
|
||||
@@ -7225,7 +7228,7 @@ yyc_ST_HEREDOC:
|
||||
yy739:
|
||||
YYDEBUG(739, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 2550 "Zend/zend_language_scanner.l"
|
||||
#line 2553 "Zend/zend_language_scanner.l"
|
||||
{
|
||||
zend_heredoc_label *heredoc_label = zend_ptr_stack_top(&SCNG(heredoc_label_stack));
|
||||
int newline = 0, indentation = 0, spacing = 0;
|
||||
@@ -7348,7 +7351,7 @@ heredoc_scan_done:
|
||||
|
||||
RETURN_TOKEN_WITH_VAL(T_ENCAPSED_AND_WHITESPACE);
|
||||
}
|
||||
#line 7352 "Zend/zend_language_scanner.c"
|
||||
#line 7355 "Zend/zend_language_scanner.c"
|
||||
yy740:
|
||||
YYDEBUG(740, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -7391,7 +7394,7 @@ yy744:
|
||||
{
|
||||
RETURN_TOKEN_WITH_STR(T_VARIABLE, 1);
|
||||
}
|
||||
#line 7395 "Zend/zend_language_scanner.c"
|
||||
#line 7398 "Zend/zend_language_scanner.c"
|
||||
yy745:
|
||||
YYDEBUG(745, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -7402,19 +7405,19 @@ yy745:
|
||||
yy_push_state(ST_LOOKING_FOR_VARNAME);
|
||||
RETURN_TOKEN(T_DOLLAR_OPEN_CURLY_BRACES);
|
||||
}
|
||||
#line 7406 "Zend/zend_language_scanner.c"
|
||||
#line 7409 "Zend/zend_language_scanner.c"
|
||||
yy747:
|
||||
YYDEBUG(747, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
YYDEBUG(748, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 2432 "Zend/zend_language_scanner.l"
|
||||
#line 2435 "Zend/zend_language_scanner.l"
|
||||
{
|
||||
yy_push_state(ST_IN_SCRIPTING);
|
||||
yyless(1);
|
||||
RETURN_TOKEN(T_CURLY_OPEN);
|
||||
}
|
||||
#line 7418 "Zend/zend_language_scanner.c"
|
||||
#line 7421 "Zend/zend_language_scanner.c"
|
||||
yy749:
|
||||
YYDEBUG(749, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -7434,7 +7437,7 @@ yy751:
|
||||
yy_push_state(ST_VAR_OFFSET);
|
||||
RETURN_TOKEN_WITH_STR(T_VARIABLE, 1);
|
||||
}
|
||||
#line 7438 "Zend/zend_language_scanner.c"
|
||||
#line 7441 "Zend/zend_language_scanner.c"
|
||||
yy753:
|
||||
YYDEBUG(753, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -7458,7 +7461,7 @@ yy754:
|
||||
yy_push_state(ST_LOOKING_FOR_PROPERTY);
|
||||
RETURN_TOKEN_WITH_STR(T_VARIABLE, 1);
|
||||
}
|
||||
#line 7462 "Zend/zend_language_scanner.c"
|
||||
#line 7465 "Zend/zend_language_scanner.c"
|
||||
}
|
||||
/* *********************************** */
|
||||
yyc_ST_LOOKING_FOR_VARNAME:
|
||||
@@ -7522,7 +7525,7 @@ yy759:
|
||||
yy_push_state(ST_IN_SCRIPTING);
|
||||
goto restart;
|
||||
}
|
||||
#line 7526 "Zend/zend_language_scanner.c"
|
||||
#line 7529 "Zend/zend_language_scanner.c"
|
||||
yy760:
|
||||
YYDEBUG(760, *YYCURSOR);
|
||||
yych = *(YYMARKER = ++YYCURSOR);
|
||||
@@ -7576,7 +7579,7 @@ yy764:
|
||||
yy_push_state(ST_IN_SCRIPTING);
|
||||
RETURN_TOKEN_WITH_STR(T_STRING_VARNAME, 0);
|
||||
}
|
||||
#line 7580 "Zend/zend_language_scanner.c"
|
||||
#line 7583 "Zend/zend_language_scanner.c"
|
||||
}
|
||||
/* *********************************** */
|
||||
yyc_ST_VAR_OFFSET:
|
||||
@@ -7665,7 +7668,7 @@ yy768:
|
||||
++YYCURSOR;
|
||||
YYDEBUG(769, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 2765 "Zend/zend_language_scanner.l"
|
||||
#line 2768 "Zend/zend_language_scanner.l"
|
||||
{
|
||||
if (YYCURSOR > YYLIMIT) {
|
||||
RETURN_TOKEN(END);
|
||||
@@ -7676,7 +7679,7 @@ yy768:
|
||||
}
|
||||
goto restart;
|
||||
}
|
||||
#line 7680 "Zend/zend_language_scanner.c"
|
||||
#line 7683 "Zend/zend_language_scanner.c"
|
||||
yy770:
|
||||
YYDEBUG(770, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -7690,7 +7693,7 @@ yy770:
|
||||
ZVAL_NULL(zendlval);
|
||||
RETURN_TOKEN_WITH_VAL(T_ENCAPSED_AND_WHITESPACE);
|
||||
}
|
||||
#line 7694 "Zend/zend_language_scanner.c"
|
||||
#line 7697 "Zend/zend_language_scanner.c"
|
||||
yy772:
|
||||
YYDEBUG(772, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -7702,7 +7705,7 @@ yy773:
|
||||
/* Only '[' or '-' can be valid, but returning other tokens will allow a more explicit parse error */
|
||||
RETURN_TOKEN(yytext[0]);
|
||||
}
|
||||
#line 7706 "Zend/zend_language_scanner.c"
|
||||
#line 7709 "Zend/zend_language_scanner.c"
|
||||
yy774:
|
||||
YYDEBUG(774, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -7753,7 +7756,7 @@ string:
|
||||
}
|
||||
RETURN_TOKEN_WITH_VAL(T_NUM_STRING);
|
||||
}
|
||||
#line 7757 "Zend/zend_language_scanner.c"
|
||||
#line 7760 "Zend/zend_language_scanner.c"
|
||||
yy777:
|
||||
YYDEBUG(777, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -7779,7 +7782,7 @@ yy779:
|
||||
{
|
||||
RETURN_TOKEN_WITH_STR(T_STRING, 0);
|
||||
}
|
||||
#line 7783 "Zend/zend_language_scanner.c"
|
||||
#line 7786 "Zend/zend_language_scanner.c"
|
||||
yy782:
|
||||
YYDEBUG(782, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -7790,7 +7793,7 @@ yy782:
|
||||
yy_pop_state();
|
||||
RETURN_TOKEN(']');
|
||||
}
|
||||
#line 7794 "Zend/zend_language_scanner.c"
|
||||
#line 7797 "Zend/zend_language_scanner.c"
|
||||
yy784:
|
||||
YYDEBUG(784, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -7819,7 +7822,7 @@ yy786:
|
||||
{
|
||||
RETURN_TOKEN_WITH_STR(T_VARIABLE, 1);
|
||||
}
|
||||
#line 7823 "Zend/zend_language_scanner.c"
|
||||
#line 7826 "Zend/zend_language_scanner.c"
|
||||
yy787:
|
||||
YYDEBUG(787, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -7840,7 +7843,7 @@ yy789:
|
||||
}
|
||||
RETURN_TOKEN_WITH_VAL(T_NUM_STRING);
|
||||
}
|
||||
#line 7844 "Zend/zend_language_scanner.c"
|
||||
#line 7847 "Zend/zend_language_scanner.c"
|
||||
yy790:
|
||||
YYDEBUG(790, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -7937,7 +7940,7 @@ inline_char_handler:
|
||||
HANDLE_NEWLINES(yytext, yyleng);
|
||||
RETURN_TOKEN_WITH_VAL(T_INLINE_HTML);
|
||||
}
|
||||
#line 7941 "Zend/zend_language_scanner.c"
|
||||
#line 7944 "Zend/zend_language_scanner.c"
|
||||
yy801:
|
||||
YYDEBUG(801, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -7965,7 +7968,7 @@ yy803:
|
||||
goto inline_char_handler;
|
||||
}
|
||||
}
|
||||
#line 7969 "Zend/zend_language_scanner.c"
|
||||
#line 7972 "Zend/zend_language_scanner.c"
|
||||
yy804:
|
||||
YYDEBUG(804, *YYCURSOR);
|
||||
++YYCURSOR;
|
||||
@@ -7979,7 +7982,7 @@ yy804:
|
||||
}
|
||||
RETURN_TOKEN(T_OPEN_TAG_WITH_ECHO);
|
||||
}
|
||||
#line 7983 "Zend/zend_language_scanner.c"
|
||||
#line 7986 "Zend/zend_language_scanner.c"
|
||||
yy806:
|
||||
YYDEBUG(806, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -8019,7 +8022,7 @@ yy811:
|
||||
}
|
||||
RETURN_TOKEN(T_OPEN_TAG);
|
||||
}
|
||||
#line 8023 "Zend/zend_language_scanner.c"
|
||||
#line 8026 "Zend/zend_language_scanner.c"
|
||||
yy812:
|
||||
YYDEBUG(812, *YYCURSOR);
|
||||
yych = *++YYCURSOR;
|
||||
@@ -8034,7 +8037,7 @@ yyc_ST_END_HEREDOC:
|
||||
++YYCURSOR;
|
||||
YYDEBUG(816, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 2418 "Zend/zend_language_scanner.l"
|
||||
#line 2421 "Zend/zend_language_scanner.l"
|
||||
{
|
||||
zend_heredoc_label *heredoc_label = zend_ptr_stack_pop(&SCNG(heredoc_label_stack));
|
||||
|
||||
@@ -8047,7 +8050,7 @@ yyc_ST_END_HEREDOC:
|
||||
BEGIN(ST_IN_SCRIPTING);
|
||||
RETURN_TOKEN(T_END_HEREDOC);
|
||||
}
|
||||
#line 8051 "Zend/zend_language_scanner.c"
|
||||
#line 8054 "Zend/zend_language_scanner.c"
|
||||
/* *********************************** */
|
||||
yyc_ST_NOWDOC:
|
||||
YYDEBUG(817, *YYCURSOR);
|
||||
@@ -8057,7 +8060,7 @@ yyc_ST_NOWDOC:
|
||||
++YYCURSOR;
|
||||
YYDEBUG(820, *YYCURSOR);
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
#line 2674 "Zend/zend_language_scanner.l"
|
||||
#line 2677 "Zend/zend_language_scanner.l"
|
||||
{
|
||||
zend_heredoc_label *heredoc_label = zend_ptr_stack_top(&SCNG(heredoc_label_stack));
|
||||
int newline = 0, indentation = 0, spacing = -1;
|
||||
@@ -8147,9 +8150,9 @@ nowdoc_scan_done:
|
||||
HANDLE_NEWLINES(yytext, yyleng - newline);
|
||||
RETURN_TOKEN_WITH_VAL(T_ENCAPSED_AND_WHITESPACE);
|
||||
}
|
||||
#line 8151 "Zend/zend_language_scanner.c"
|
||||
#line 8154 "Zend/zend_language_scanner.c"
|
||||
}
|
||||
#line 2776 "Zend/zend_language_scanner.l"
|
||||
#line 2779 "Zend/zend_language_scanner.l"
|
||||
|
||||
|
||||
emit_token_with_str:
|
||||
|
||||
@@ -2340,6 +2340,7 @@ skip_escape_conversion:
|
||||
|
||||
if (is_heredoc && !SCNG(heredoc_scan_ahead)) {
|
||||
zend_lex_state current_state;
|
||||
zend_string *saved_doc_comment = CG(doc_comment);
|
||||
int heredoc_nesting_level = 1;
|
||||
int first_token = 0;
|
||||
int error = 0;
|
||||
@@ -2350,6 +2351,7 @@ skip_escape_conversion:
|
||||
SCNG(heredoc_indentation) = 0;
|
||||
SCNG(heredoc_indentation_uses_spaces) = 0;
|
||||
LANG_SCNG(on_event) = NULL;
|
||||
CG(doc_comment) = NULL;
|
||||
|
||||
zend_ptr_stack_reverse_apply(¤t_state.heredoc_label_stack, copy_heredoc_label_stack);
|
||||
|
||||
@@ -2399,6 +2401,7 @@ skip_escape_conversion:
|
||||
zend_restore_lexical_state(¤t_state);
|
||||
SCNG(heredoc_scan_ahead) = 0;
|
||||
CG(increment_lineno) = 0;
|
||||
CG(doc_comment) = saved_doc_comment;
|
||||
|
||||
if (PARSER_MODE() && error) {
|
||||
RETURN_TOKEN(T_ERROR);
|
||||
|
||||
+14
-8
@@ -741,8 +741,10 @@ ZEND_VM_COLD_CONST_HANDLER(13, ZEND_BOOL_NOT, CONST|TMPVAR|CV, ANY)
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
if (OP1_TYPE == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
@@ -2396,9 +2398,9 @@ ZEND_VM_HOT_HELPER(zend_leave_helper, ANY, ANY)
|
||||
uint32_t call_info = EX_CALL_INFO();
|
||||
|
||||
if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP|ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS|ZEND_CALL_ALLOCATED)) == 0)) {
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
i_free_compiled_variables(execute_data);
|
||||
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
if (UNEXPECTED(call_info & ZEND_CALL_RELEASE_THIS)) {
|
||||
zend_object *object = Z_OBJ(execute_data->This);
|
||||
#if 0
|
||||
@@ -2424,12 +2426,12 @@ ZEND_VM_HOT_HELPER(zend_leave_helper, ANY, ANY)
|
||||
LOAD_NEXT_OPLINE();
|
||||
ZEND_VM_LEAVE();
|
||||
} else if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP)) == 0)) {
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
i_free_compiled_variables(execute_data);
|
||||
|
||||
if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) {
|
||||
zend_clean_and_cache_symbol_table(EX(symbol_table));
|
||||
}
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
|
||||
/* Free extra args before releasing the closure,
|
||||
* as that may free the op_array. */
|
||||
@@ -2479,6 +2481,7 @@ ZEND_VM_HOT_HELPER(zend_leave_helper, ANY, ANY)
|
||||
ZEND_VM_LEAVE();
|
||||
} else {
|
||||
if (EXPECTED((call_info & ZEND_CALL_CODE) == 0)) {
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
i_free_compiled_variables(execute_data);
|
||||
if (UNEXPECTED(call_info & (ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS))) {
|
||||
if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) {
|
||||
@@ -2486,7 +2489,6 @@ ZEND_VM_HOT_HELPER(zend_leave_helper, ANY, ANY)
|
||||
}
|
||||
zend_vm_stack_free_extra_args_ex(call_info, execute_data);
|
||||
}
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) {
|
||||
OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(func)));
|
||||
}
|
||||
@@ -3342,11 +3344,11 @@ ZEND_VM_C_LABEL(try_function_name):
|
||||
call = NULL;
|
||||
}
|
||||
|
||||
FREE_OP2();
|
||||
if (UNEXPECTED(!call)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
FREE_OP2();
|
||||
if (OP2_TYPE & (IS_VAR|IS_TMP_VAR)) {
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
if (call) {
|
||||
@@ -3358,8 +3360,6 @@ ZEND_VM_C_LABEL(try_function_name):
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
} else if (UNEXPECTED(!call)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
call->prev_execute_data = EX(call);
|
||||
@@ -3860,6 +3860,10 @@ ZEND_VM_HOT_HANDLER(62, ZEND_RETURN, CONST|TMP|VAR|CV, ANY)
|
||||
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
|
||||
ZVAL_COPY_VALUE(return_value, retval_ptr);
|
||||
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
|
||||
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
|
||||
if (GC_MAY_LEAK(ref)) {
|
||||
gc_possible_root(ref);
|
||||
}
|
||||
ZVAL_NULL(retval_ptr);
|
||||
} else {
|
||||
Z_ADDREF_P(return_value);
|
||||
@@ -4846,8 +4850,10 @@ ZEND_VM_COLD_CONST_HANDLER(52, ZEND_BOOL, CONST|TMPVAR|CV, ANY)
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
if (OP1_TYPE == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
|
||||
+57
-19
@@ -507,9 +507,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_
|
||||
uint32_t call_info = EX_CALL_INFO();
|
||||
|
||||
if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP|ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS|ZEND_CALL_ALLOCATED)) == 0)) {
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
i_free_compiled_variables(execute_data);
|
||||
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
if (UNEXPECTED(call_info & ZEND_CALL_RELEASE_THIS)) {
|
||||
zend_object *object = Z_OBJ(execute_data->This);
|
||||
#if 0
|
||||
@@ -535,12 +535,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_
|
||||
LOAD_NEXT_OPLINE();
|
||||
ZEND_VM_LEAVE();
|
||||
} else if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP)) == 0)) {
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
i_free_compiled_variables(execute_data);
|
||||
|
||||
if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) {
|
||||
zend_clean_and_cache_symbol_table(EX(symbol_table));
|
||||
}
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
|
||||
/* Free extra args before releasing the closure,
|
||||
* as that may free the op_array. */
|
||||
@@ -590,6 +590,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_
|
||||
ZEND_VM_LEAVE();
|
||||
} else {
|
||||
if (EXPECTED((call_info & ZEND_CALL_CODE) == 0)) {
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
i_free_compiled_variables(execute_data);
|
||||
if (UNEXPECTED(call_info & (ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS))) {
|
||||
if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) {
|
||||
@@ -597,7 +598,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_
|
||||
}
|
||||
zend_vm_stack_free_extra_args_ex(call_info, execute_data);
|
||||
}
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) {
|
||||
OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(func)));
|
||||
}
|
||||
@@ -2137,8 +2137,6 @@ try_function_name:
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
} else if (UNEXPECTED(!call)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
call->prev_execute_data = EX(call);
|
||||
@@ -2313,11 +2311,11 @@ try_function_name:
|
||||
call = NULL;
|
||||
}
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
if (UNEXPECTED(!call)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
if ((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
if (call) {
|
||||
@@ -2329,8 +2327,6 @@ try_function_name:
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
} else if (UNEXPECTED(!call)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
call->prev_execute_data = EX(call);
|
||||
@@ -2446,8 +2442,6 @@ try_function_name:
|
||||
}
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
} else if (UNEXPECTED(!call)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
call->prev_execute_data = EX(call);
|
||||
@@ -2485,8 +2479,10 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_CON
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
if (IS_CONST == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
@@ -2731,6 +2727,10 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_CONST_
|
||||
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
|
||||
ZVAL_COPY_VALUE(return_value, retval_ptr);
|
||||
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
|
||||
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
|
||||
if (GC_MAY_LEAK(ref)) {
|
||||
gc_possible_root(ref);
|
||||
}
|
||||
ZVAL_NULL(retval_ptr);
|
||||
} else {
|
||||
Z_ADDREF_P(return_value);
|
||||
@@ -3056,8 +3056,10 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_SPEC_CONST_H
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
if (IS_CONST == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
@@ -12101,8 +12103,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_TMPVAR_HANDLER(Z
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
@@ -12363,8 +12367,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_SPEC_TMPVAR_HANDLER(ZEND_
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
@@ -17663,6 +17669,10 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_TMP_HA
|
||||
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
|
||||
ZVAL_COPY_VALUE(return_value, retval_ptr);
|
||||
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
|
||||
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
|
||||
if (GC_MAY_LEAK(ref)) {
|
||||
gc_possible_root(ref);
|
||||
}
|
||||
ZVAL_NULL(retval_ptr);
|
||||
} else {
|
||||
Z_ADDREF_P(return_value);
|
||||
@@ -20431,6 +20441,10 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_VAR_HA
|
||||
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
|
||||
ZVAL_COPY_VALUE(return_value, retval_ptr);
|
||||
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
|
||||
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
|
||||
if (GC_MAY_LEAK(ref)) {
|
||||
gc_possible_root(ref);
|
||||
}
|
||||
ZVAL_NULL(retval_ptr);
|
||||
} else {
|
||||
Z_ADDREF_P(return_value);
|
||||
@@ -36411,8 +36425,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_CV_HANDLER(ZEND_
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
if (IS_CV == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
@@ -36871,6 +36887,10 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_CV_HAN
|
||||
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
|
||||
ZVAL_COPY_VALUE(return_value, retval_ptr);
|
||||
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
|
||||
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
|
||||
if (GC_MAY_LEAK(ref)) {
|
||||
gc_possible_root(ref);
|
||||
}
|
||||
ZVAL_NULL(retval_ptr);
|
||||
} else {
|
||||
Z_ADDREF_P(return_value);
|
||||
@@ -37234,8 +37254,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_SPEC_CV_HANDLER(ZEND_OPCO
|
||||
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
|
||||
ZVAL_TRUE(EX_VAR(opline->result.var));
|
||||
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
|
||||
/* The result and op1 can be the same cv zval */
|
||||
const uint32_t orig_val_type = Z_TYPE_INFO_P(val);
|
||||
ZVAL_FALSE(EX_VAR(opline->result.var));
|
||||
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
|
||||
if (IS_CV == IS_CV && UNEXPECTED(orig_val_type == IS_UNDEF)) {
|
||||
SAVE_OPLINE();
|
||||
GET_OP1_UNDEF_CV(val, BP_VAR_R);
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
@@ -55357,9 +55379,9 @@ zend_leave_helper_SPEC_LABEL:
|
||||
uint32_t call_info = EX_CALL_INFO();
|
||||
|
||||
if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP|ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS|ZEND_CALL_ALLOCATED)) == 0)) {
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
i_free_compiled_variables(execute_data);
|
||||
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
if (UNEXPECTED(call_info & ZEND_CALL_RELEASE_THIS)) {
|
||||
zend_object *object = Z_OBJ(execute_data->This);
|
||||
#if 0
|
||||
@@ -55385,12 +55407,12 @@ zend_leave_helper_SPEC_LABEL:
|
||||
LOAD_NEXT_OPLINE();
|
||||
ZEND_VM_LEAVE();
|
||||
} else if (EXPECTED((call_info & (ZEND_CALL_CODE|ZEND_CALL_TOP)) == 0)) {
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
i_free_compiled_variables(execute_data);
|
||||
|
||||
if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) {
|
||||
zend_clean_and_cache_symbol_table(EX(symbol_table));
|
||||
}
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
|
||||
/* Free extra args before releasing the closure,
|
||||
* as that may free the op_array. */
|
||||
@@ -55440,6 +55462,7 @@ zend_leave_helper_SPEC_LABEL:
|
||||
ZEND_VM_LEAVE();
|
||||
} else {
|
||||
if (EXPECTED((call_info & ZEND_CALL_CODE) == 0)) {
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
i_free_compiled_variables(execute_data);
|
||||
if (UNEXPECTED(call_info & (ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS))) {
|
||||
if (UNEXPECTED(call_info & ZEND_CALL_HAS_SYMBOL_TABLE)) {
|
||||
@@ -55447,7 +55470,6 @@ zend_leave_helper_SPEC_LABEL:
|
||||
}
|
||||
zend_vm_stack_free_extra_args_ex(call_info, execute_data);
|
||||
}
|
||||
EG(current_execute_data) = EX(prev_execute_data);
|
||||
if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) {
|
||||
OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(func)));
|
||||
}
|
||||
@@ -55708,6 +55730,10 @@ zend_leave_helper_SPEC_LABEL:
|
||||
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
|
||||
ZVAL_COPY_VALUE(return_value, retval_ptr);
|
||||
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
|
||||
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
|
||||
if (GC_MAY_LEAK(ref)) {
|
||||
gc_possible_root(ref);
|
||||
}
|
||||
ZVAL_NULL(retval_ptr);
|
||||
} else {
|
||||
Z_ADDREF_P(return_value);
|
||||
@@ -57322,6 +57348,10 @@ zend_leave_helper_SPEC_LABEL:
|
||||
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
|
||||
ZVAL_COPY_VALUE(return_value, retval_ptr);
|
||||
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
|
||||
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
|
||||
if (GC_MAY_LEAK(ref)) {
|
||||
gc_possible_root(ref);
|
||||
}
|
||||
ZVAL_NULL(retval_ptr);
|
||||
} else {
|
||||
Z_ADDREF_P(return_value);
|
||||
@@ -57608,6 +57638,10 @@ zend_leave_helper_SPEC_LABEL:
|
||||
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
|
||||
ZVAL_COPY_VALUE(return_value, retval_ptr);
|
||||
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
|
||||
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
|
||||
if (GC_MAY_LEAK(ref)) {
|
||||
gc_possible_root(ref);
|
||||
}
|
||||
ZVAL_NULL(retval_ptr);
|
||||
} else {
|
||||
Z_ADDREF_P(return_value);
|
||||
@@ -59250,6 +59284,10 @@ zend_leave_helper_SPEC_LABEL:
|
||||
if (EXPECTED(!Z_OPT_ISREF_P(retval_ptr))) {
|
||||
ZVAL_COPY_VALUE(return_value, retval_ptr);
|
||||
if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) {
|
||||
zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
|
||||
if (GC_MAY_LEAK(ref)) {
|
||||
gc_possible_root(ref);
|
||||
}
|
||||
ZVAL_NULL(retval_ptr);
|
||||
} else {
|
||||
Z_ADDREF_P(return_value);
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
cscript /nologo win32\build\buildconf.js %*
|
||||
cscript /nologo /e:jscript win32\build\buildconf.js %*
|
||||
SET PHP_BUILDCONF_PATH=%~dp0
|
||||
copy %PHP_BUILDCONF_PATH%\win32\build\configure.bat %PHP_BUILDCONF_PATH% > nul
|
||||
SET PHP_SDK_SCRIPT_PATH=
|
||||
|
||||
+1
-1
@@ -107,7 +107,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=7
|
||||
PHP_MINOR_VERSION=3
|
||||
PHP_RELEASE_VERSION=12
|
||||
PHP_RELEASE_VERSION=16
|
||||
PHP_EXTRA_VERSION=""
|
||||
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
|
||||
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
|
||||
|
||||
@@ -57,9 +57,9 @@ bc_str2num (bc_num *num, char *str, int scale)
|
||||
zero_int = FALSE;
|
||||
if ( (*ptr == '+') || (*ptr == '-')) ptr++; /* Sign */
|
||||
while (*ptr == '0') ptr++; /* Skip leading zeros. */
|
||||
while (isdigit((int)*ptr)) ptr++, digits++; /* digits */
|
||||
while (*ptr >= '0' && *ptr <= '9') ptr++, digits++; /* digits */
|
||||
if (*ptr == '.') ptr++; /* decimal point */
|
||||
while (isdigit((int)*ptr)) ptr++, strscale++; /* digits */
|
||||
while (*ptr >= '0' && *ptr <= '9') ptr++, strscale++; /* digits */
|
||||
if ((*ptr != '\0') || (digits+strscale == 0))
|
||||
{
|
||||
*num = bc_copy_num (BCG(_zero_));
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Bug #78878 (Buffer underflow in bc_shift_addsub)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('bcmath')) die('skip bcmath extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
print @bcmul("\xB26483605105519922841849335928742092", bcpowmod(2, 65535, -4e-4));
|
||||
?>
|
||||
--EXPECT--
|
||||
0
|
||||
@@ -2,6 +2,8 @@
|
||||
easter_date()
|
||||
--INI--
|
||||
date.timezone=UTC
|
||||
--ENV--
|
||||
TZ=UTC
|
||||
--SKIPIF--
|
||||
<?php include 'skipif.inc'; ?>
|
||||
--FILE--
|
||||
|
||||
@@ -336,11 +336,15 @@ PHP_MINIT_FUNCTION(com_dotnet)
|
||||
|
||||
#define COM_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_CS|CONST_PERSISTENT)
|
||||
|
||||
#define COM_ERR_CONST(x) { \
|
||||
#if SIZEOF_ZEND_LONG == 8
|
||||
# define COM_ERR_CONST(x) { \
|
||||
zend_long __tmp; \
|
||||
ULongToIntPtr(x, &__tmp); \
|
||||
REGISTER_LONG_CONSTANT(#x, __tmp, CONST_CS|CONST_PERSISTENT); \
|
||||
}
|
||||
#else
|
||||
# define COM_ERR_CONST COM_CONST
|
||||
#endif
|
||||
|
||||
COM_CONST(CLSCTX_INPROC_SERVER);
|
||||
COM_CONST(CLSCTX_INPROC_HANDLER);
|
||||
|
||||
@@ -187,7 +187,7 @@ zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int b
|
||||
SafeArrayGetUBound(V_ARRAY(&I->safe_array), 1, &I->sa_max);
|
||||
|
||||
/* pre-fetch the element */
|
||||
if (php_com_safearray_get_elem(&I->safe_array, &I->v, bound)) {
|
||||
if (I->sa_max >= bound && php_com_safearray_get_elem(&I->safe_array, &I->v, bound)) {
|
||||
I->key = bound;
|
||||
ZVAL_NULL(&ptr);
|
||||
php_com_zval_from_variant(&ptr, &I->v, I->code_page);
|
||||
|
||||
@@ -248,13 +248,6 @@ static struct IStreamVtbl php_istream_vtbl = {
|
||||
|
||||
static void istream_destructor(php_istream *stm)
|
||||
{
|
||||
if (stm->res) {
|
||||
zend_resource *res = stm->res;
|
||||
stm->res = NULL;
|
||||
zend_list_delete(res);
|
||||
return;
|
||||
}
|
||||
|
||||
if (stm->refcount > 0) {
|
||||
CoDisconnectObject((IUnknown*)stm, 0);
|
||||
}
|
||||
@@ -268,7 +261,6 @@ static void istream_destructor(php_istream *stm)
|
||||
PHP_COM_DOTNET_API IStream *php_com_wrapper_export_stream(php_stream *stream)
|
||||
{
|
||||
php_istream *stm = (php_istream*)CoTaskMemAlloc(sizeof(*stm));
|
||||
zval *tmp;
|
||||
|
||||
if (stm == NULL)
|
||||
return NULL;
|
||||
@@ -280,8 +272,7 @@ PHP_COM_DOTNET_API IStream *php_com_wrapper_export_stream(php_stream *stream)
|
||||
stm->stream = stream;
|
||||
|
||||
GC_ADDREF(stream->res);
|
||||
tmp = zend_list_insert(stm, le_istream);
|
||||
stm->res = Z_RES_P(tmp);
|
||||
stm->res = zend_register_resource(stm, le_istream);
|
||||
|
||||
return (IStream*)stm;
|
||||
}
|
||||
@@ -398,7 +389,7 @@ CPH_METHOD(SaveToFile)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
olefilename = php_com_string_to_olestring(filename, strlen(fullpath), helper->codepage);
|
||||
olefilename = php_com_string_to_olestring(fullpath, strlen(fullpath), helper->codepage);
|
||||
efree(fullpath);
|
||||
}
|
||||
res = IPersistFile_Save(helper->ipf, olefilename, remember);
|
||||
|
||||
@@ -436,6 +436,7 @@ int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int pri
|
||||
char *ansiname = NULL;
|
||||
size_t ansinamelen;
|
||||
int ret = 0;
|
||||
DISPID lastid = 0; /* for props */
|
||||
|
||||
if (FAILED(ITypeInfo_GetTypeAttr(typeinfo, &attr))) {
|
||||
return 0;
|
||||
@@ -469,7 +470,6 @@ int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int pri
|
||||
/* So we've got the dispatch interface; lets list the event methods */
|
||||
for (i = 0; i < attr->cFuncs; i++) {
|
||||
zval tmp;
|
||||
DISPID lastid = 0; /* for props */
|
||||
int isprop;
|
||||
|
||||
if (FAILED(ITypeInfo_GetFuncDesc(typeinfo, i, &func)))
|
||||
@@ -582,8 +582,8 @@ int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int pri
|
||||
ZVAL_STRINGL(&tmp, ansiname, ansinamelen);
|
||||
zend_hash_index_update(id_to_name, func->memid, &tmp);
|
||||
// TODO: avoid reallocation???
|
||||
efree(ansiname);
|
||||
}
|
||||
efree(ansiname);
|
||||
}
|
||||
ITypeInfo_ReleaseFuncDesc(typeinfo, func);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #66322 (COMPersistHelper::SaveToFile can save to wrong location)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available');
|
||||
try {
|
||||
new COM('Word.Application');
|
||||
} catch (com_exception $ex) {
|
||||
die('skip MS Word not available');
|
||||
}
|
||||
if (getenv("SKIP_SLOW_TESTS")) die('skip slow test');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$w = new COM('Word.Application');
|
||||
$doc = $w->Documents->Add();
|
||||
$ph = new COMPersistHelper($doc);
|
||||
$filename = __DIR__ . '\\..\\' . basename(__DIR__) . '\\66322.docx';
|
||||
$ph->SaveToFile($filename);
|
||||
var_dump(file_exists($filename));
|
||||
$w->Quit();
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
@@ -2,7 +2,9 @@
|
||||
Bug #73679 DOTNET read access violation using invalid codepage
|
||||
--SKIPIF--
|
||||
<?php # vim:ft=php
|
||||
if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; ?>
|
||||
if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present";
|
||||
if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platforms only");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #79242 (COM error constants don't match com_exception codes)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available');
|
||||
if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platforms only");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(
|
||||
DISP_E_DIVBYZERO,
|
||||
DISP_E_OVERFLOW,
|
||||
DISP_E_BADINDEX,
|
||||
MK_E_UNAVAILABLE
|
||||
);
|
||||
?>
|
||||
--EXPECT--
|
||||
int(-2147352558)
|
||||
int(-2147352566)
|
||||
int(-2147352565)
|
||||
int(-2147221021)
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #79248 (Traversing empty VT_ARRAY throws com_exception)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$v = new variant([], VT_ARRAY);
|
||||
foreach ($v as $el) {
|
||||
var_dump($el);
|
||||
}
|
||||
echo "done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
done
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #79299 (com_print_typeinfo prints duplicate variables)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$dict = new COM("Scripting.Dictionary");
|
||||
ob_start();
|
||||
com_print_typeinfo($dict);
|
||||
$typeinfo = ob_get_clean();
|
||||
preg_match_all('/\/\* DISPID=9 \*\//', $typeinfo, $matches);
|
||||
var_dump($matches[0]);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(14) "/* DISPID=9 */"
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #79332 (php_istreams are never freed)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('com_dotnet')) die('com_dotnet extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$ph = new COMPersistHelper(null);
|
||||
try {
|
||||
$ph->LoadFromStream(fopen(__FILE__, 'r'));
|
||||
} catch (com_exception $ex) {
|
||||
// use hard-coded message to avoid localization issues
|
||||
echo "A com_exception has been thrown\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
A com_exception has been thrown
|
||||
+59
-1
@@ -1452,6 +1452,10 @@ PHP_MINIT_FUNCTION(curl)
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_TLS13_CIPHERS);
|
||||
#endif
|
||||
|
||||
#if LIBCURL_VERSION_NUM >= 0x074000 /* Available since 7.64.0 */
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_HTTP09_ALLOWED);
|
||||
#endif
|
||||
|
||||
#if LIBCURL_VERSION_NUM >= 0x074001 /* Available since 7.64.1 */
|
||||
REGISTER_CURL_CONSTANT(CURL_VERSION_ALTSVC);
|
||||
#endif
|
||||
@@ -1844,7 +1848,11 @@ static void curl_free_string(void **string)
|
||||
*/
|
||||
static void curl_free_post(void **post)
|
||||
{
|
||||
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
|
||||
curl_mime_free((curl_mime *)*post);
|
||||
#else
|
||||
curl_formfree((struct HttpPost *)*post);
|
||||
#endif
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -2361,6 +2369,9 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
|
||||
#endif
|
||||
#if LIBCURL_VERSION_NUM >= 0x073d00 /* Available since 7.61.0 */
|
||||
case CURLOPT_DISALLOW_USERNAME_IN_URL:
|
||||
#endif
|
||||
#if LIBCURL_VERSION_NUM >= 0x074000 /* Available since 7.64.0 */
|
||||
case CURLOPT_HTTP09_ALLOWED:
|
||||
#endif
|
||||
lval = zval_get_long(zvalue);
|
||||
#if LIBCURL_VERSION_NUM >= 0x071304
|
||||
@@ -2764,16 +2775,30 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
|
||||
HashTable *postfields;
|
||||
zend_string *string_key;
|
||||
zend_ulong num_key;
|
||||
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
|
||||
curl_mime *mime = NULL;
|
||||
curl_mimepart *part;
|
||||
CURLcode form_error;
|
||||
#else
|
||||
struct HttpPost *first = NULL;
|
||||
struct HttpPost *last = NULL;
|
||||
CURLFORMcode form_error;
|
||||
|
||||
#endif
|
||||
postfields = HASH_OF(zvalue);
|
||||
if (!postfields) {
|
||||
php_error_docref(NULL, E_WARNING, "Couldn't get HashTable in CURLOPT_POSTFIELDS");
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
|
||||
if (zend_hash_num_elements(postfields) > 0) {
|
||||
mime = curl_mime_init(ch->cp);
|
||||
if (mime == NULL) {
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
ZEND_HASH_FOREACH_KEY_VAL(postfields, num_key, string_key, current) {
|
||||
zend_string *postval, *tmp_postval;
|
||||
/* Pretend we have a string_key here */
|
||||
@@ -2808,6 +2833,20 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
|
||||
if (Z_TYPE_P(prop) == IS_STRING && Z_STRLEN_P(prop) > 0) {
|
||||
filename = Z_STRVAL_P(prop);
|
||||
}
|
||||
|
||||
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
|
||||
part = curl_mime_addpart(mime);
|
||||
if (part == NULL) {
|
||||
zend_string_release_ex(string_key, 0);
|
||||
return FAILURE;
|
||||
}
|
||||
if ((form_error = curl_mime_name(part, ZSTR_VAL(string_key))) != CURLE_OK
|
||||
|| (form_error = curl_mime_filedata(part, ZSTR_VAL(postval))) != CURLE_OK
|
||||
|| (form_error = curl_mime_filename(part, filename ? filename : ZSTR_VAL(postval))) != CURLE_OK
|
||||
|| (form_error = curl_mime_type(part, type ? type : "application/octet-stream")) != CURLE_OK) {
|
||||
error = form_error;
|
||||
}
|
||||
#else
|
||||
form_error = curl_formadd(&first, &last,
|
||||
CURLFORM_COPYNAME, ZSTR_VAL(string_key),
|
||||
CURLFORM_NAMELENGTH, ZSTR_LEN(string_key),
|
||||
@@ -2819,6 +2858,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
|
||||
/* Not nice to convert between enums but we only have place for one error type */
|
||||
error = (CURLcode)form_error;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
zend_string_release_ex(string_key, 0);
|
||||
@@ -2827,6 +2867,18 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
|
||||
|
||||
postval = zval_get_tmp_string(current, &tmp_postval);
|
||||
|
||||
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
|
||||
part = curl_mime_addpart(mime);
|
||||
if (part == NULL) {
|
||||
zend_tmp_string_release(tmp_postval);
|
||||
zend_string_release_ex(string_key, 0);
|
||||
return FAILURE;
|
||||
}
|
||||
if ((form_error = curl_mime_name(part, ZSTR_VAL(string_key))) != CURLE_OK
|
||||
|| (form_error = curl_mime_data(part, ZSTR_VAL(postval), ZSTR_LEN(postval))) != CURLE_OK) {
|
||||
error = form_error;
|
||||
}
|
||||
#else
|
||||
/* The arguments after _NAMELENGTH and _CONTENTSLENGTH
|
||||
* must be explicitly cast to long in curl_formadd
|
||||
* use since curl needs a long not an int. */
|
||||
@@ -2841,6 +2893,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
|
||||
/* Not nice to convert between enums but we only have place for one error type */
|
||||
error = (CURLcode)form_error;
|
||||
}
|
||||
#endif
|
||||
zend_tmp_string_release(tmp_postval);
|
||||
zend_string_release_ex(string_key, 0);
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
@@ -2853,8 +2906,13 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
|
||||
if ((*ch->clone) == 1) {
|
||||
zend_llist_clean(&ch->to_free->post);
|
||||
}
|
||||
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
|
||||
zend_llist_add_element(&ch->to_free->post, &mime);
|
||||
error = curl_easy_setopt(ch->cp, CURLOPT_MIMEPOST, mime);
|
||||
#else
|
||||
zend_llist_add_element(&ch->to_free->post, &first);
|
||||
error = curl_easy_setopt(ch->cp, CURLOPT_HTTPPOST, first);
|
||||
#endif
|
||||
} else {
|
||||
#if LIBCURL_VERSION_NUM >= 0x071101
|
||||
zend_string *tmp_str;
|
||||
|
||||
@@ -92,6 +92,8 @@ PHP_FUNCTION(curl_multi_add_handle)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
_php_curl_verify_handlers(ch, 1);
|
||||
|
||||
_php_curl_cleanup_handle(ch);
|
||||
|
||||
GC_ADDREF(Z_RES_P(z_ch));
|
||||
|
||||
@@ -2,12 +2,7 @@
|
||||
Bug #45161 (Reusing a curl handle leaks memory)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
exit("skip not for Windows");
|
||||
}
|
||||
if (!extension_loaded("curl")) {
|
||||
exit("skip curl extension not loaded");
|
||||
}
|
||||
include 'skipif.inc';
|
||||
$curl_version = curl_version();
|
||||
if ($curl_version['version_number'] < 0x071100) {
|
||||
exit("skip: test works only with curl >= 7.17.0");
|
||||
@@ -15,10 +10,12 @@ if ($curl_version['version_number'] < 0x071100) {
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
include 'server.inc';
|
||||
$host = curl_cli_server_start();
|
||||
|
||||
// Fill memory for test
|
||||
$ch = curl_init();
|
||||
$fp = fopen('/dev/null', 'w');
|
||||
$fp = fopen(PHP_OS_FAMILY === 'Windows' ? 'nul' : '/dev/null', 'w');
|
||||
|
||||
/*
|
||||
$i = $start = $end = 100000.00;
|
||||
@@ -32,7 +29,7 @@ for ($i = 0; $i < 100; $i++) {
|
||||
// Start actual test
|
||||
$start = memory_get_usage() + 1024;
|
||||
for($i = 0; $i < 1024; $i++) {
|
||||
curl_setopt($ch, CURLOPT_URL, 'http://127.0.0.1:9/');
|
||||
curl_setopt($ch, CURLOPT_URL, "{$host}/get.inc");
|
||||
curl_setopt($ch, CURLOPT_FILE, $fp);
|
||||
curl_exec($ch);
|
||||
}
|
||||
|
||||
@@ -2,13 +2,14 @@
|
||||
Bug #46739 (array returned by curl_getinfo should contain content_type key)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("curl")) {
|
||||
exit("skip curl extension not loaded");
|
||||
}
|
||||
include 'skipif.inc';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$ch = curl_init('http://127.0.0.1:9/');
|
||||
include 'server.inc';
|
||||
$host = curl_cli_server_start();
|
||||
$ch = curl_init("{$host}/get.inc");
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
curl_exec($ch);
|
||||
$info = curl_getinfo($ch);
|
||||
|
||||
@@ -67,25 +67,25 @@ foreach($options_to_check as $option) {
|
||||
--CLEAN--
|
||||
<?php @unlink(dirname(__FILE__) . '/bug48203.tmp'); ?>
|
||||
--EXPECTF--
|
||||
Warning: curl_multi_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %s on line %d
|
||||
|
||||
Warning: curl_multi_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %s on line %d
|
||||
Warning: curl_multi_add_handle(): CURLOPT_STDERR resource has gone away, resetting to stderr in %s on line %d
|
||||
%A
|
||||
Warning: curl_multi_add_handle(): CURLOPT_STDERR resource has gone away, resetting to stderr in %s on line %d
|
||||
%A
|
||||
Ok for CURLOPT_STDERR
|
||||
|
||||
Warning: curl_multi_exec(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in %s on line %d
|
||||
Warning: curl_multi_add_handle(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in %s on line %d
|
||||
|
||||
Warning: curl_multi_exec(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in %s on line %d
|
||||
Warning: curl_multi_add_handle(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in %s on line %d
|
||||
Ok for CURLOPT_WRITEHEADER
|
||||
|
||||
Warning: curl_multi_exec(): CURLOPT_FILE resource has gone away, resetting to default in %s on line %d
|
||||
Warning: curl_multi_add_handle(): CURLOPT_FILE resource has gone away, resetting to default in %s on line %d
|
||||
|
||||
Warning: curl_multi_exec(): CURLOPT_FILE resource has gone away, resetting to default in %s on line %d
|
||||
Warning: curl_multi_add_handle(): CURLOPT_FILE resource has gone away, resetting to default in %s on line %d
|
||||
Hello World!
|
||||
Hello World!Hello World!
|
||||
Hello World!Ok for CURLOPT_FILE
|
||||
|
||||
Warning: curl_multi_exec(): CURLOPT_INFILE resource has gone away, resetting to default in %s on line %d
|
||||
Warning: curl_multi_add_handle(): CURLOPT_INFILE resource has gone away, resetting to default in %s on line %d
|
||||
|
||||
Warning: curl_multi_exec(): CURLOPT_INFILE resource has gone away, resetting to default in %s on line %d
|
||||
Warning: curl_multi_add_handle(): CURLOPT_INFILE resource has gone away, resetting to default in %s on line %d
|
||||
Ok for CURLOPT_INFILE
|
||||
@@ -3,6 +3,7 @@ Bug #78775: TLS issues from HTTP request affecting other encrypted connections
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('curl')) die('skip Requires curl');
|
||||
if (!extension_loaded('openssl')) die('skip Requires openssl');
|
||||
if (getenv('SKIP_ONLINE_TESTS')) die('skip Online test');
|
||||
?>
|
||||
--FILE--
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
Bug #79033 (Curl timeout error with specific url and post)
|
||||
--SKIPIF--
|
||||
<?php include 'skipif.inc'; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
include 'server.inc';
|
||||
$host = curl_cli_server_start();
|
||||
$ch = curl_init();
|
||||
curl_setopt_array($ch, [
|
||||
CURLOPT_URL => "{$host}/get.inc?test=post",
|
||||
CURLOPT_POST => true,
|
||||
CURLOPT_POSTFIELDS => [],
|
||||
CURLINFO_HEADER_OUT => true,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
]);
|
||||
var_dump(curl_exec($ch));
|
||||
var_dump(curl_getinfo($ch)["request_header"]);
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(%d) "array(0) {
|
||||
}
|
||||
"
|
||||
string(90) "POST /get.inc?test=post HTTP/1.1
|
||||
Host: localhost:%d
|
||||
Accept: */*
|
||||
Content-Length: 0
|
||||
|
||||
"
|
||||
+8
-5
@@ -3297,6 +3297,7 @@ PHP_METHOD(DateTimeImmutable, modify)
|
||||
|
||||
date_clone_immutable(object, &new_object);
|
||||
if (!php_date_modify(&new_object, modify, modify_len)) {
|
||||
zval_ptr_dtor(&new_object);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -4389,14 +4390,16 @@ static int php_date_interval_initialize_from_hash(zval **return_value, php_inter
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("h", h, timelib_sll, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("i", i, timelib_sll, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("s", s, timelib_sll, -1)
|
||||
do {
|
||||
{
|
||||
zval *z_arg = zend_hash_str_find(myht, "f", sizeof("f") - 1);
|
||||
(*intobj)->diff->us = -1000000;
|
||||
if (z_arg) {
|
||||
(*intobj)->diff->us = ((double)zval_get_double(z_arg) * 1000000);
|
||||
} else {
|
||||
(*intobj)->diff->us = (double) -1000000;
|
||||
double val = zval_get_double(z_arg) * 1000000;
|
||||
if (val >= 0 && val < 1000000) {
|
||||
(*intobj)->diff->us = val;
|
||||
}
|
||||
}
|
||||
} while (0);
|
||||
}
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("weekday", weekday, int, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("weekday_behavior", weekday_behavior, int, -1)
|
||||
PHP_DATE_INTERVAL_READ_PROPERTY("first_last_day_of", first_last_day_of, int, -1)
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
DateTimeImmutable::modify() with invalid format
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$datetime = new DateTimeImmutable;
|
||||
var_dump($datetime->modify(''));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: DateTimeImmutable::modify(): Failed to parse time string () at position 0 ( in %s on line %d
|
||||
bool(false)
|
||||
@@ -0,0 +1,42 @@
|
||||
--TEST--
|
||||
Bug #79015 (undefined-behavior in php_date.c)
|
||||
--FILE--
|
||||
<?php
|
||||
$payload = 'O:12:"DateInterval":16:{s:1:"y";i:1;s:1:"m";i:0;s:1:"d";i:4;s:1:"h";i:0;s:1:"i";i:0;s:1:"s";i:0;s:1:"f";i:9999999999990;s:7:"weekday";i:0;s:16:"weekday_behavior";i:0;s:17:"first_last_day_of";i:0;s:6:"invert";i:0;s:4:"days";b:0;s:12:"special_type";i:0;s:14:"special_amount";i:0;s:21:"have_weekday_relative";i:0;s:21:"have_special_relative";i:0;}';
|
||||
var_dump(unserialize($payload));
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(DateInterval)#%d (16) {
|
||||
["y"]=>
|
||||
int(1)
|
||||
["m"]=>
|
||||
int(0)
|
||||
["d"]=>
|
||||
int(4)
|
||||
["h"]=>
|
||||
int(0)
|
||||
["i"]=>
|
||||
int(0)
|
||||
["s"]=>
|
||||
int(0)
|
||||
["f"]=>
|
||||
float(-1)
|
||||
["weekday"]=>
|
||||
int(0)
|
||||
["weekday_behavior"]=>
|
||||
int(0)
|
||||
["first_last_day_of"]=>
|
||||
int(0)
|
||||
["invert"]=>
|
||||
int(0)
|
||||
["days"]=>
|
||||
bool(false)
|
||||
["special_type"]=>
|
||||
int(0)
|
||||
["special_amount"]=>
|
||||
int(0)
|
||||
["have_weekday_relative"]=>
|
||||
int(0)
|
||||
["have_special_relative"]=>
|
||||
int(0)
|
||||
}
|
||||
@@ -43,10 +43,18 @@ DBA_OPEN_FUNC(lmdb)
|
||||
MDB_env *env;
|
||||
MDB_txn *txn;
|
||||
int rc, mode = 0644, flags = MDB_NOSUBDIR;
|
||||
zend_long mapsize = 0;
|
||||
|
||||
if(info->argc > 0) {
|
||||
mode = zval_get_long(&info->argv[0]);
|
||||
|
||||
if (info->argc > 1) {
|
||||
mapsize = zval_get_long(&info->argv[1]);
|
||||
if (mapsize < 0) {
|
||||
*error = "mapsize must be greater than or equal to zero";
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
/* TODO implement handling of the additional flags. */
|
||||
}
|
||||
|
||||
@@ -56,6 +64,14 @@ DBA_OPEN_FUNC(lmdb)
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (mapsize > 0) {
|
||||
rc = mdb_env_set_mapsize(env, (size_t) mapsize);
|
||||
if (rc) {
|
||||
*error = mdb_strerror(rc);
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
rc = mdb_env_open(env, info->path, flags, mode);
|
||||
if (rc) {
|
||||
*error = mdb_strerror(rc);
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
Bug #78808 ([LMDB] MDB_MAP_FULL: Environment mapsize limit reached)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
|
||||
$handler = 'lmdb';
|
||||
require_once __DIR__ .'/skipif.inc';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$handler = 'lmdb';
|
||||
require_once __DIR__ .'/test.inc';
|
||||
$lmdb_h = dba_open($db_filename, 'c', 'lmdb', 0644, 5*1048576);
|
||||
for ($i = 0; $i < 50000; $i++) {
|
||||
dba_insert('key' . $i, 'value '. $i, $lmdb_h);
|
||||
}
|
||||
dba_close($lmdb_h);
|
||||
echo "done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
done
|
||||
--CLEAN--
|
||||
<?php
|
||||
require_once dirname(__FILE__) .'/clean.inc';
|
||||
?>
|
||||
+1
-1
@@ -339,7 +339,7 @@ int dom_document_encoding_write(dom_object *obj, zval *newval)
|
||||
|
||||
str = zval_get_string(newval);
|
||||
|
||||
handler = xmlFindCharEncodingHandler(Z_STRVAL_P(newval));
|
||||
handler = xmlFindCharEncodingHandler(ZSTR_VAL(str));
|
||||
|
||||
if (handler != NULL) {
|
||||
xmlCharEncCloseFunc(handler);
|
||||
|
||||
+3
-7
@@ -428,13 +428,9 @@ int dom_node_child_nodes_read(dom_object *obj, zval *retval)
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (dom_node_children_valid(nodep) == FAILURE) {
|
||||
ZVAL_NULL(retval);
|
||||
} else {
|
||||
php_dom_create_interator(retval, DOM_NODELIST);
|
||||
intern = Z_DOMOBJ_P(retval);
|
||||
dom_namednode_iter(obj, XML_ELEMENT_NODE, intern, NULL, NULL, NULL);
|
||||
}
|
||||
php_dom_create_interator(retval, DOM_NODELIST);
|
||||
intern = Z_DOMOBJ_P(retval);
|
||||
dom_namednode_iter(obj, XML_ELEMENT_NODE, intern, NULL, NULL, NULL);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ object(DOMText)#%d (19) {
|
||||
["parentNode"]=>
|
||||
NULL
|
||||
["childNodes"]=>
|
||||
NULL
|
||||
string(22) "(object value omitted)"
|
||||
["firstChild"]=>
|
||||
NULL
|
||||
["lastChild"]=>
|
||||
@@ -140,7 +140,7 @@ object(DOMText)#%d (19) {
|
||||
["parentNode"]=>
|
||||
NULL
|
||||
["childNodes"]=>
|
||||
NULL
|
||||
string(22) "(object value omitted)"
|
||||
["firstChild"]=>
|
||||
NULL
|
||||
["lastChild"]=>
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #77569 (Write Access Violation in DomImplementation)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('dom')) die('skip dom extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$imp = new DOMImplementation;
|
||||
$dom = $imp->createDocument("", "");
|
||||
$dom->encoding = null;
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: main(): Invalid Document Encoding in %s on line %d
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #79271 (DOMDocumentType::$childNodes is NULL)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('dom')) die('skip dom extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$dom = new DOMImplementation();
|
||||
$type = $dom->createDocumentType('html');
|
||||
var_dump($type->childNodes);
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(DOMNodeList)#%d (1) {
|
||||
["length"]=>
|
||||
int(0)
|
||||
}
|
||||
+6
-10
@@ -723,18 +723,16 @@ PHP_FUNCTION(enchant_dict_quick_check)
|
||||
PHP_ENCHANT_GET_DICT;
|
||||
|
||||
if (enchant_dict_check(pdict->pdict, word, wordlen) > 0) {
|
||||
int n_sugg;
|
||||
size_t n_sugg_st;
|
||||
size_t n_sugg;
|
||||
char **suggs;
|
||||
|
||||
if (!sugg && ZEND_NUM_ARGS() == 2) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
suggs = enchant_dict_suggest(pdict->pdict, word, wordlen, &n_sugg_st);
|
||||
memcpy(&n_sugg, &n_sugg_st, sizeof(n_sugg));
|
||||
suggs = enchant_dict_suggest(pdict->pdict, word, wordlen, &n_sugg);
|
||||
if (suggs && n_sugg) {
|
||||
int i;
|
||||
size_t i;
|
||||
for (i = 0; i < n_sugg; i++) {
|
||||
add_next_index_string(sugg, suggs[i]);
|
||||
}
|
||||
@@ -776,8 +774,7 @@ PHP_FUNCTION(enchant_dict_suggest)
|
||||
size_t wordlen;
|
||||
char **suggs;
|
||||
enchant_dict *pdict;
|
||||
int n_sugg;
|
||||
size_t n_sugg_st;
|
||||
size_t n_sugg;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &dict, &word, &wordlen) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
@@ -785,10 +782,9 @@ PHP_FUNCTION(enchant_dict_suggest)
|
||||
|
||||
PHP_ENCHANT_GET_DICT;
|
||||
|
||||
suggs = enchant_dict_suggest(pdict->pdict, word, wordlen, &n_sugg_st);
|
||||
memcpy(&n_sugg, &n_sugg_st, sizeof(n_sugg));
|
||||
suggs = enchant_dict_suggest(pdict->pdict, word, wordlen, &n_sugg);
|
||||
if (suggs && n_sugg) {
|
||||
int i;
|
||||
size_t i;
|
||||
|
||||
array_init(return_value);
|
||||
for (i = 0; i < n_sugg; i++) {
|
||||
|
||||
+11
-4
@@ -3138,7 +3138,8 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
/*exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "check (%s)", maker_note->make?maker_note->make:"");*/
|
||||
if (maker_note->make && (!ImageInfo->make || strcmp(maker_note->make, ImageInfo->make)))
|
||||
continue;
|
||||
if (maker_note->id_string && strncmp(maker_note->id_string, value_ptr, maker_note->id_string_len))
|
||||
if (maker_note->id_string && value_len >= maker_note->id_string_len
|
||||
&& strncmp(maker_note->id_string, value_ptr, maker_note->id_string_len))
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
@@ -3212,8 +3213,9 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
||||
}
|
||||
|
||||
for (de=0;de<NumDirEntries;de++) {
|
||||
if (!exif_process_IFD_TAG(ImageInfo, dir_start + 2 + 12 * de,
|
||||
offset_base, data_len, displacement, section_index, 0, maker_note->tag_table)) {
|
||||
size_t offset = 2 + 12 * de;
|
||||
if (!exif_process_IFD_TAG(ImageInfo, dir_start + offset,
|
||||
offset_base, data_len - offset, displacement, section_index, 0, maker_note->tag_table)) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -3663,6 +3665,11 @@ static void exif_process_TIFF_in_JPEG(image_info_type *ImageInfo, char *CharBuf,
|
||||
{
|
||||
unsigned exif_value_2a, offset_of_ifd;
|
||||
|
||||
if (length < 2) {
|
||||
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "Missing TIFF alignment marker");
|
||||
return;
|
||||
}
|
||||
|
||||
/* set the thumbnail stuff to nothing so we can test to see if they get set up */
|
||||
if (memcmp(CharBuf, "II", 2) == 0) {
|
||||
ImageInfo->motorola_intel = 0;
|
||||
@@ -3815,7 +3822,7 @@ static int exif_scan_JPEG_header(image_info_type *ImageInfo)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
sn = exif_file_sections_add(ImageInfo, marker, itemlen+1, NULL);
|
||||
sn = exif_file_sections_add(ImageInfo, marker, itemlen, NULL);
|
||||
Data = ImageInfo->file.list[sn].data;
|
||||
|
||||
/* Store first two pre-read bytes. */
|
||||
|
||||
@@ -70,7 +70,7 @@ Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal f
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal format code 0x3030, suppose BYTE in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal pointer offset(x30303030 + x30303030 = x60606060 > x00EE) in %sbug76557.php on line %d
|
||||
Warning: exif_read_data(bug76557.jpg): Process tag(x3030=UndefinedTa): Illegal pointer offset(x30303030 + x30303030 = x60606060 > %s) in %sbug76557.php on line %d
|
||||
|
||||
Warning: exif_read_data(bug76557.jpg): File structure corrupted in %sbug76557.php on line %d
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Bug #78793: Use-after-free in exif parsing under memory sanitizer
|
||||
--FILE--
|
||||
<?php
|
||||
$f = "ext/exif/tests/bug77950.tiff";
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
@exif_read_data($f);
|
||||
}
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #78910: Heap-buffer-overflow READ in exif (OSS-Fuzz #19044)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(exif_read_data('data:image/jpg;base64,TU0AKgAAAAwgICAgAAIBDwAEAAAAAgAAACKSfCAgAAAAAEZVSklGSUxN'));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: exif_read_data(): Read from TIFF: tag(0x927C, MakerNote ): Illegal format code 0x2020, switching to BYTE in %s on line %d
|
||||
|
||||
Warning: exif_read_data(): Process tag(x927C=MakerNote ): Illegal format code 0x2020, suppose BYTE in %s on line %d
|
||||
|
||||
Warning: exif_read_data(): IFD data too short: 0x0000 offset 0x000C in %s on line %d
|
||||
|
||||
Warning: exif_read_data(): Invalid TIFF file in %s on line %d
|
||||
bool(false)
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #79282: Use-of-uninitialized-value in exif
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(exif_read_data('data://image/jpeg;base64,/9jhAAlFeGlmAAAg'));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: exif_read_data(): Missing TIFF alignment marker in %s on line %d
|
||||
|
||||
Warning: exif_read_data(): File structure corrupted in %s on line %d
|
||||
|
||||
Warning: exif_read_data(): Invalid JPEG file in %s on line %d
|
||||
bool(false)
|
||||
@@ -0,0 +1,8 @@
|
||||
VERSION=5.33
|
||||
if [[ ! -d libmagic.orig ]]; then
|
||||
mkdir libmagic.orig
|
||||
wget -O - ftp://ftp.astron.com/pub/file/file-$VERSION.tar.gz \
|
||||
| tar -xz --strip-components=2 -C libmagic.orig file-$VERSION/src
|
||||
fi
|
||||
sed -e "s/X\.YY/${VERSION//.}/g" libmagic.orig/magic.h.in > libmagic.orig/magic.h
|
||||
diff -u libmagic.orig libmagic | grep -v '^Only in' > libmagic.patch
|
||||
+102
-66
@@ -1,6 +1,6 @@
|
||||
diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
|
||||
--- libmagic.orig/apprentice.c 2018-03-11 01:46:42.000000000 +0100
|
||||
+++ libmagic/apprentice.c 2018-11-05 00:16:58.812821826 +0100
|
||||
+++ libmagic/apprentice.c 2020-02-26 09:55:13.842042400 +0100
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) Ian F. Darwin 1986-1995.
|
||||
* Software written by Ian F. Darwin and others;
|
||||
@@ -1245,7 +1245,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
|
||||
switch (m->str_flags & PSTRING_LEN) {
|
||||
diff -u libmagic.orig/apptype.c libmagic/apptype.c
|
||||
--- libmagic.orig/apptype.c 2011-09-07 23:57:15.000000000 +0200
|
||||
+++ libmagic/apptype.c 2018-08-10 11:46:29.210671445 +0200
|
||||
+++ libmagic/apptype.c 2020-02-26 09:55:13.843047200 +0100
|
||||
@@ -1,15 +1,15 @@
|
||||
/*
|
||||
* Adapted from: apptype.c, Written by Eberhard Mattes and put into the
|
||||
@@ -1280,7 +1280,7 @@ diff -u libmagic.orig/apptype.c libmagic/apptype.c
|
||||
#include "file.h"
|
||||
diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
|
||||
--- libmagic.orig/ascmagic.c 2017-11-02 21:25:39.000000000 +0100
|
||||
+++ libmagic/ascmagic.c 2018-08-10 11:46:29.210671445 +0200
|
||||
+++ libmagic/ascmagic.c 2020-02-26 09:55:13.845043300 +0100
|
||||
@@ -90,7 +90,7 @@
|
||||
rv = file_ascmagic_with_encoding(ms, &bb,
|
||||
ubuf, ulen, code, type, text);
|
||||
@@ -1311,7 +1311,7 @@ diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
|
||||
}
|
||||
diff -u libmagic.orig/buffer.c libmagic/buffer.c
|
||||
--- libmagic.orig/buffer.c 2018-03-11 01:46:42.000000000 +0100
|
||||
+++ libmagic/buffer.c 2018-08-10 11:46:29.210671445 +0200
|
||||
+++ libmagic/buffer.c 2020-02-26 09:55:13.846042600 +0100
|
||||
@@ -31,7 +31,11 @@
|
||||
#endif /* lint */
|
||||
|
||||
@@ -1362,7 +1362,7 @@ diff -u libmagic.orig/buffer.c libmagic/buffer.c
|
||||
|
||||
diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
--- libmagic.orig/cdf.c 2018-03-11 01:46:42.000000000 +0100
|
||||
+++ libmagic/cdf.c 2018-08-10 11:46:29.214671395 +0200
|
||||
+++ libmagic/cdf.c 2020-02-26 09:55:13.847043900 +0100
|
||||
@@ -43,7 +43,17 @@
|
||||
#include <err.h>
|
||||
#endif
|
||||
@@ -1564,7 +1564,28 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
*maxcount = 0;
|
||||
*info = NULL;
|
||||
return NULL;
|
||||
@@ -1092,7 +1078,7 @@
|
||||
@@ -1003,8 +989,9 @@
|
||||
goto out;
|
||||
}
|
||||
nelements = CDF_GETUINT32(q, 1);
|
||||
- if (nelements == 0) {
|
||||
- DPRINTF(("CDF_VECTOR with nelements == 0\n"));
|
||||
+ if (nelements > CDF_ELEMENT_LIMIT || nelements == 0) {
|
||||
+ DPRINTF(("CDF_VECTOR with nelements == %"
|
||||
+ SIZE_T_FORMAT "u\n", nelements));
|
||||
goto out;
|
||||
}
|
||||
slen = 2;
|
||||
@@ -1046,8 +1033,6 @@
|
||||
goto out;
|
||||
inp += nelem;
|
||||
}
|
||||
- DPRINTF(("nelements = %" SIZE_T_FORMAT "u\n",
|
||||
- nelements));
|
||||
for (j = 0; j < nelements && i < sh.sh_properties;
|
||||
j++, i++)
|
||||
{
|
||||
@@ -1092,7 +1077,7 @@
|
||||
}
|
||||
return 0;
|
||||
out:
|
||||
@@ -1573,7 +1594,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
*info = NULL;
|
||||
*count = 0;
|
||||
*maxcount = 0;
|
||||
@@ -1383,7 +1369,7 @@
|
||||
@@ -1383,7 +1368,7 @@
|
||||
cdf_directory_t *d;
|
||||
char name[__arraycount(d->d_name)];
|
||||
cdf_stream_t scn;
|
||||
@@ -1582,7 +1603,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
|
||||
static const char *types[] = { "empty", "user storage",
|
||||
"user stream", "lockbytes", "property", "root storage" };
|
||||
@@ -1425,7 +1411,7 @@
|
||||
@@ -1425,7 +1410,7 @@
|
||||
break;
|
||||
}
|
||||
cdf_dump_stream(&scn);
|
||||
@@ -1591,7 +1612,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -1438,7 +1424,7 @@
|
||||
@@ -1438,7 +1423,7 @@
|
||||
cdf_dump_property_info(const cdf_property_info_t *info, size_t count)
|
||||
{
|
||||
cdf_timestamp_t tp;
|
||||
@@ -1600,7 +1621,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
char buf[64];
|
||||
size_t i, j;
|
||||
|
||||
@@ -1523,7 +1509,7 @@
|
||||
@@ -1523,7 +1508,7 @@
|
||||
(void)fprintf(stderr, "Class %s\n", buf);
|
||||
(void)fprintf(stderr, "Count %d\n", ssi.si_count);
|
||||
cdf_dump_property_info(info, count);
|
||||
@@ -1609,7 +1630,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
}
|
||||
|
||||
|
||||
@@ -1544,7 +1530,7 @@
|
||||
@@ -1544,7 +1529,7 @@
|
||||
cdf_u16tos8(sbuf, ce[i].ce_namlen, ce[i].ce_name),
|
||||
cdf_ctime(&ts.tv_sec, tbuf));
|
||||
}
|
||||
@@ -1620,7 +1641,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
|
||||
#endif
|
||||
diff -u libmagic.orig/cdf.h libmagic/cdf.h
|
||||
--- libmagic.orig/cdf.h 2017-03-09 17:57:17.000000000 +0100
|
||||
+++ libmagic/cdf.h 2018-08-10 11:46:29.214671395 +0200
|
||||
+++ libmagic/cdf.h 2020-02-26 09:55:13.848043100 +0100
|
||||
@@ -35,10 +35,10 @@
|
||||
#ifndef _H_CDF_
|
||||
#define _H_CDF_
|
||||
@@ -1635,7 +1656,15 @@ diff -u libmagic.orig/cdf.h libmagic/cdf.h
|
||||
#endif
|
||||
#ifdef __DJGPP__
|
||||
#define timespec timeval
|
||||
@@ -272,7 +272,7 @@
|
||||
@@ -48,6 +48,7 @@
|
||||
typedef int32_t cdf_secid_t;
|
||||
|
||||
#define CDF_LOOP_LIMIT 10000
|
||||
+#define CDF_ELEMENT_LIMIT 100000
|
||||
|
||||
#define CDF_SECID_NULL 0
|
||||
#define CDF_SECID_FREE -1
|
||||
@@ -272,7 +273,7 @@
|
||||
typedef struct {
|
||||
uint16_t ce_namlen;
|
||||
uint32_t ce_num;
|
||||
@@ -1646,7 +1675,7 @@ diff -u libmagic.orig/cdf.h libmagic/cdf.h
|
||||
|
||||
diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
|
||||
--- libmagic.orig/cdf_time.c 2017-03-29 17:57:48.000000000 +0200
|
||||
+++ libmagic/cdf_time.c 2019-03-08 21:00:46.636733574 +0100
|
||||
+++ libmagic/cdf_time.c 2020-02-26 09:55:13.849044200 +0100
|
||||
@@ -23,6 +23,7 @@
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -1693,7 +1722,7 @@ diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
|
||||
(void)snprintf(buf, 26, "*Bad* %#16.16" INT64_T_FORMAT "x\n",
|
||||
diff -u libmagic.orig/compress.c libmagic/compress.c
|
||||
--- libmagic.orig/compress.c 2017-11-02 21:25:39.000000000 +0100
|
||||
+++ libmagic/compress.c 2018-08-10 11:46:29.214671395 +0200
|
||||
+++ libmagic/compress.c 2020-02-26 09:55:13.850043300 +0100
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) Ian F. Darwin 1986-1995.
|
||||
* Software written by Ian F. Darwin and others;
|
||||
@@ -1994,7 +2023,7 @@ diff -u libmagic.orig/compress.c libmagic/compress.c
|
||||
+#endif /* if PHP_FILEINFO_UNCOMPRESS */
|
||||
diff -u libmagic.orig/der.c libmagic/der.c
|
||||
--- libmagic.orig/der.c 2017-02-10 19:14:01.000000000 +0100
|
||||
+++ libmagic/der.c 2018-08-10 11:46:29.214671395 +0200
|
||||
+++ libmagic/der.c 2020-02-26 09:55:13.851044000 +0100
|
||||
@@ -51,7 +51,9 @@
|
||||
#include "magic.h"
|
||||
#include "der.h"
|
||||
@@ -2051,7 +2080,7 @@ diff -u libmagic.orig/der.c libmagic/der.c
|
||||
der_tag(buf, sizeof(buf), tag), len);
|
||||
diff -u libmagic.orig/elfclass.h libmagic/elfclass.h
|
||||
--- libmagic.orig/elfclass.h 2014-12-17 00:18:40.000000000 +0100
|
||||
+++ libmagic/elfclass.h 2018-08-10 11:46:29.214671395 +0200
|
||||
+++ libmagic/elfclass.h 2020-02-26 09:55:13.852043400 +0100
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) Christos Zoulas 2008.
|
||||
@@ -2099,7 +2128,7 @@ diff -u libmagic.orig/elfclass.h libmagic/elfclass.h
|
||||
(int)elf_getu16(swap, elfhdr.e_shstrndx),
|
||||
diff -u libmagic.orig/encoding.c libmagic/encoding.c
|
||||
--- libmagic.orig/encoding.c 2017-11-02 21:25:39.000000000 +0100
|
||||
+++ libmagic/encoding.c 2018-08-10 11:46:29.214671395 +0200
|
||||
+++ libmagic/encoding.c 2020-02-26 09:55:13.854045100 +0100
|
||||
@@ -88,12 +88,12 @@
|
||||
*code_mime = "binary";
|
||||
|
||||
@@ -2129,7 +2158,7 @@ diff -u libmagic.orig/encoding.c libmagic/encoding.c
|
||||
}
|
||||
diff -u libmagic.orig/file.h libmagic/file.h
|
||||
--- libmagic.orig/file.h 2018-03-11 01:46:42.000000000 +0100
|
||||
+++ libmagic/file.h 2018-11-05 21:31:59.339653700 +0100
|
||||
+++ libmagic/file.h 2020-02-26 09:55:13.856043400 +0100
|
||||
@@ -27,21 +27,15 @@
|
||||
*/
|
||||
/*
|
||||
@@ -2416,7 +2445,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
|
||||
#endif
|
||||
diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
|
||||
--- libmagic.orig/fsmagic.c 2017-05-24 21:17:50.000000000 +0200
|
||||
+++ libmagic/fsmagic.c 2018-08-10 11:46:29.214671395 +0200
|
||||
+++ libmagic/fsmagic.c 2020-02-26 09:55:13.857043000 +0100
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) Ian F. Darwin 1986-1995.
|
||||
* Software written by Ian F. Darwin and others;
|
||||
@@ -2777,7 +2806,7 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
|
||||
case S_IFSOCK:
|
||||
diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
--- libmagic.orig/funcs.c 2017-11-02 21:25:39.000000000 +0100
|
||||
+++ libmagic/funcs.c 2018-11-05 21:31:59.339653700 +0100
|
||||
+++ libmagic/funcs.c 2020-02-26 09:55:13.859042500 +0100
|
||||
@@ -31,7 +31,6 @@
|
||||
#endif /* lint */
|
||||
|
||||
@@ -3025,7 +3054,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
if (ms->c.li == NULL) {
|
||||
file_oomem(ms, len);
|
||||
return -1;
|
||||
@@ -464,76 +470,41 @@
|
||||
@@ -464,76 +470,38 @@
|
||||
protected int
|
||||
file_replace(struct magic_set *ms, const char *pat, const char *rep)
|
||||
{
|
||||
@@ -3053,11 +3082,9 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
+ zend_string *repl;
|
||||
+ size_t rep_cnt = 0;
|
||||
+
|
||||
+ (void)setlocale(LC_CTYPE, "C");
|
||||
+
|
||||
+ opts |= PCRE2_MULTILINE;
|
||||
+ convert_libmagic_pattern(&patt, (char*)pat, strlen(pat), opts);
|
||||
+ if ((pce = pcre_get_compiled_regex_cache(Z_STR(patt))) == NULL) {
|
||||
+ if ((pce = pcre_get_compiled_regex_cache_ex(Z_STR(patt), 0)) == NULL) {
|
||||
+ zval_ptr_dtor(&patt);
|
||||
+ rep_cnt = -1;
|
||||
+ goto out;
|
||||
@@ -3126,12 +3153,11 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
- file_magerror(ms, "regex error %d for `%s', (%s)", rc, rx->pat,
|
||||
- errmsg);
|
||||
+out:
|
||||
+ (void)setlocale(LC_CTYPE, "");
|
||||
+ return rep_cnt;
|
||||
}
|
||||
|
||||
protected file_pushbuf_t *
|
||||
@@ -544,7 +515,7 @@
|
||||
@@ -544,7 +512,7 @@
|
||||
if (ms->event_flags & EVENT_HAD_ERR)
|
||||
return NULL;
|
||||
|
||||
@@ -3140,7 +3166,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
return NULL;
|
||||
|
||||
pb->buf = ms->o.buf;
|
||||
@@ -562,8 +533,8 @@
|
||||
@@ -562,8 +530,8 @@
|
||||
char *rbuf;
|
||||
|
||||
if (ms->event_flags & EVENT_HAD_ERR) {
|
||||
@@ -3151,7 +3177,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -572,7 +543,7 @@
|
||||
@@ -572,7 +540,7 @@
|
||||
ms->o.buf = pb->buf;
|
||||
ms->offset = pb->offset;
|
||||
|
||||
@@ -3162,7 +3188,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
|
||||
|
||||
diff -u libmagic.orig/magic.c libmagic/magic.c
|
||||
--- libmagic.orig/magic.c 2017-08-28 15:39:18.000000000 +0200
|
||||
+++ libmagic/magic.c 2018-08-10 11:46:29.214671395 +0200
|
||||
+++ libmagic/magic.c 2020-02-26 09:55:13.861044300 +0100
|
||||
@@ -25,11 +25,6 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
@@ -3638,8 +3664,8 @@ diff -u libmagic.orig/magic.c libmagic/magic.c
|
||||
public const char *
|
||||
magic_error(struct magic_set *ms)
|
||||
diff -u libmagic.orig/magic.h libmagic/magic.h
|
||||
--- libmagic.orig/magic.h 2018-11-13 21:40:06.272616270 +0100
|
||||
+++ libmagic/magic.h 2018-08-10 11:46:29.214671395 +0200
|
||||
--- libmagic.orig/magic.h 2020-02-26 09:56:58.945274100 +0100
|
||||
+++ libmagic/magic.h 2020-02-26 09:55:13.862044300 +0100
|
||||
@@ -122,6 +122,7 @@
|
||||
|
||||
const char *magic_getpath(const char *, int);
|
||||
@@ -3650,7 +3676,7 @@ diff -u libmagic.orig/magic.h libmagic/magic.h
|
||||
|
||||
diff -u libmagic.orig/print.c libmagic/print.c
|
||||
--- libmagic.orig/print.c 2017-02-10 19:14:01.000000000 +0100
|
||||
+++ libmagic/print.c 2019-03-08 21:00:46.636733574 +0100
|
||||
+++ libmagic/print.c 2020-02-26 09:55:13.864043900 +0100
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) Ian F. Darwin 1986-1995.
|
||||
* Software written by Ian F. Darwin and others;
|
||||
@@ -3733,7 +3759,7 @@ diff -u libmagic.orig/print.c libmagic/print.c
|
||||
goto out;
|
||||
diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
|
||||
--- libmagic.orig/readcdf.c 2017-11-02 21:25:39.000000000 +0100
|
||||
+++ libmagic/readcdf.c 2018-08-10 11:46:29.214671395 +0200
|
||||
+++ libmagic/readcdf.c 2020-02-26 09:55:13.865044100 +0100
|
||||
@@ -31,7 +31,11 @@
|
||||
|
||||
#include <assert.h>
|
||||
@@ -3757,12 +3783,13 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -116,30 +116,14 @@
|
||||
@@ -116,30 +116,24 @@
|
||||
{
|
||||
size_t i;
|
||||
const char *rv = NULL;
|
||||
-#ifdef USE_C_LOCALE
|
||||
- locale_t old_lc_ctype, c_lc_ctype;
|
||||
+ char *vbuf_lower;
|
||||
|
||||
- c_lc_ctype = newlocale(LC_CTYPE_MASK, "C", 0);
|
||||
- assert(c_lc_ctype != NULL);
|
||||
@@ -3771,9 +3798,18 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
|
||||
-#else
|
||||
- char *old_lc_ctype = setlocale(LC_CTYPE, "C");
|
||||
-#endif
|
||||
+ (void)setlocale(LC_CTYPE, "C");
|
||||
for (i = 0; nv[i].pattern != NULL; i++)
|
||||
if (strcasestr(vbuf, nv[i].pattern) != NULL) {
|
||||
- for (i = 0; nv[i].pattern != NULL; i++)
|
||||
- if (strcasestr(vbuf, nv[i].pattern) != NULL) {
|
||||
+ vbuf_lower = zend_str_tolower_dup(vbuf, strlen(vbuf));
|
||||
+ for (i = 0; nv[i].pattern != NULL; i++) {
|
||||
+ char *pattern_lower;
|
||||
+ int found;
|
||||
+
|
||||
+ pattern_lower = zend_str_tolower_dup(nv[i].pattern, strlen(nv[i].pattern));
|
||||
+ found = (strstr(vbuf_lower, pattern_lower) != NULL);
|
||||
+ efree(pattern_lower);
|
||||
+
|
||||
+ if (found) {
|
||||
rv = nv[i].mime;
|
||||
break;
|
||||
}
|
||||
@@ -3786,11 +3822,13 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
|
||||
-#else
|
||||
- setlocale(LC_CTYPE, old_lc_ctype);
|
||||
-#endif
|
||||
+ (void)setlocale(LC_CTYPE, "");
|
||||
+ }
|
||||
+
|
||||
+ efree(vbuf_lower);
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -155,6 +139,8 @@
|
||||
@@ -155,6 +149,8 @@
|
||||
const char *s, *e;
|
||||
int len;
|
||||
|
||||
@@ -3799,7 +3837,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
|
||||
if (!NOTMIME(ms) && root_storage)
|
||||
str = cdf_clsid_to_mime(root_storage->d_storage_uuid,
|
||||
clsid2mime);
|
||||
@@ -281,10 +267,10 @@
|
||||
@@ -281,10 +277,10 @@
|
||||
if (file_printf(ms, "%s%s",
|
||||
cdf_u16tos8(buf, ce[i].ce_namlen, ce[i].ce_name),
|
||||
i == cat->cat_num - 1 ? "]" : ", ") == -1) {
|
||||
@@ -3812,7 +3850,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
|
||||
} else {
|
||||
if (file_printf(ms, "application/CDFV2") == -1)
|
||||
return -1;
|
||||
@@ -345,7 +331,7 @@
|
||||
@@ -345,7 +341,7 @@
|
||||
}
|
||||
|
||||
m = cdf_file_property_info(ms, info, count, root_storage);
|
||||
@@ -3821,7 +3859,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
|
||||
|
||||
return m == -1 ? -2 : m;
|
||||
}
|
||||
@@ -353,11 +339,11 @@
|
||||
@@ -353,11 +349,11 @@
|
||||
#ifdef notdef
|
||||
private char *
|
||||
format_clsid(char *buf, size_t len, const uint64_t uuid[2]) {
|
||||
@@ -3835,7 +3873,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
|
||||
(uuid[1] >> 48) & (uint64_t)0x0000000000000ffffULL,
|
||||
(uuid[1] >> 0) & (uint64_t)0x0000fffffffffffffULL);
|
||||
return buf;
|
||||
@@ -436,7 +422,7 @@
|
||||
@@ -436,7 +432,7 @@
|
||||
const char *sections[5];
|
||||
const int types[5];
|
||||
} sectioninfo[] = {
|
||||
@@ -3844,7 +3882,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
|
||||
{
|
||||
"EncryptedPackage", "EncryptedSummary",
|
||||
NULL, NULL, NULL,
|
||||
@@ -448,7 +434,7 @@
|
||||
@@ -448,7 +444,7 @@
|
||||
|
||||
},
|
||||
},
|
||||
@@ -3853,7 +3891,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
|
||||
{
|
||||
#if 0
|
||||
"TaxForms", "PDFTaxForms", "modulesInBackup",
|
||||
@@ -655,11 +641,11 @@
|
||||
@@ -655,11 +651,11 @@
|
||||
cdf_zero_stream(&scn);
|
||||
cdf_zero_stream(&sst);
|
||||
out3:
|
||||
@@ -3870,7 +3908,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
|
||||
if (NOTMIME(ms)) {
|
||||
diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
--- libmagic.orig/softmagic.c 2018-04-15 20:49:15.000000000 +0200
|
||||
+++ libmagic/softmagic.c 2018-11-11 21:42:27.860274508 +0100
|
||||
+++ libmagic/softmagic.c 2020-02-26 09:55:13.866043500 +0100
|
||||
@@ -43,6 +43,10 @@
|
||||
#include <time.h>
|
||||
#include "der.h"
|
||||
@@ -3914,14 +3952,13 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
#define FLT (STRING_BINTEST | STRING_TEXTTEST)
|
||||
((text && (m->str_flags & FLT) == STRING_BINTEST) ||
|
||||
(!text && (m->str_flags & FLT) == STRING_TEXTTEST))) ||
|
||||
@@ -416,42 +422,30 @@
|
||||
@@ -416,42 +422,28 @@
|
||||
private int
|
||||
check_fmt(struct magic_set *ms, const char *fmt)
|
||||
{
|
||||
- file_regex_t rx;
|
||||
- int rc, rv = -1;
|
||||
+ pcre2_code *pce;
|
||||
+ uint32_t re_options, capture_count;
|
||||
+ pcre_cache_entry *pce;
|
||||
+ int rv = -1;
|
||||
+ zend_string *pattern;
|
||||
|
||||
@@ -3931,22 +3968,21 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
- rc = file_regcomp(&rx, "%[-0-9\\.]*s", REG_EXTENDED|REG_NOSUB);
|
||||
- if (rc) {
|
||||
- file_regerror(&rx, rc, ms);
|
||||
+ (void)setlocale(LC_CTYPE, "C");
|
||||
+ pattern = zend_string_init("~%[-0-9\\.]*s~", sizeof("~%[-0-9\\.]*s~") - 1, 0);
|
||||
+ if ((pce = pcre_get_compiled_regex(pattern, &capture_count, &re_options)) == NULL) {
|
||||
+ if ((pce = pcre_get_compiled_regex_cache_ex(pattern, 0)) == NULL) {
|
||||
+ rv = -1;
|
||||
} else {
|
||||
- rc = file_regexec(&rx, fmt, 0, 0, 0);
|
||||
- rv = !rc;
|
||||
+ pcre2_match_data *match_data = php_pcre_create_match_data(capture_count, pce);
|
||||
+ pcre2_code *re = php_pcre_pce_re(pce);
|
||||
+ pcre2_match_data *match_data = php_pcre_create_match_data(0, re);
|
||||
+ if (match_data) {
|
||||
+ rv = pcre2_match(pce, (PCRE2_SPTR)fmt, strlen(fmt), 0, re_options, match_data, php_pcre_mctx()) > 0;
|
||||
+ rv = pcre2_match(re, (PCRE2_SPTR)fmt, strlen(fmt), 0, 0, match_data, php_pcre_mctx()) > 0;
|
||||
+ php_pcre_free_match_data(match_data);
|
||||
+ }
|
||||
}
|
||||
- file_regfree(&rx);
|
||||
+ zend_string_release_ex(pattern, 0);
|
||||
+ (void)setlocale(LC_CTYPE, "");
|
||||
+ zend_string_release(pattern);
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -3972,7 +4008,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
static int
|
||||
varexpand(char *buf, size_t len, const struct buffer *b, const char *str)
|
||||
{
|
||||
@@ -743,14 +737,10 @@
|
||||
@@ -743,14 +735,10 @@
|
||||
char *cp;
|
||||
int rval;
|
||||
|
||||
@@ -3989,7 +4025,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
|
||||
if (rval == -1)
|
||||
return -1;
|
||||
@@ -1135,7 +1125,7 @@
|
||||
@@ -1135,7 +1123,7 @@
|
||||
* string by p->s, so we need to deduct sz.
|
||||
* Because we can use one of the bytes of the length
|
||||
* after we shifted as NUL termination.
|
||||
@@ -3998,7 +4034,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
len = sz;
|
||||
}
|
||||
while (len--)
|
||||
@@ -1209,7 +1199,7 @@
|
||||
@@ -1209,7 +1197,7 @@
|
||||
goto out;
|
||||
return 1;
|
||||
case FILE_BEDOUBLE:
|
||||
@@ -4007,7 +4043,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
if (cvt_double(p, m) == -1)
|
||||
goto out;
|
||||
return 1;
|
||||
@@ -1481,8 +1471,6 @@
|
||||
@@ -1481,8 +1469,6 @@
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -4016,7 +4052,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
if (mcopy(ms, p, m->type, m->flag & INDIR, s, (uint32_t)(offset + o),
|
||||
(uint32_t)nbytes, m) == -1)
|
||||
return -1;
|
||||
@@ -1494,9 +1482,6 @@
|
||||
@@ -1494,9 +1480,6 @@
|
||||
m->type, m->flag, offset, o, nbytes,
|
||||
*indir_count, *name_count);
|
||||
mdebug(offset, (char *)(void *)p, sizeof(union VALUETYPE));
|
||||
@@ -4026,7 +4062,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
}
|
||||
|
||||
if (m->flag & INDIR) {
|
||||
@@ -1609,9 +1594,6 @@
|
||||
@@ -1609,9 +1592,6 @@
|
||||
if ((ms->flags & MAGIC_DEBUG) != 0) {
|
||||
mdebug(offset, (char *)(void *)p,
|
||||
sizeof(union VALUETYPE));
|
||||
@@ -4036,7 +4072,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1696,15 +1678,15 @@
|
||||
@@ -1696,15 +1676,15 @@
|
||||
if (rv == 1) {
|
||||
if ((ms->flags & MAGIC_NODESC) == 0 &&
|
||||
file_printf(ms, F(ms, m->desc, "%u"), offset) == -1) {
|
||||
@@ -4055,7 +4091,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
return rv;
|
||||
|
||||
case FILE_USE:
|
||||
@@ -1827,6 +1809,41 @@
|
||||
@@ -1827,6 +1807,41 @@
|
||||
return file_strncmp(a, b, len, flags);
|
||||
}
|
||||
|
||||
@@ -4097,7 +4133,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
private int
|
||||
magiccheck(struct magic_set *ms, struct magic *m)
|
||||
{
|
||||
@@ -1987,65 +2004,77 @@
|
||||
@@ -1987,65 +2002,77 @@
|
||||
break;
|
||||
}
|
||||
case FILE_REGEX: {
|
||||
@@ -4229,7 +4265,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
|
||||
case FILE_INDIRECT:
|
||||
diff -u libmagic.orig/strcasestr.c libmagic/strcasestr.c
|
||||
--- libmagic.orig/strcasestr.c 2014-05-13 18:48:12.000000000 +0200
|
||||
+++ libmagic/strcasestr.c 2018-08-10 11:46:29.214671395 +0200
|
||||
+++ libmagic/strcasestr.c 2019-04-02 11:56:06.853152400 +0200
|
||||
@@ -39,6 +39,8 @@
|
||||
|
||||
#include "file.h"
|
||||
|
||||
@@ -477,11 +477,9 @@ file_replace(struct magic_set *ms, const char *pat, const char *rep)
|
||||
zend_string *repl;
|
||||
size_t rep_cnt = 0;
|
||||
|
||||
(void)setlocale(LC_CTYPE, "C");
|
||||
|
||||
opts |= PCRE2_MULTILINE;
|
||||
convert_libmagic_pattern(&patt, (char*)pat, strlen(pat), opts);
|
||||
if ((pce = pcre_get_compiled_regex_cache(Z_STR(patt))) == NULL) {
|
||||
if ((pce = pcre_get_compiled_regex_cache_ex(Z_STR(patt), 0)) == NULL) {
|
||||
zval_ptr_dtor(&patt);
|
||||
rep_cnt = -1;
|
||||
goto out;
|
||||
@@ -503,7 +501,6 @@ file_replace(struct magic_set *ms, const char *pat, const char *rep)
|
||||
zend_string_release_ex(res, 0);
|
||||
|
||||
out:
|
||||
(void)setlocale(LC_CTYPE, "");
|
||||
return rep_cnt;
|
||||
}
|
||||
|
||||
|
||||
@@ -116,14 +116,24 @@ cdf_app_to_mime(const char *vbuf, const struct nv *nv)
|
||||
{
|
||||
size_t i;
|
||||
const char *rv = NULL;
|
||||
char *vbuf_lower;
|
||||
|
||||
(void)setlocale(LC_CTYPE, "C");
|
||||
for (i = 0; nv[i].pattern != NULL; i++)
|
||||
if (strcasestr(vbuf, nv[i].pattern) != NULL) {
|
||||
vbuf_lower = zend_str_tolower_dup(vbuf, strlen(vbuf));
|
||||
for (i = 0; nv[i].pattern != NULL; i++) {
|
||||
char *pattern_lower;
|
||||
int found;
|
||||
|
||||
pattern_lower = zend_str_tolower_dup(nv[i].pattern, strlen(nv[i].pattern));
|
||||
found = (strstr(vbuf_lower, pattern_lower) != NULL);
|
||||
efree(pattern_lower);
|
||||
|
||||
if (found) {
|
||||
rv = nv[i].mime;
|
||||
break;
|
||||
}
|
||||
(void)setlocale(LC_CTYPE, "");
|
||||
}
|
||||
|
||||
efree(vbuf_lower);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
@@ -422,27 +422,25 @@ flush:
|
||||
private int
|
||||
check_fmt(struct magic_set *ms, const char *fmt)
|
||||
{
|
||||
pcre2_code *pce;
|
||||
uint32_t re_options, capture_count;
|
||||
pcre_cache_entry *pce;
|
||||
int rv = -1;
|
||||
zend_string *pattern;
|
||||
|
||||
if (strchr(fmt, '%') == NULL)
|
||||
return 0;
|
||||
|
||||
(void)setlocale(LC_CTYPE, "C");
|
||||
pattern = zend_string_init("~%[-0-9\\.]*s~", sizeof("~%[-0-9\\.]*s~") - 1, 0);
|
||||
if ((pce = pcre_get_compiled_regex(pattern, &capture_count, &re_options)) == NULL) {
|
||||
if ((pce = pcre_get_compiled_regex_cache_ex(pattern, 0)) == NULL) {
|
||||
rv = -1;
|
||||
} else {
|
||||
pcre2_match_data *match_data = php_pcre_create_match_data(capture_count, pce);
|
||||
pcre2_code *re = php_pcre_pce_re(pce);
|
||||
pcre2_match_data *match_data = php_pcre_create_match_data(0, re);
|
||||
if (match_data) {
|
||||
rv = pcre2_match(pce, (PCRE2_SPTR)fmt, strlen(fmt), 0, re_options, match_data, php_pcre_mctx()) > 0;
|
||||
rv = pcre2_match(re, (PCRE2_SPTR)fmt, strlen(fmt), 0, 0, match_data, php_pcre_mctx()) > 0;
|
||||
php_pcre_free_match_data(match_data);
|
||||
}
|
||||
}
|
||||
zend_string_release_ex(pattern, 0);
|
||||
(void)setlocale(LC_CTYPE, "");
|
||||
zend_string_release(pattern);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #74170 locale information change after mime_content_type
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!class_exists('finfo'))
|
||||
die('skip no fileinfo extension');
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
if (setlocale(LC_CTYPE, 'ru_RU.koi8r') === false)
|
||||
die('skip ru_RU.koi8r locale is not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(setlocale(LC_CTYPE, 'ru_RU.koi8r'));
|
||||
var_dump(nl_langinfo(CODESET));
|
||||
var_dump(mime_content_type(__DIR__ . '/resources/test.ppt'));
|
||||
var_dump(nl_langinfo(CODESET));
|
||||
--EXPECT--
|
||||
string(11) "ru_RU.koi8r"
|
||||
string(6) "KOI8-R"
|
||||
string(29) "application/vnd.ms-powerpoint"
|
||||
string(6) "KOI8-R"
|
||||
@@ -264,6 +264,7 @@ int gdImageConvolution(gdImagePtr src, float filter[3][3], float filter_div, flo
|
||||
for ( y=0; y<src->sy; y++) {
|
||||
for(x=0; x<src->sx; x++) {
|
||||
new_r = new_g = new_b = 0;
|
||||
pxl = f(srcback, x, y);
|
||||
new_a = gdImageAlpha(srcback, pxl);
|
||||
|
||||
for (j=0; j<3; j++) {
|
||||
|
||||
@@ -534,7 +534,7 @@ compress(int init_bits, gdIOCtxPtr outfile, gdImagePtr im, GifCtx *ctx)
|
||||
output( (code_int)ctx->ClearCode, ctx );
|
||||
|
||||
#ifdef SIGNED_COMPARE_SLOW
|
||||
while ( (c = GIFNextPixel( im )) != (unsigned) EOF ) {
|
||||
while ( (c = GIFNextPixel( im, ctx )) != (unsigned) EOF ) {
|
||||
#else /*SIGNED_COMPARE_SLOW*/
|
||||
while ( (c = GIFNextPixel( im, ctx )) != EOF ) { /* } */
|
||||
#endif /*SIGNED_COMPARE_SLOW*/
|
||||
|
||||
@@ -2334,7 +2334,7 @@ int gdTransformAffineGetImage(gdImagePtr *dst,
|
||||
* src_area - Rectangular region to rotate in the src image
|
||||
*
|
||||
* Returns:
|
||||
* GD_TRUE if the affine is rectilinear or GD_FALSE
|
||||
* GD_TRUE on success or GD_FALSE on failure
|
||||
*/
|
||||
int gdTransformAffineCopy(gdImagePtr dst,
|
||||
int dst_x, int dst_y,
|
||||
@@ -2351,7 +2351,7 @@ int gdTransformAffineCopy(gdImagePtr dst,
|
||||
gdPointF pt, src_pt;
|
||||
gdRect bbox;
|
||||
int end_x, end_y;
|
||||
gdInterpolationMethod interpolation_id_bak = GD_DEFAULT;
|
||||
gdInterpolationMethod interpolation_id_bak = src->interpolation_id;
|
||||
interpolation_method interpolation_bak;
|
||||
|
||||
/* These methods use special implementations */
|
||||
@@ -2393,7 +2393,10 @@ int gdTransformAffineCopy(gdImagePtr dst,
|
||||
end_y = bbox.height + (int) fabs(bbox.y);
|
||||
|
||||
/* Get inverse affine to let us work with destination -> source */
|
||||
gdAffineInvert(inv, affine);
|
||||
if (gdAffineInvert(inv, affine) == GD_FALSE) {
|
||||
gdImageSetInterpolationMethod(src, interpolation_id_bak);
|
||||
return GD_FALSE;
|
||||
}
|
||||
|
||||
src_offset_x = src_region->x;
|
||||
src_offset_y = src_region->y;
|
||||
|
||||
@@ -55,7 +55,7 @@ int gdAffineApplyToPointF (gdPointFPtr dst, const gdPointFPtr src,
|
||||
* <gdAffineIdentity>
|
||||
*
|
||||
* Returns:
|
||||
* GD_TRUE if the affine is rectilinear or GD_FALSE
|
||||
* GD_TRUE on success or GD_FALSE on failure
|
||||
*/
|
||||
int gdAffineInvert (double dst[6], const double src[6])
|
||||
{
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
--TEST--
|
||||
Bug #47946 (ImageConvolution overwrites background)
|
||||
--DESCRIPTION--
|
||||
The expected image has black pixel artifacts, what is another issue, though
|
||||
(perhaps #40158).
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.5', '<=')) die('skip upstream fix not yet released');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 396 B After Width: | Height: | Size: 355 B |
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #79067 (gdTransformAffineCopy() may use unitialized values)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$matrix = [1, 1, 1, 1, 1, 1];
|
||||
$src = imagecreatetruecolor(8, 8);
|
||||
var_dump(imageaffine($src, $matrix));
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Bug #79068 (gdTransformAffineCopy() changes interpolation method)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) die('skip gd extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once __DIR__ . '/func.inc';
|
||||
|
||||
$src = imagecreatetruecolor(100, 100);
|
||||
imagefilledrectangle($src, 0, 0, 99, 99, 0xffffff);
|
||||
imageline($src, 10, 10, 90, 90, 0x000000);
|
||||
imagesetinterpolation($src, IMG_BSPLINE);
|
||||
imageaffine($src, [1, 1, 1, 1, 1, 1]);
|
||||
$dst = imagerotate($src, 80, 0xffffff);
|
||||
|
||||
test_image_equals_file(__DIR__ . '/bug79068.png', $dst);
|
||||
?>
|
||||
--EXPECT--
|
||||
The images are equal.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 798 B |
@@ -53,23 +53,23 @@ PHP_FUNCTION( numfmt_format )
|
||||
/* Fetch the object. */
|
||||
FORMATTER_METHOD_FETCH_OBJECT;
|
||||
|
||||
if(type == FORMAT_TYPE_DEFAULT) {
|
||||
if(Z_TYPE_P(number) == IS_STRING) {
|
||||
convert_scalar_to_number_ex(number);
|
||||
}
|
||||
|
||||
if(Z_TYPE_P(number) == IS_LONG) {
|
||||
/* take INT32 on 32-bit, int64 on 64-bit */
|
||||
type = (sizeof(zend_long) == 8)?FORMAT_TYPE_INT64:FORMAT_TYPE_INT32;
|
||||
} else if(Z_TYPE_P(number) == IS_DOUBLE) {
|
||||
type = FORMAT_TYPE_DOUBLE;
|
||||
} else {
|
||||
type = FORMAT_TYPE_INT32;
|
||||
}
|
||||
if(Z_TYPE_P(number) != IS_ARRAY) {
|
||||
convert_scalar_to_number_ex(number);
|
||||
} else {
|
||||
convert_to_long(number);
|
||||
}
|
||||
|
||||
if(Z_TYPE_P(number) != IS_DOUBLE && Z_TYPE_P(number) != IS_LONG) {
|
||||
convert_scalar_to_number(number );
|
||||
if(type == FORMAT_TYPE_DEFAULT) {
|
||||
switch(Z_TYPE_P(number)) {
|
||||
case IS_LONG:
|
||||
/* take INT32 on 32-bit, int64 on 64-bit */
|
||||
type = (sizeof(zend_long) == 8)?FORMAT_TYPE_INT64:FORMAT_TYPE_INT32;
|
||||
break;
|
||||
case IS_DOUBLE:
|
||||
type = FORMAT_TYPE_DOUBLE;
|
||||
break;
|
||||
EMPTY_SWITCH_DEFAULT_CASE();
|
||||
}
|
||||
}
|
||||
|
||||
switch(type) {
|
||||
|
||||
@@ -1285,7 +1285,7 @@ PHP_FUNCTION(locale_filter_matches)
|
||||
if( boolCanonical ){
|
||||
/* canonicalize loc_range */
|
||||
can_loc_range=get_icu_value_internal( loc_range , LOC_CANONICALIZE_TAG , &result , 0);
|
||||
if( result ==0) {
|
||||
if( result <=0) {
|
||||
intl_error_set( NULL, status,
|
||||
"locale_filter_matches : unable to canonicalize loc_range" , 0 );
|
||||
RETURN_FALSE;
|
||||
@@ -1293,7 +1293,7 @@ PHP_FUNCTION(locale_filter_matches)
|
||||
|
||||
/* canonicalize lang_tag */
|
||||
can_lang_tag = get_icu_value_internal( lang_tag , LOC_CANONICALIZE_TAG , &result , 0);
|
||||
if( result ==0) {
|
||||
if( result <=0) {
|
||||
intl_error_set( NULL, status,
|
||||
"locale_filter_matches : unable to canonicalize lang_tag" , 0 );
|
||||
RETURN_FALSE;
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #78804: Segmentation fault in Locale::filterMatches
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
if (Locale::filterMatches('en-US', 'und', true)) {
|
||||
echo 'Matches';
|
||||
} else {
|
||||
echo 'Not matches';
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
Not matches
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #79212 (NumberFormatter::format() may detect wrong type)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl')) die('skip intl extension not available');
|
||||
if (!extension_loaded('gmp')) die('skip gmp extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$fmt = new NumberFormatter('en_US', NumberFormatter::PATTERN_DECIMAL);
|
||||
var_dump($fmt->format(gmp_init('823749273428379492374')));
|
||||
|
||||
$fmt = new NumberFormatter('en_US', NumberFormatter::PATTERN_DECIMAL);
|
||||
var_dump($fmt->format([1], NumberFormatter::TYPE_INT64));
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(21) "823749273428379%c%c%c%c%c%c"
|
||||
string(1) "1"
|
||||
+4
-3
@@ -358,6 +358,10 @@ static void *php_libxml_streams_IO_open_wrapper(const char *filename, const char
|
||||
context = php_stream_context_from_zval(Z_ISUNDEF(LIBXML(stream_context))? NULL : &LIBXML(stream_context), 0);
|
||||
|
||||
ret_val = php_stream_open_wrapper_ex(path_to_open, (char *)mode, REPORT_ERRORS, NULL, context);
|
||||
if (ret_val) {
|
||||
/* Prevent from closing this by fclose() */
|
||||
((php_stream*)ret_val)->flags |= PHP_STREAM_FLAG_NO_FCLOSE;
|
||||
}
|
||||
if (isescaped) {
|
||||
xmlFree(resolved_path);
|
||||
}
|
||||
@@ -381,9 +385,6 @@ static int php_libxml_streams_IO_read(void *context, char *buffer, int len)
|
||||
|
||||
static int php_libxml_streams_IO_write(void *context, const char *buffer, int len)
|
||||
{
|
||||
if (CG(unclean_shutdown)) {
|
||||
return -1;
|
||||
}
|
||||
return php_stream_write((php_stream*)context, buffer, len);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #79191 (Error in SoapClient ctor disables DOMDocument::save())
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('soap')) die('skip soap extension not available');
|
||||
if (!extension_loaded('dom')) die('dom extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
try {
|
||||
new \SoapClient('does-not-exist.wsdl');
|
||||
} catch (Throwable $t) {
|
||||
}
|
||||
|
||||
$dom = new DOMDocument;
|
||||
$dom->loadxml('<?xml version="1.0" ?><root />');
|
||||
var_dump($dom->save(__DIR__ . '/bug79191.xml'));
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
unlink(__DIR__ . '/bug79191.xml');
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(%d)
|
||||
@@ -145,10 +145,10 @@ static unsigned short cp950_pua_tbl[][4] = {
|
||||
static inline int is_in_cp950_pua(int c1, int c) {
|
||||
if ((c1 >= 0xfa && c1 <= 0xfe) || (c1 >= 0x8e && c1 <= 0xa0) ||
|
||||
(c1 >= 0x81 && c1 <= 0x8d) || (c1 >= 0xc7 && c1 <= 0xc8)) {
|
||||
return (c > 0x39 && c < 0x7f) || (c > 0xa0 && c < 0xff);
|
||||
return (c >=0x40 && c <= 0x7e) || (c >= 0xa1 && c <= 0xfe);
|
||||
}
|
||||
if (c1 == 0xc6) {
|
||||
return c > 0xa0 && c < 0xff;
|
||||
return c >= 0xa1 && c <= 0xfe;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3232,18 +3232,18 @@ PHP_FUNCTION(mb_convert_encoding)
|
||||
_from_encodings = NULL;
|
||||
|
||||
ZEND_HASH_FOREACH_VAL(target_hash, hash_entry) {
|
||||
|
||||
convert_to_string_ex(hash_entry);
|
||||
zend_string *encoding_str = zval_get_string(hash_entry);
|
||||
|
||||
if ( _from_encodings) {
|
||||
l = strlen(_from_encodings);
|
||||
n = strlen(Z_STRVAL_P(hash_entry));
|
||||
n = strlen(ZSTR_VAL(encoding_str));
|
||||
_from_encodings = erealloc(_from_encodings, l+n+2);
|
||||
memcpy(_from_encodings + l, ",", 1);
|
||||
memcpy(_from_encodings + l + 1, Z_STRVAL_P(hash_entry), Z_STRLEN_P(hash_entry) + 1);
|
||||
memcpy(_from_encodings + l + 1, ZSTR_VAL(encoding_str), ZSTR_LEN(encoding_str) + 1);
|
||||
} else {
|
||||
_from_encodings = estrdup(Z_STRVAL_P(hash_entry));
|
||||
_from_encodings = estrdup(ZSTR_VAL(encoding_str));
|
||||
}
|
||||
zend_string_release(encoding_str);
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
|
||||
if (_from_encodings != NULL && !strlen(_from_encodings)) {
|
||||
@@ -4850,7 +4850,7 @@ static inline zend_long php_mb_ord(const char* str, size_t str_len, const char*
|
||||
|
||||
no_enc = enc->no_encoding;
|
||||
if (php_mb_is_unsupported_no_encoding(no_enc)) {
|
||||
php_error_docref(NULL, E_WARNING, "Unsupported encoding \"%s\"", enc_name);
|
||||
php_error_docref(NULL, E_WARNING, "Unsupported encoding \"%s\"", enc->name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,33 @@
|
||||
History
|
||||
|
||||
2019/11/29: Version 6.9.4
|
||||
|
||||
2019/11/22: Release Candidate 3 for Version 6.9.4
|
||||
|
||||
2019/11/20: fix a problem found by libFuzzer test
|
||||
2019/11/14: Release Candidate 2 for Version 6.9.4
|
||||
2019/11/12: fix integer overflow by nested quantifier
|
||||
2019/11/11: fix CVE-2019-19012: Integer overflow related to reg->dmax in search_in_range()
|
||||
2019/11/07: fix CVE-2019-19203: heap-buffer-overflow in gb18030_mbc_enc_len()
|
||||
2019/11/06: fix CVE-2019-19204: heap-buffer-overflow in fetch_interval_quantifier()
|
||||
2019/11/06: add HAVE_INTTYPES_H into config.h.windows.in and config.h.win{32,64}
|
||||
2019/11/06: add HAVE_STDINT_H into config.h.win{32,64}
|
||||
2019/11/05: Release Candidate 1 for Version 6.9.4
|
||||
2019/10/31: Update Unicode Emoji version to 12.1 (Nothing data changed)
|
||||
2019/10/29: implement USE_REPEAT_AND_EMPTY_CHECK_LOCAL_VAR configuration
|
||||
2019/10/18: re-implement case fold conversion
|
||||
2019/10/04: fix #156: Heap buffer overflow in match_at() with case-insensitive match
|
||||
2019/09/30: NEW API: add onig_regset_replace()
|
||||
2019/09/30: change Unicode VERSION value format
|
||||
2019/09/20: NEW API: add regset functions
|
||||
2019/09/20: add data ensure check before peek string value in OP_PUSH_IF_PEEK_NEXT
|
||||
2019/09/20: fix loose code in encode-harness.c
|
||||
2019/08/13: fix heap-buffer-overflow
|
||||
2019/08/13: Add a macro to disable direct threading in the match engine (PR#149)
|
||||
|
||||
2019/08/06: Version 6.9.3 (secirity fix release)
|
||||
|
||||
2019/07/30: add ONIG_SYN_ALLOW_INVALID_CODE_END_OF_RANGE
|
||||
2019/07/30: add ONIG_SYN_ALLOW_INVALID_CODE_END_OF_RANGE_IN_CC
|
||||
2019/07/29: add STK_PREC_READ_START/END stack type
|
||||
2019/07/29: Fix #147: Stack Exhaustion Problem caused by some parsing functions
|
||||
2019/07/11: add a dictionary file for libfuzzer
|
||||
|
||||
@@ -27,25 +27,34 @@ Supported character encodings:
|
||||
* doc/SYNTAX.md: contributed by seanofw
|
||||
|
||||
|
||||
Version 6.9.4
|
||||
-------------
|
||||
|
||||
* NEW API: RegSet (set of regexes)
|
||||
* Fixed CVE-2019-19012
|
||||
* Fixed CVE-2019-19203 (Does not affect UTF-8, UTF-16 and UTF-32 encodings)
|
||||
* Fixed CVE-2019-19204 (Affects only PosixBasic, Emacs and Grep syntaxes)
|
||||
* Fixed CVE-2019-19246
|
||||
* Fixed some problems (found by libFuzzer test)
|
||||
|
||||
|
||||
Version 6.9.3 (security fix release)
|
||||
------------------------------------
|
||||
|
||||
* Fixed CVE-2019-13224
|
||||
* Fixed CVE-2019-13225
|
||||
* Fixed many problems (found by libfuzzer programs)
|
||||
* Fixed CVE-2019-16163
|
||||
* Fixed many problems (found by libFuzzer test)
|
||||
|
||||
|
||||
Version 6.9.2 (Reiwa)
|
||||
---------------------
|
||||
|
||||
* add doc/SYNTAX.md
|
||||
* Direct threaded code (for GCC and Clang)
|
||||
* Update Unicode version 12.1.0
|
||||
* NEW: Unicode Text Segment mode option (?y{g}) (?y{w}) (*original)
|
||||
|
||||
g: Extended Grapheme Cluster mode / w: Word mode
|
||||
|
||||
(Unicode Standard Annex #29 [http://unicode.org/reports/tr29/])
|
||||
|
||||
|
||||
Version 6.9.1
|
||||
-------------
|
||||
@@ -118,7 +127,7 @@ Version 6.5.0
|
||||
* NEW: \O (true anychar)
|
||||
* NEW: if-then-else (?(...)...\|...)
|
||||
* NEW: Backreference validity checker (?(xxx)) (*original)
|
||||
* NEW: Absent repeater (?~absent) \[is equal to (?\~\|absent|\O*)]
|
||||
* NEW: Absent repeater (?~absent) \[is equal to (?\~\|(?:absent)|\O*)]
|
||||
* NEW: Absent expression (?~|absent|expr) (*original)
|
||||
* NEW: Absent stopper (?~|absent) (*original)
|
||||
|
||||
@@ -244,15 +253,18 @@ Sample Programs
|
||||
|
||||
|File |Description |
|
||||
|:---------------------|:-----------------------------------------|
|
||||
|sample/callout.c |example of callouts |
|
||||
|sample/count.c |example of built-in callout *COUNT |
|
||||
|sample/echo.c |example of user defined callouts of name |
|
||||
|sample/encode.c |example of some encodings |
|
||||
|sample/listcap.c |example of the capture history |
|
||||
|sample/names.c |example of the named group callback |
|
||||
|sample/posix.c |POSIX API sample |
|
||||
|sample/regset.c |example of using RegSet API |
|
||||
|sample/scan.c |example of using onig_scan() |
|
||||
|sample/simple.c |example of the minimum (Oniguruma API) |
|
||||
|sample/names.c |example of the named group callback. |
|
||||
|sample/encode.c |example of some encodings. |
|
||||
|sample/listcap.c |example of the capture history. |
|
||||
|sample/posix.c |POSIX API sample. |
|
||||
|sample/scan.c |example of using onig_scan(). |
|
||||
|sample/sql.c |example of the variable meta characters. |
|
||||
|sample/user_property.c|example of user defined Unicode property. |
|
||||
|sample/callout.c |example of callouts. |
|
||||
|sample/sql.c |example of the variable meta characters |
|
||||
|sample/user_property.c|example of user defined Unicode property |
|
||||
|
||||
|
||||
Test Programs
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Oniguruma API Version 6.9.3 2019/07/06
|
||||
Oniguruma API Version 6.9.4 2019/09/30
|
||||
|
||||
#include <oniguruma.h>
|
||||
|
||||
@@ -168,7 +168,7 @@ Oniguruma API Version 6.9.3 2019/07/06
|
||||
# int onig_new_deluxe(regex_t** reg, const UChar* pattern, const UChar* pattern_end,
|
||||
OnigCompileInfo* ci, OnigErrorInfo* einfo)
|
||||
|
||||
This function is deprecate, and it does not allow the case where
|
||||
This function is deprecated, and it does not allow the case where
|
||||
the encoding of pattern and target is different.
|
||||
|
||||
Create a regex object.
|
||||
@@ -306,6 +306,7 @@ Oniguruma API Version 6.9.3 2019/07/06
|
||||
|
||||
normal return: match position offset (i.e. p - str >= 0)
|
||||
not found: ONIG_MISMATCH (< 0)
|
||||
error: error code (< 0)
|
||||
|
||||
arguments
|
||||
1 reg: regex object
|
||||
@@ -342,7 +343,8 @@ Oniguruma API Version 6.9.3 2019/07/06
|
||||
Do not pass invalid byte string in the regex character encoding.
|
||||
|
||||
normal return: match length (>= 0)
|
||||
not match: ONIG_MISMATCH ( < 0)
|
||||
not match: ONIG_MISMATCH (< 0)
|
||||
error: error code (< 0)
|
||||
|
||||
arguments
|
||||
1 reg: regex object
|
||||
@@ -391,6 +393,136 @@ Oniguruma API Version 6.9.3 2019/07/06
|
||||
7 callback_arg: optional argument passed to callback
|
||||
|
||||
|
||||
# int onig_regset_new(OnigRegSet** rset, int n, regex_t* regs[])
|
||||
|
||||
Create a regset object.
|
||||
All regex objects must have the same character encoding.
|
||||
All regex objects are prohibited from having the ONIG_OPTION_FIND_LONGEST option.
|
||||
|
||||
arguments
|
||||
1 rset: return address of regset object
|
||||
2 n: number of regex in regs
|
||||
3 regs: array of regex
|
||||
|
||||
normal return: ONIG_NORMAL
|
||||
|
||||
|
||||
# int onig_regset_add(OnigRegSet* set, regex_t* reg)
|
||||
|
||||
Add a regex into regset.
|
||||
The regex object must have the same character encoding with the regset.
|
||||
The regex object is prohibited from having the ONIG_OPTION_FIND_LONGEST option.
|
||||
|
||||
arguments
|
||||
1 set: regset object
|
||||
2 reg: regex object
|
||||
|
||||
normal return: ONIG_NORMAL
|
||||
|
||||
|
||||
# int onig_regset_replace(OnigRegSet* set, int at, regex_t* reg)
|
||||
|
||||
Replace a regex in regset with another one.
|
||||
If the reg argument value is NULL, then remove at-th regex. (and indexes of other regexes are changed)
|
||||
|
||||
arguments
|
||||
1 set: regset object
|
||||
2 at: index of regex (zero origin)
|
||||
3 reg: regex object
|
||||
|
||||
normal return: ONIG_NORMAL
|
||||
|
||||
|
||||
# void onig_regset_free(OnigRegSet* set)
|
||||
|
||||
Free memory used by regset object and regex objects in the regset.
|
||||
If the same regex object is registered twice, the situation becomes destructive.
|
||||
|
||||
arguments
|
||||
1 set: regset object
|
||||
|
||||
|
||||
# int onig_regset_number_of_regex(OnigRegSet* set)
|
||||
|
||||
Returns number of regex objects in the regset.
|
||||
|
||||
arguments
|
||||
1 set: regset object
|
||||
|
||||
|
||||
# regex_t* onig_regset_get_regex(OnigRegSet* set, int at)
|
||||
|
||||
Returns the regex object corresponding to the at-th regex.
|
||||
|
||||
arguments
|
||||
1 set: regset object
|
||||
2 at: index of regex array (zero origin)
|
||||
|
||||
|
||||
# OnigRegion* onig_regset_get_region(OnigRegSet* set, int at)
|
||||
|
||||
Returns the region object corresponding to the at-th regex.
|
||||
|
||||
arguments
|
||||
1 set: regset object
|
||||
2 at: index of regex array (zero origin)
|
||||
|
||||
|
||||
# int onig_regset_search(OnigRegSet* set, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegSetLead lead, OnigOptionType option, int* rmatch_pos)
|
||||
|
||||
Perform a search with regset.
|
||||
|
||||
return value:
|
||||
normal return: index of match regex (zero origin)
|
||||
not found: ONIG_MISMATCH (< 0)
|
||||
error: error code (< 0)
|
||||
|
||||
arguments
|
||||
1 set: regset object
|
||||
2 str: target string
|
||||
3 end: terminate address of target string
|
||||
4 start: search start address of target string
|
||||
5 range: search terminate address of target string
|
||||
6 lead: outer loop element
|
||||
ONIG_REGSET_POSITION_LEAD (returns most left position)
|
||||
ONIG_REGSET_REGEX_LEAD (returns most left position)
|
||||
ONIG_REGSET_PRIORITY_TO_REGEX_ORDER (returns first match regex)
|
||||
7 option: search time option
|
||||
ONIG_OPTION_NOTBOL string head(str) isn't considered as begin of line
|
||||
ONIG_OPTION_NOTEOL string end (end) isn't considered as end of line
|
||||
8 rmatch_pos: return address of match position (match_address - str)
|
||||
|
||||
* ONIG_REGSET_POSITION_LEAD and ONIG_REGSET_REGEX_LEAD return the same result.
|
||||
These differences only appear in search time.
|
||||
In most cases, ONIG_REGSET_POSITION_LEAD seems to be faster.
|
||||
|
||||
|
||||
# int onig_regset_search_with_param(OnigRegSet* set, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegSetLead lead, OnigOptionType option, OnigMatchParam* mps[], int* rmatch_pos)
|
||||
|
||||
Perform a search with regset and match-params.
|
||||
|
||||
return value:
|
||||
normal return: index of match regex (zero origin)
|
||||
not found: ONIG_MISMATCH (< 0)
|
||||
error: error code (< 0)
|
||||
|
||||
arguments
|
||||
1 set: regset object
|
||||
2 str: target string
|
||||
3 end: terminate address of target string
|
||||
4 start: search start address of target string
|
||||
5 range: search terminate address of target string
|
||||
6 lead: outer loop element
|
||||
ONIG_REGSET_POSITION_LEAD (returns most left position)
|
||||
ONIG_REGSET_REGEX_LEAD (returns most left position)
|
||||
ONIG_REGSET_PRIORITY_TO_REGEX_ORDER (returns first match regex)
|
||||
7 option: search time option
|
||||
ONIG_OPTION_NOTBOL string head(str) isn't considered as begin of line
|
||||
ONIG_OPTION_NOTEOL string end (end) isn't considered as end of line
|
||||
8 mps: array of match-params
|
||||
9 rmatch_pos: return address of match position (match_address - str)
|
||||
|
||||
|
||||
# OnigRegion* onig_region_new(void)
|
||||
|
||||
Create a region.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
鬼車インターフェース Version 6.9.3 2019/07/06
|
||||
鬼車インターフェース Version 6.9.4 2019/09/30
|
||||
|
||||
#include <oniguruma.h>
|
||||
|
||||
@@ -390,6 +390,138 @@
|
||||
7 callback_arg: コールバック関数に渡される付加引数値
|
||||
|
||||
|
||||
# int onig_regset_new(OnigRegSet** rset, int n, regex_t* regs[])
|
||||
|
||||
regsetオブジェクトを生成する。
|
||||
全ての正規表現オブジェクトは、同じ文字エンコーディングでなければならない。
|
||||
全ての正規表現オブジェクトは、ONIG_OPTION_FIND_LONGESTオプションでコンパイルされていてはならない。
|
||||
|
||||
引数
|
||||
1 rset: regsetオブジェクトを返すためのアドレス
|
||||
2 n: 正規表現の個数
|
||||
3 regs: 正規表現オブジェクトの配列
|
||||
|
||||
正常終了戻り値: ONIG_NORMAL
|
||||
|
||||
|
||||
# int onig_regset_add(OnigRegSet* set, regex_t* reg)
|
||||
|
||||
regsetオブジェクトに正規表現を追加する。
|
||||
正規表現オブジェクトは、regsetと同じ文字エンコーディングでなければならない。
|
||||
正規表現オブジェクトは、ONIG_OPTION_FIND_LONGESTオプションでコンパイルされていてはならない。
|
||||
|
||||
引数
|
||||
1 set: regsetオブジェクト
|
||||
2 reg: 正規表現オブジェクト
|
||||
|
||||
正常終了戻り値: ONIG_NORMAL
|
||||
|
||||
|
||||
# int onig_regset_replace(OnigRegSet* set, int at, regex_t* reg)
|
||||
|
||||
regsetの中の一個の正規表現オブジェクトを別のものに変更する。
|
||||
若しreg引数の値がNULLであれば、at番目の正規表現オブジェクトを外す。(そして、以降の正規表現オブジェクトのインデックスは変化する)
|
||||
|
||||
引数
|
||||
1 set: regsetオブジェクト
|
||||
2 at: 変更する場所のインデックス
|
||||
2 reg: 正規表現オブジェクト
|
||||
|
||||
正常終了戻り値: ONIG_NORMAL
|
||||
|
||||
|
||||
# void onig_regset_free(OnigRegSet* set)
|
||||
|
||||
regsetオブジェクトとその中の正規表現オブジェクトの使用メモリを開放する。
|
||||
若し、同一の正規表現オブジェクトを重複して登録していれば、破壊的な状況になる。
|
||||
|
||||
引数
|
||||
1 set: regsetオブジェクト
|
||||
|
||||
|
||||
# int onig_regset_number_of_regex(OnigRegSet* set)
|
||||
|
||||
regsetの中の正規表現オブジェクトの個数を返す。
|
||||
|
||||
引数
|
||||
1 set: regsetオブジェクト
|
||||
|
||||
|
||||
# regex_t* onig_regset_get_regex(OnigRegSet* set, int at)
|
||||
|
||||
regsetのat番目の正規表現を返す。
|
||||
|
||||
引数
|
||||
1 set: regsetオブジェクト
|
||||
2 at: 正規表現オブジェクトのインデックス (ゼロ開始)
|
||||
|
||||
|
||||
# OnigRegion* onig_regset_get_region(OnigRegSet* set, int at)
|
||||
|
||||
regsetのat番目の正規表現に対応する領域を返す。
|
||||
|
||||
引数
|
||||
1 set: regsetオブジェクト
|
||||
2 at: 正規表現オブジェクトのインデックス (ゼロ開始)
|
||||
|
||||
|
||||
# int onig_regset_search(OnigRegSet* set, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegSetLead lead, OnigOptionType option, int* rmatch_pos)
|
||||
|
||||
regsetによる検索を実行する。
|
||||
|
||||
戻り値:
|
||||
検索成功: マッチした正規表現オブジェクトのインデックス (ゼロ開始)
|
||||
検索失敗: ONIG_MISMATCH (< 0)
|
||||
エラー: エラーコード (< 0)
|
||||
|
||||
引数
|
||||
1 set: regsetオブジェクト
|
||||
2 str: 検索対象文字列
|
||||
3 end: 検索対象文字列の終端アドレス
|
||||
4 start: 検索対象文字列の検索先頭位置アドレス
|
||||
5 range: 検索対象文字列の検索終了位置アドレス
|
||||
(start <= 探索される文字列 < range)
|
||||
6 lead: 外側のループ要素
|
||||
ONIG_REGSET_POSITION_LEAD (最左位置でマッチした結果を返す)
|
||||
ONIG_REGSET_REGEX_LEAD (最左位置でマッチした結果を返す)
|
||||
ONIG_REGSET_PRIORITY_TO_REGEX_ORDER (最初にマッチした正規表現の結果を返す)
|
||||
7 option: 検索時オプション
|
||||
ONIG_OPTION_NOTBOL 文字列の先頭(str)を行頭と看做さない
|
||||
ONIG_OPTION_NOTEOL 文字列の終端(end)を行末と看做さない
|
||||
8 rmatch_pos: マッチした位置を返すためのアドレス (match_address - str)
|
||||
|
||||
* ONIG_REGSET_POSITION_LEADとONIG_REGSET_REGEX_LEADは同じ結果を返す。
|
||||
これらの違いは検索時間にしか現れない。
|
||||
ほとんどの場合、ONIG_REGSET_POSITION_LEADのほうが速いと思われる。
|
||||
|
||||
|
||||
# int onig_regset_search_with_param(OnigRegSet* set, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range, OnigRegSetLead lead, OnigOptionType option, OnigMatchParam* mps[], int* rmatch_pos)
|
||||
|
||||
regsetとOnigMatchParamオブジェクトによる検索を実行する。
|
||||
|
||||
戻り値:
|
||||
検索成功: マッチした正規表現オブジェクトのインデックス (ゼロ開始)
|
||||
検索失敗: ONIG_MISMATCH (< 0)
|
||||
エラー: エラーコード (< 0)
|
||||
|
||||
引数
|
||||
1 set: regsetオブジェクト
|
||||
2 str: 検索対象文字列
|
||||
3 end: 検索対象文字列の終端アドレス
|
||||
4 start: 検索対象文字列の検索先頭位置アドレス
|
||||
5 range: 検索対象文字列の検索終了位置アドレス
|
||||
(start <= 探索される文字列 < range)
|
||||
6 lead: 外側のループ要素
|
||||
ONIG_REGSET_POSITION_LEAD (最左位置でマッチした結果を返す)
|
||||
ONIG_REGSET_REGEX_LEAD (最左位置でマッチした結果を返す)
|
||||
ONIG_REGSET_PRIORITY_TO_REGEX_ORDER (最初にマッチした正規表現の結果を返す)
|
||||
7 option: 検索時オプション
|
||||
ONIG_OPTION_NOTBOL 文字列の先頭(str)を行頭と看做さない
|
||||
ONIG_OPTION_NOTEOL 文字列の終端(end)を行末と看做さない
|
||||
8 mps: OnigMatchParamオブジェクトの配列
|
||||
9 rmatch_pos: マッチした位置を返すためのアドレス (match_address - str)
|
||||
|
||||
|
||||
# OnigRegion* onig_region_new(void)
|
||||
|
||||
マッチ領域情報(region)を作成する。
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Oniguruma Regular Expressions Version 6.9.2 2019/03/29
|
||||
Oniguruma Regular Expressions Version 6.9.4 2019/10/31
|
||||
|
||||
syntax: ONIG_SYNTAX_ONIGURUMA (default)
|
||||
|
||||
@@ -289,6 +289,11 @@ syntax: ONIG_SYNTAX_ONIGURUMA (default)
|
||||
In negative look-behind, capturing group isn't allowed,
|
||||
but non-capturing group (?:) is allowed.
|
||||
|
||||
* In look-behind and negative look-behind, support for
|
||||
ignore-case option is limited. Only supports conversion
|
||||
between single characters. (Does not support conversion
|
||||
of multiple characters in Unicode)
|
||||
|
||||
(?>subexp) atomic group
|
||||
no backtracks in subexp.
|
||||
|
||||
@@ -338,7 +343,7 @@ syntax: ONIG_SYNTAX_ONIGURUMA (default)
|
||||
This works like .* (more precisely \O*), but it is
|
||||
limited by the range that does not include the string
|
||||
match with <absent>.
|
||||
This is a written abbreviation of (?~|absent|\O*).
|
||||
This is a written abbreviation of (?~|(?:absent)|\O*).
|
||||
\O* is used as a repeater.
|
||||
|
||||
(?~|absent|exp) Absent expression (* original)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
鬼車 正規表現 Version 6.9.2 2019/03/29
|
||||
鬼車 正規表現 Version 6.9.4 2019/10/31
|
||||
|
||||
使用文法: ONIG_SYNTAX_ONIGURUMA (既定値)
|
||||
|
||||
@@ -21,10 +21,10 @@
|
||||
\f 改頁 (0x0C)
|
||||
\a 鐘 (0x07)
|
||||
\e 退避修飾 (0x1B)
|
||||
\nnn 八進数表現 符号化バイト値(の一部)
|
||||
\nnn 八進数表現 符号化バイト値
|
||||
\o{17777777777} 拡張八進数表現 コードポイント値
|
||||
\uHHHH 拡張十六進数表現 コードポイント値
|
||||
\xHH 十六進数表現 符号化バイト値(の一部)
|
||||
\xHH 十六進数表現 符号化バイト値
|
||||
\x{7HHHHHHH} 拡張十六進数表現 コードポイント値
|
||||
\cx 制御文字表現 コードポイント値
|
||||
\C-x 制御文字表現 コードポイント値
|
||||
@@ -284,6 +284,10 @@
|
||||
否定戻り読みでは、捕獲式集合は許されないが、
|
||||
非捕獲式集合は許される。
|
||||
|
||||
* 戻り読み、否定戻り読みの中では、ignore-caseオプションの
|
||||
対応が制限される。一文字と一文字の間の変換しか対応しない。
|
||||
(Unicodeでの複数文字の変換に対応しない)
|
||||
|
||||
(?>式) 原子的式集合
|
||||
式全体を通過したとき、式の中での後退再試行を行なわない
|
||||
|
||||
@@ -334,20 +338,20 @@
|
||||
|
||||
<不在機能群>
|
||||
|
||||
(?~不在式) 不在繰り返し (*原案 田中哲)
|
||||
これは .*(より正確には\O*)のように動作するが、<不在式>に
|
||||
(?~不在) 不在繰り返し (*原案 田中哲)
|
||||
これは .*(より正確には\O*)のように動作するが、<不在>に
|
||||
適合する文字列を含まない範囲に制限される。
|
||||
これは(?~|不在式|\O*)の省略表記である。
|
||||
これは(?~|(?:不在)|\O*)の省略表記である。
|
||||
|
||||
(?~|不在式|式) 不在式 (* 原作)
|
||||
これは<式>のように動作するが、<不在式>に適合する文字列を
|
||||
(?~|不在|式) 不在式 (* 原作)
|
||||
これは<式>のように動作するが、<不在>に適合する文字列を
|
||||
含まない範囲に制限される。
|
||||
|
||||
例 (?~|345|\d*) "12345678" ==> "12", "1", ""
|
||||
|
||||
(?~|不在式) 不在停止 (* 原作)
|
||||
(?~|不在) 不在停止 (* 原作)
|
||||
この演算子を通過した後は、対象文字列の適合範囲が
|
||||
<不在式>に適合する文字列を含まない範囲に制限される。
|
||||
<不在>に適合する文字列を含まない範囲に制限される。
|
||||
|
||||
(?~|) 範囲消去
|
||||
不在停止の効果を消して、それ以前の状態にする。
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
# Oniguruma syntax (operator) configuration
|
||||
|
||||
_Documented for Oniguruma 6.9.2 (2019/03/28)_
|
||||
_Documented for Oniguruma 6.9.3 (2019/08/08)_
|
||||
|
||||
|
||||
----------
|
||||
@@ -960,6 +960,12 @@ _Set in: Ruby, Oniguruma_
|
||||
If this flag is set, Oniguruma will warn about nested repeat operators those have no meaning, like `(?:a*)+`.
|
||||
If this flag is clear, Oniguruma will allow the nested repeat operators without warning about them.
|
||||
|
||||
### 26. ONIG_SYN_ALLOW_INVALID_CODE_END_OF_RANGE_IN_CC (allow [a-\x{7fffffff}])
|
||||
|
||||
_Set in: Oniguruma_
|
||||
|
||||
If this flag is set, then invalid code points at the end of range in character class are allowed.
|
||||
|
||||
### 31. ONIG_SYN_CONTEXT_INDEP_ANCHORS
|
||||
|
||||
_Set in: PosixExtended, GnuRegex, Java, Perl, Perl_NG, Ruby, Oniguruma_
|
||||
@@ -1066,4 +1072,5 @@ These tables show which of the built-in syntaxes use which flags and options, fo
|
||||
| 23 | `ONIG_SYN_ALLOW_DOUBLE_RANGE_OP_IN_CC` | - | Yes | - | - | Yes | Yes | Yes | Yes | Yes | Yes |
|
||||
| 24 | `ONIG_SYN_WARN_CC_OP_NOT_ESCAPED` | - | - | - | - | - | - | - | - | Yes | Yes |
|
||||
| 25 | `ONIG_SYN_WARN_REDUNDANT_NESTED_REPEAT` | - | - | - | - | - | - | - | - | Yes | Yes |
|
||||
| 26 | `ONIG_SYN_ALLOW_INVALID_CODE_END_OF_RANGE_IN_CC` | - | - | - | - | - | - | - | - | - | Yes |
|
||||
| 31 | `ONIG_SYN_CONTEXT_INDEP_ANCHORS` | - | Yes | - | - | Yes | Yes | Yes | Yes | Yes | Yes |
|
||||
@@ -1,4 +1,4 @@
|
||||
Unicode Properties (from Unicode Version: 12.1.0)
|
||||
Unicode Properties (Unicode Version: 12.1.0, Emoji: 12.1)
|
||||
|
||||
15: ASCII_Hex_Digit
|
||||
16: Adlam
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
ascii.c - Oniguruma (regular expression library)
|
||||
**********************************************************************/
|
||||
/*-
|
||||
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
||||
* Copyright (c) 2002-2019 K.Kosako
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
||||
Loaded 100 of 277 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user