mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-11 19:20:50 +00:00
Compare commits
495
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
038c63cdea | ||
|
|
c666a67a98 | ||
|
|
bf76af30c7 | ||
|
|
9f4b5c1a94 | ||
|
|
9b942229de | ||
|
|
9696385481 | ||
|
|
6328074de3 | ||
|
|
4b8394dd78 | ||
|
|
2721a01486 | ||
|
|
56839f5a76 | ||
|
|
f3c1863aa2 | ||
|
|
366f9505a4 | ||
|
|
8285f90d1d | ||
|
|
0402f05ba3 | ||
|
|
53bfb6618d | ||
|
|
4531d2c591 | ||
|
|
817513af4e | ||
|
|
c85f569e52 | ||
|
|
4c55669caa | ||
|
|
cfe977a406 | ||
|
|
05345f5ad4 | ||
|
|
baf7ad1555 | ||
|
|
a21b0942fa | ||
|
|
1d79011fb9 | ||
|
|
eb4ce3f1a8 | ||
|
|
42c8f5e91d | ||
|
|
8d217db369 | ||
|
|
8f9af36da3 | ||
|
|
916f10ac31 | ||
|
|
512498d083 | ||
|
|
b715845650 | ||
|
|
361b5814de | ||
|
|
2f47e9872e | ||
|
|
40702799b5 | ||
|
|
4e01269082 | ||
|
|
a4648ded43 | ||
|
|
a917840f38 | ||
|
|
6a4c02e107 | ||
|
|
0a1a4dc033 | ||
|
|
a3e1952700 | ||
|
|
9e44b6a61e | ||
|
|
860ef0e2d7 | ||
|
|
38e16154dd | ||
|
|
c537039fcb | ||
|
|
e61bb3fbf9 | ||
|
|
1b4e224c98 | ||
|
|
9374977d21 | ||
|
|
940c68b55d | ||
|
|
c7c3b967a5 | ||
|
|
96fe1dfe53 | ||
|
|
ef9ddd0d82 | ||
|
|
57be57ac94 | ||
|
|
707e1c4710 | ||
|
|
714f28d8e4 | ||
|
|
e8f1c29cc9 | ||
|
|
838e4039d7 | ||
|
|
66d1d10917 | ||
|
|
90a26a4844 | ||
|
|
071616026f | ||
|
|
8161230505 | ||
|
|
3d3782c328 | ||
|
|
94f3887152 | ||
|
|
71e468e141 | ||
|
|
e048b3fc6b | ||
|
|
1e042ae4a7 | ||
|
|
56bf10f0bd | ||
|
|
9a31d70845 | ||
|
|
02e85045dc | ||
|
|
6a35e3b383 | ||
|
|
7dc5bc5063 | ||
|
|
07b33992a2 | ||
|
|
4171a8f6c6 | ||
|
|
a9026070b6 | ||
|
|
b101a6bbd4 | ||
|
|
e0691d27d5 | ||
|
|
82d58e6cbc | ||
|
|
95ad414658 | ||
|
|
e4a48ab6b3 | ||
|
|
915a00cd8b | ||
|
|
8f7e98ac4a | ||
|
|
1358743f9c | ||
|
|
778e5f3da5 | ||
|
|
050e21beed | ||
|
|
57eecd4e29 | ||
|
|
157d0372e0 | ||
|
|
04407b79df | ||
|
|
fd3ece8578 | ||
|
|
7a5c7e00cd | ||
|
|
66398757fc | ||
|
|
d403a91c6f | ||
|
|
410eacc1a9 | ||
|
|
b5adfee320 | ||
|
|
5c5209d676 | ||
|
|
798d168d73 | ||
|
|
37f3425263 | ||
|
|
a19f511345 | ||
|
|
c096a281be | ||
|
|
e4ad9ed8ad | ||
|
|
e2e39f3bfc | ||
|
|
29b615cfcf | ||
|
|
7c1ddcc67f | ||
|
|
91adffb4d1 | ||
|
|
7d5dbaed76 | ||
|
|
6f9819db38 | ||
|
|
8ba6fea7b1 | ||
|
|
4c379392b2 | ||
|
|
f444c7619e | ||
|
|
3d487fb8d1 | ||
|
|
e4238f4bf5 | ||
|
|
906670b817 | ||
|
|
24f21a3012 | ||
|
|
843341954e | ||
|
|
05f00e5060 | ||
|
|
6d933b463e | ||
|
|
b3458eddfd | ||
|
|
5a319a02d8 | ||
|
|
af1ac753fe | ||
|
|
42789e2b8a | ||
|
|
4b16082e94 | ||
|
|
38b68fc042 | ||
|
|
56e7903131 | ||
|
|
25abf2f028 | ||
|
|
00ed55005a | ||
|
|
0d84097d44 | ||
|
|
08080c18f5 | ||
|
|
c60d4b9770 | ||
|
|
84fd8ffa2a | ||
|
|
f248309b74 | ||
|
|
943b23dcf6 | ||
|
|
0adbf6de77 | ||
|
|
84b997020e | ||
|
|
adb9522767 | ||
|
|
10800b8ca2 | ||
|
|
c47b49c9b5 | ||
|
|
3427c122bf | ||
|
|
e26b605c21 | ||
|
|
a11805a4d9 | ||
|
|
c0ce2281bc | ||
|
|
908f67b1d4 | ||
|
|
0495bf5650 | ||
|
|
920c088082 | ||
|
|
7c981192eb | ||
|
|
250430acdc | ||
|
|
6ac12f1337 | ||
|
|
e48988311d | ||
|
|
03a43d50e1 | ||
|
|
713ad54fec | ||
|
|
2ea924fffc | ||
|
|
aa8cac578e | ||
|
|
559ede17e1 | ||
|
|
1d5744027e | ||
|
|
311eb2b11e | ||
|
|
7ac24aa661 | ||
|
|
3ae3341533 | ||
|
|
5b9267c4c0 | ||
|
|
a154410597 | ||
|
|
a90ce6de31 | ||
|
|
9ddfd49063 | ||
|
|
8da5752311 | ||
|
|
337fd3ad64 | ||
|
|
1745ead668 | ||
|
|
4173a667fa | ||
|
|
3d6dd2a27b | ||
|
|
59424bb7bd | ||
|
|
2fabcbfedb | ||
|
|
e322fb0015 | ||
|
|
2f62ad16a4 | ||
|
|
91bad929aa | ||
|
|
ed4b887cf6 | ||
|
|
00e3b7614e | ||
|
|
1b27754888 | ||
|
|
25c5d185fc | ||
|
|
5df6f9f20e | ||
|
|
e6e77d9e27 | ||
|
|
4424cbf757 | ||
|
|
1f65006fce | ||
|
|
9397f52724 | ||
|
|
5af61aa1cc | ||
|
|
58fbe7a838 | ||
|
|
e9a8d7ff1d | ||
|
|
8907da99b8 | ||
|
|
a347b0be48 | ||
|
|
b0f472b3b2 | ||
|
|
6cb6c04499 | ||
|
|
99dd7ee80b | ||
|
|
0e91e5fb90 | ||
|
|
2de8915dea | ||
|
|
071247713f | ||
|
|
f96175750a | ||
|
|
4a7e83f54a | ||
|
|
0394c04144 | ||
|
|
9376e8213c | ||
|
|
1b6873b4e6 | ||
|
|
d6f39a1011 | ||
|
|
3cdbe347ae | ||
|
|
05738eb71a | ||
|
|
73a92964ff | ||
|
|
2bae178b35 | ||
|
|
0134de7cff | ||
|
|
00865ae22f | ||
|
|
541631253a | ||
|
|
7be30eb78c | ||
|
|
d10ee1eef1 | ||
|
|
80d9dcafe0 | ||
|
|
569763cb1a | ||
|
|
d978e92d3d | ||
|
|
e637ead6ed | ||
|
|
e6b46dc2ff | ||
|
|
fd545f4f44 | ||
|
|
3e0b2ba5d8 | ||
|
|
31b4581c45 | ||
|
|
91fb1edbbf | ||
|
|
e6759644ec | ||
|
|
5a8bcf73ba | ||
|
|
a8bd182ccd | ||
|
|
818bffc534 | ||
|
|
9642710a09 | ||
|
|
1c72e5b299 | ||
|
|
c1189eccae | ||
|
|
532912d8ab | ||
|
|
d6b78a3511 | ||
|
|
7e9f416218 | ||
|
|
f8bf1f33a5 | ||
|
|
801e46d8c0 | ||
|
|
6313e16a04 | ||
|
|
8c51578c81 | ||
|
|
b9845e5006 | ||
|
|
45c5e27183 | ||
|
|
51ccc88b87 | ||
|
|
397be4ff54 | ||
|
|
a2b85ddecf | ||
|
|
1b16c2f41c | ||
|
|
ab17840d33 | ||
|
|
eada2aa91a | ||
|
|
31d93fcf4b | ||
|
|
c6961cb41b | ||
|
|
205e0ba81d | ||
|
|
cbc71995a8 | ||
|
|
7b195c9875 | ||
|
|
4674f18a4b | ||
|
|
519f9bc675 | ||
|
|
2a9fc35e51 | ||
|
|
a2e4e64682 | ||
|
|
a1c887964e | ||
|
|
64a90a6b98 | ||
|
|
b42eb16cf4 | ||
|
|
7e68d6e735 | ||
|
|
c8d6673b59 | ||
|
|
f66e25a82b | ||
|
|
8b32fe80ae | ||
|
|
77e9f2d6b1 | ||
|
|
1bd22e8e65 | ||
|
|
6680c2b22e | ||
|
|
4dee0c4a14 | ||
|
|
4f0a05ab3e | ||
|
|
66c1f966f0 | ||
|
|
fba3985f23 | ||
|
|
96406f0842 | ||
|
|
822400ef3b | ||
|
|
9134f9e98f | ||
|
|
25439e939e | ||
|
|
be6fd4ba89 | ||
|
|
15876e85e5 | ||
|
|
0dce4bef79 | ||
|
|
3c32019989 | ||
|
|
e5abc53701 | ||
|
|
7819fef345 | ||
|
|
c856b6e0ff | ||
|
|
04c3fbac37 | ||
|
|
1934d6d9ab | ||
|
|
e3d19e81a2 | ||
|
|
617698dfe0 | ||
|
|
c2773ea02f | ||
|
|
fce44a5a13 | ||
|
|
25de928df7 | ||
|
|
a03786f773 | ||
|
|
310fc87c2d | ||
|
|
04526093e4 | ||
|
|
f8bf9bd86b | ||
|
|
cc10da474d | ||
|
|
9c4fd36783 | ||
|
|
c2de445f79 | ||
|
|
2b494ecc9c | ||
|
|
53c03115cf | ||
|
|
2bed2152e6 | ||
|
|
c245fd7d91 | ||
|
|
75f85288f4 | ||
|
|
fc611a134b | ||
|
|
e4e54f33ce | ||
|
|
391087ed28 | ||
|
|
a1e8b74827 | ||
|
|
93240102e0 | ||
|
|
8eef11d317 | ||
|
|
a2e59e72bc | ||
|
|
2777d0a1d9 | ||
|
|
f72c7edfa4 | ||
|
|
88fb6d90c4 | ||
|
|
3517f85e47 | ||
|
|
b89f451694 | ||
|
|
3cdc438e53 | ||
|
|
1f39665083 | ||
|
|
b22636c838 | ||
|
|
82f503f587 | ||
|
|
c3260b66c9 | ||
|
|
d6c527830e | ||
|
|
ccf8b54b89 | ||
|
|
3cb3979de3 | ||
|
|
6fa9b76342 | ||
|
|
4803914ae6 | ||
|
|
d66d1b97aa | ||
|
|
795af791b0 | ||
|
|
37b64de20f | ||
|
|
a3f1154b3d | ||
|
|
2e38918ba4 | ||
|
|
c9eacb181c | ||
|
|
e029a86aad | ||
|
|
570cdc05d7 | ||
|
|
1a12403002 | ||
|
|
dae37661d9 | ||
|
|
d70aa14f2c | ||
|
|
0a1e199682 | ||
|
|
12f1cfa86a | ||
|
|
6ff014b31c | ||
|
|
fe12492480 | ||
|
|
83de5364b7 | ||
|
|
269674f79d | ||
|
|
bb55ac6279 | ||
|
|
55abf6dfb2 | ||
|
|
bc3512c1d6 | ||
|
|
9da456655c | ||
|
|
de8bfb32bd | ||
|
|
e9fd8ad446 | ||
|
|
148bb622fa | ||
|
|
2d8d97cee2 | ||
|
|
c524f43e4f | ||
|
|
e4c1e90536 | ||
|
|
0bf3ebb4ba | ||
|
|
99d818f1e9 | ||
|
|
00b37e718d | ||
|
|
632bee4abb | ||
|
|
c263dcee2f | ||
|
|
fd61666d96 | ||
|
|
f2853386b1 | ||
|
|
0cbf3afe17 | ||
|
|
d59eb9fcc3 | ||
|
|
8155ecba61 | ||
|
|
6897c1116a | ||
|
|
855bb36fd0 | ||
|
|
049325ca96 | ||
|
|
089ca134fb | ||
|
|
a57b205383 | ||
|
|
f88a9a9643 | ||
|
|
3060dfd92e | ||
|
|
27aef97f65 | ||
|
|
283b6275df | ||
|
|
aa0d441ede | ||
|
|
01c844a01d | ||
|
|
2283551cfa | ||
|
|
c1f893d894 | ||
|
|
cff9e16a12 | ||
|
|
1406f80135 | ||
|
|
7b32b8f4e1 | ||
|
|
1184f0aca5 | ||
|
|
1fcadf67e6 | ||
|
|
f189353178 | ||
|
|
5ac288bcc6 | ||
|
|
9385eb6ff8 | ||
|
|
a80545992b | ||
|
|
5c96a91d77 | ||
|
|
9968129831 | ||
|
|
dea14fc707 | ||
|
|
435565a54f | ||
|
|
1c0622a472 | ||
|
|
51218b3b9d | ||
|
|
e4ac4e75b5 | ||
|
|
fe0af271c6 | ||
|
|
2f2653aa77 | ||
|
|
d7ff107654 | ||
|
|
8dd5e1c2b5 | ||
|
|
8d443d4626 | ||
|
|
227c898cd9 | ||
|
|
63c601b631 | ||
|
|
a23a88b3e7 | ||
|
|
37ed0dafe4 | ||
|
|
e62db72111 | ||
|
|
06c6b51e7d | ||
|
|
6d51b7b2e3 | ||
|
|
008d8b6789 | ||
|
|
31553f07f2 | ||
|
|
3ef96c2cc6 | ||
|
|
faf835be2b | ||
|
|
c4297a5a29 | ||
|
|
68b431e37d | ||
|
|
3c5a3e77d4 | ||
|
|
41de89f61b | ||
|
|
c67fc6bb09 | ||
|
|
241e340f78 | ||
|
|
661798ad34 | ||
|
|
179fba3f38 | ||
|
|
eb59dd7d81 | ||
|
|
2b23ba97f3 | ||
|
|
5dd59cc90d | ||
|
|
ac4601eadd | ||
|
|
eb32da13cd | ||
|
|
0e50a4c008 | ||
|
|
c133515811 | ||
|
|
a53510239f | ||
|
|
fff11a1e07 | ||
|
|
2f7a8515ca | ||
|
|
83bfefeccb | ||
|
|
0172f198e3 | ||
|
|
5767f2b648 | ||
|
|
2ee99f8954 | ||
|
|
ac58d21aa3 | ||
|
|
36311ee4fd | ||
|
|
a0665f3a18 | ||
|
|
0e069fa57d | ||
|
|
87498c5c39 | ||
|
|
b9cc3176eb | ||
|
|
aae108c1ce | ||
|
|
22af88274b | ||
|
|
448d1ce428 | ||
|
|
5ba763413b | ||
|
|
95446b4416 | ||
|
|
bbaf6daa9d | ||
|
|
3dc0bf7428 | ||
|
|
afd31489d0 | ||
|
|
8f9b2b68ee | ||
|
|
8292260515 | ||
|
|
efd2b3f5f2 | ||
|
|
2ef327caed | ||
|
|
1149833a58 | ||
|
|
ccc95bf9df | ||
|
|
6ad2c3eb33 | ||
|
|
673ad62eed | ||
|
|
a5a5c3e09a | ||
|
|
c7cb40353c | ||
|
|
d5f76caf6c | ||
|
|
131a348d37 | ||
|
|
fa0ffa4777 | ||
|
|
03e1e88db1 | ||
|
|
395ef4efb7 | ||
|
|
f3838a9c35 | ||
|
|
26e5429f72 | ||
|
|
0b35e0c5a1 | ||
|
|
73384728ca | ||
|
|
307c1f6bf0 | ||
|
|
c7c6df6cec | ||
|
|
c76fd640e6 | ||
|
|
5f759b04b8 | ||
|
|
b94f67885c | ||
|
|
6a4803026d | ||
|
|
718445b096 | ||
|
|
39a2514643 | ||
|
|
f231ddddaf | ||
|
|
daddb7a832 | ||
|
|
dc241566aa | ||
|
|
9501293de7 | ||
|
|
af8937c056 | ||
|
|
7f33ab834d | ||
|
|
2b5af600e3 | ||
|
|
5c19355095 | ||
|
|
4c8f064d7d | ||
|
|
acb2368976 | ||
|
|
c100a742dc | ||
|
|
49d6336fae | ||
|
|
51953423ee | ||
|
|
e2d6090043 | ||
|
|
d4df6641c8 | ||
|
|
20a384dfa9 | ||
|
|
e3e92e96c1 | ||
|
|
06f38d36a8 | ||
|
|
88a69ffa58 | ||
|
|
a2005cec5c | ||
|
|
a2cfcdfbe9 | ||
|
|
b610d740fd | ||
|
|
22cbf68344 | ||
|
|
60b4355168 | ||
|
|
5649b0ccba | ||
|
|
534856c98a | ||
|
|
010509355d | ||
|
|
d398cc9d10 | ||
|
|
6efbfc4caf | ||
|
|
d949c3b6e5 | ||
|
|
d1b67af3ab | ||
|
|
a8ae88162f | ||
|
|
e85a0aba9b | ||
|
|
4d8e284cce | ||
|
|
afdbd8f95b | ||
|
|
62c74ac634 | ||
|
|
368d3ff0d9 | ||
|
|
95a0b11d0a | ||
|
|
e93d7953df | ||
|
|
941bbf2067 | ||
|
|
85d34c3264 |
No files matched your search
@@ -245,10 +245,6 @@ ext/reflection/spl.chm
|
||||
ext/simplexml/examples/security.new.xml
|
||||
ext/spl/examples/.htaccess
|
||||
ext/spl/examples/*.phps
|
||||
ext/sqlite/weztest.sqlite
|
||||
ext/sqlite/libsqlite/src/sqlite.h
|
||||
ext/sqlite/libsqlite/src/parse.out
|
||||
ext/sqlite/libsqlite/src/libsqlite.dsw
|
||||
ext/sqlite3/tests/phpsql*
|
||||
ext/sqlite3/tests/*.db
|
||||
ext/sqlite3/tests/*.tmp
|
||||
|
||||
+18
-8
@@ -1,4 +1,22 @@
|
||||
language: c
|
||||
sudo: false
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- locales
|
||||
- language-pack-de
|
||||
- re2c
|
||||
- libgmp-dev
|
||||
- libicu-dev
|
||||
- libmcrypt-dev
|
||||
- libtidy-dev
|
||||
- libenchant-dev
|
||||
- libaspell-dev
|
||||
- libpspell-dev
|
||||
- librecode-dev
|
||||
- libsasl2-dev
|
||||
- libxpm-dev
|
||||
- libt1-dev
|
||||
|
||||
notifications:
|
||||
email:
|
||||
@@ -27,13 +45,6 @@ env:
|
||||
- ENABLE_MAINTAINER_ZTS=0 ENABLE_DEBUG=0
|
||||
- ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1
|
||||
|
||||
before_install:
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -y libenchant-dev libaspell-dev libpspell-dev librecode-dev libsasl2-dev libxpm-dev libt1-dev libc-client2007e-dev
|
||||
- sudo cp ./travis/de /var/lib/locales/supported.d/de
|
||||
- sudo dpkg-reconfigure locales
|
||||
- ./travis/install.sh
|
||||
|
||||
before_script:
|
||||
# Compile PHP
|
||||
- ./travis/compile.sh
|
||||
@@ -43,7 +54,6 @@ before_script:
|
||||
- . ./travis/ext/pdo_mysql/setup.sh
|
||||
- . ./travis/ext/pgsql/setup.sh
|
||||
- . ./travis/ext/pdo_pgsql/setup.sh
|
||||
- . ./travis/ext/imap/setup.sh
|
||||
|
||||
# Run PHPs run-tests.php
|
||||
script:
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ php_lcov.info: lcov-test
|
||||
cp $$x.bbg lcov_data/$$y.bbg ; \
|
||||
fi; \
|
||||
done; \
|
||||
for dir in ext/bcmath/libbcmath ext/fileinfo/libmagic ext/gd/libgd ext/mbstring/libmbfl ext/mbstring/oniguruma ext/pcre/pcrelib ext/pdo_sqlite/libsqlite ext/sqlite/libsqlite ext/sqlite3/libsqlite ext/xmlrpc/libxmlrpc ext/zip/lib; do \
|
||||
for dir in ext/bcmath/libbcmath ext/date/lib ext/fileinfo/libmagic ext/gd/libgd ext/mbstring/libmbfl ext/mbstring/oniguruma ext/pcre/pcrelib ext/pdo_sqlite/libsqlite ext/sqlite3/libsqlite ext/xmlrpc/libxmlrpc ext/zip/lib; do \
|
||||
if test -d lcov_data/$$dir; then \
|
||||
rm -rf lcov_data/$$dir ; \
|
||||
fi; \
|
||||
|
||||
+2
-4
@@ -599,10 +599,8 @@ TSRM_API int shmget(int key, int size, int flags)
|
||||
return -1;
|
||||
}
|
||||
|
||||
snprintf(shm_segment, sizeof(shm_segment)-1, "TSRM_SHM_SEGMENT:%d", key);
|
||||
snprintf(shm_info, sizeof(shm_info)-1, "TSRM_SHM_DESCRIPTOR:%d", key);
|
||||
shm_segment[sizeof(shm_segment)-1] = '\0';
|
||||
shm_info[sizeof(shm_info)-1] = '\0';
|
||||
snprintf(shm_segment, sizeof(shm_segment), "TSRM_SHM_SEGMENT:%d", key);
|
||||
snprintf(shm_info, sizeof(shm_info), "TSRM_SHM_DESCRIPTOR:%d", key);
|
||||
|
||||
shm_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_segment);
|
||||
info_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_info);
|
||||
|
||||
@@ -352,7 +352,7 @@ Relevant RFCs:
|
||||
Other language changes
|
||||
----------------------
|
||||
|
||||
* Removed support for static calls to non-static calls form an incompatible
|
||||
* Removed support for static calls to non-static methods from an incompatible
|
||||
$this context. In this case $this will not be defined, but the call will be
|
||||
allowed with a deprecation notice. An example:
|
||||
|
||||
@@ -556,6 +556,10 @@ Other
|
||||
. Added ability to move PHP code pages (PHP TEXT segment) into HUGE pages.
|
||||
It's possible to enable/disable this feature in php.ini through
|
||||
opcache.huge_code_pages=0/1. OS should be configured to provide huge pages.
|
||||
. Added Windows only opcache.file_cache_fallback=1 ini option, which implies
|
||||
the implemented fallback mechanism. When OPcache was not able to reattach
|
||||
the shared memory segment to the desired address and opcache.file_cache
|
||||
is on, opcache.file_cache_only=1 will be automatically enforced.
|
||||
|
||||
- OpenSSL
|
||||
. Added "alpn_protocols" SSL context option allowing encrypted client/server
|
||||
@@ -604,9 +608,6 @@ Other
|
||||
5. Changed Functions
|
||||
========================================
|
||||
|
||||
- parse_ini_file():
|
||||
- parse_ini_string():
|
||||
. Added scanner mode INI_SCANNER_TYPED to yield typed .ini values.
|
||||
- unserialize():
|
||||
. Added second parameter for unserialize function
|
||||
(RFC: https://wiki.php.net/rfc/secure_unserialize) allowing to specify
|
||||
|
||||
+2
-2
@@ -90,7 +90,7 @@ changes. See: https://wiki.php.net/phpng-upgrading
|
||||
|
||||
The only exceptions are the snprintf and zend_sprintf functions yet, because in some cases
|
||||
they can use the implemenations available on the system, not the PHP one. With snprintf the
|
||||
macros ZEND_INT_FMT and ZEND_UINT_FMT should be used.
|
||||
macros ZEND_LONG_FMT and ZEND_ULONG_FMT should be used.
|
||||
|
||||
h. HashTable API
|
||||
|
||||
@@ -248,7 +248,7 @@ changes. See: https://wiki.php.net/phpng-upgrading
|
||||
|
||||
w. Tick functions internal API change
|
||||
Tick functions have different declaration now. They expect a single
|
||||
single parameter while before they were parameterless. When registering the
|
||||
parameter while before they were parameterless. When registering the
|
||||
tick function a value for this parameter must be passed. This value will be
|
||||
provided to the tick function on every execution.
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Array addition is not commutative -- do not swap operands
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$array = [1, 2, 3];
|
||||
$array = [4, 5, 6] + $array;
|
||||
var_dump($array);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(4)
|
||||
[1]=>
|
||||
int(5)
|
||||
[2]=>
|
||||
int(6)
|
||||
}
|
||||
@@ -18,7 +18,7 @@ bool(true)
|
||||
bool(true)
|
||||
|
||||
Warning: assert(): assert(false) failed in %sexpect_016.php on line 6
|
||||
NULL
|
||||
bool(false)
|
||||
bool(true)
|
||||
|
||||
Warning: zend.assertions may be completely enabled or disabled only in php.ini in %sexpect_016.php on line 8
|
||||
@@ -25,9 +25,9 @@ bool(true)
|
||||
bool(true)
|
||||
|
||||
Warning: assert(): assert(false) failed in %sexpect_018.php on line 10
|
||||
NULL
|
||||
bool(false)
|
||||
bool(true)
|
||||
|
||||
Warning: assert(): assert(false) failed in %sexpect_018.php on line 12
|
||||
NULL
|
||||
bool(false)
|
||||
bool(true)
|
||||
@@ -68,7 +68,7 @@ catch (Exception $e) {
|
||||
--EXPECTF--
|
||||
Hello World!
|
||||
===NONE===
|
||||
string(56) "Method NoneTest::__toString() must return a string value"
|
||||
string(%d) "Method NoneTest::__toString() must return a string value"
|
||||
===THROW===
|
||||
|
||||
Fatal error: Method ErrorTest::__toString() must not throw an exception in %sbug26166.php on line %d
|
||||
Fatal error: Method ErrorTest::__toString() must not throw an exception, caught Exception: This is an error! in %sbug26166.php on line %d
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #52355 (Negating zero does not produce negative zero)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(-0.0);
|
||||
var_dump(-(float)"0");
|
||||
|
||||
$foo = -sin(0);
|
||||
|
||||
var_dump($foo);
|
||||
|
||||
var_dump(@(1.0 / -0.0));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
float(-0)
|
||||
float(-0)
|
||||
float(-0)
|
||||
float(-INF)
|
||||
@@ -14,7 +14,7 @@ class Bad {
|
||||
$bad = new Bad();
|
||||
echo "$bad";
|
||||
--EXPECTF--
|
||||
Fatal error: Method Bad::__toString() must not throw an exception in %sbug60909_2.php on line 0
|
||||
Fatal error: Method Bad::__toString() must not throw an exception, caught Exception: Oops, I cannot do this in %sbug60909_2.php on line %d
|
||||
|
||||
|
||||
!!!shutdown!!!
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Bug #70430: Stack buffer overflow in zend_language_parser()
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$"*** Testing function() : ***\n";
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Parse error: syntax error, unexpected '"*** Testing function() : ***' (T_CONSTANT_ENCAPSED_STRING), expecting variable (T_VARIABLE) or '{' or '$' in %s on line %d
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #70689 (Exception handler does not work as expected)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function foo($foo) {
|
||||
echo "Executing foo\n";
|
||||
}
|
||||
|
||||
set_error_handler(function($errno, $errstr) {
|
||||
throw new Exception($errstr);
|
||||
});
|
||||
|
||||
try {
|
||||
foo();
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Missing argument 1 for foo(), called in %sbug70689.php on line %d and defined
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #70748 (Segfault in ini_lex () at Zend/zend_ini_scanner.l)
|
||||
--FILE--
|
||||
<?php
|
||||
$ini = '[${ ';
|
||||
|
||||
$ini_file = __DIR__ . "/bug70748.ini";
|
||||
|
||||
file_put_contents($ini_file, $ini);
|
||||
|
||||
var_dump(parse_ini_file($ini_file));
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
unlink(__DIR__ . "/bug70748.ini");
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: syntax error, unexpected $end, expecting '}' in %sbug70748.ini on line %d
|
||||
in %sbug70748.php on line %d
|
||||
bool(false)
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Bug #70782: null ptr deref and segfault (zend_get_class_fetch_type)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
(-0)::$prop;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Illegal class name in %s on line %d
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
Bug #70785 (Infinite loop due to exception during identical comparison)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_error_handler(function($no, $msg) {
|
||||
throw new Exception($msg);
|
||||
});
|
||||
|
||||
try {
|
||||
if ($a === null) { // ZEND_VM_SMART_BRANCH
|
||||
undefined_function('Null');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
|
||||
try {
|
||||
$c === 3; // ZEND_VM_NEXT_OPCODE
|
||||
undefined_function();
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
?>
|
||||
okey
|
||||
--EXPECT--
|
||||
okey
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #70804 (Unary add on negative zero produces positive zero)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(+(-0.0));
|
||||
var_dump(+(float)"-0");
|
||||
|
||||
$foo = +(-sin(0));
|
||||
|
||||
var_dump($foo);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
float(-0)
|
||||
float(-0)
|
||||
float(-0)
|
||||
@@ -0,0 +1,46 @@
|
||||
--TEST--
|
||||
Bug #70805 (Segmentation faults whilst running Drupal 8 test suite)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
}
|
||||
|
||||
class B {
|
||||
}
|
||||
|
||||
class C {
|
||||
public function __destruct() {
|
||||
if (isset($GLOBALS["a"])) {
|
||||
unset($GLOBALS["array"]);
|
||||
unset($GLOBALS["a"]); // this will be called in gc_colloct_roots and put $a into gc roots buf
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$a = new A;
|
||||
$a->b = new B;
|
||||
$a->b->a = $a;
|
||||
|
||||
$i = 0;
|
||||
|
||||
$c = new A;
|
||||
$array = array($c); //This is used to leave a room for $GLOBALS["a"]
|
||||
unset($c);
|
||||
|
||||
while ($i++ < 9997) {
|
||||
$t = [];
|
||||
$t[] = &$t;
|
||||
unset($t);
|
||||
}
|
||||
$t = [new C];
|
||||
$t[] = &$t;
|
||||
unset($t); // This is used to trigger C::__destruct while doing gc_colloct_roots
|
||||
|
||||
$e = $a;
|
||||
unset($a); // This one can not be putted into roots buf because it's full, thus gc_colloct_roots will be called,
|
||||
// but C::__destructor which is called in gc_colloct_roots will put $a into buf
|
||||
// which will make $a be putted into gc roots buf twice
|
||||
var_dump(gc_collect_cycles());
|
||||
?>
|
||||
--EXPECT--
|
||||
int(0)
|
||||
@@ -0,0 +1,43 @@
|
||||
--TEST--
|
||||
Bug #70805 (Segmentation faults whilst running Drupal 8 test suite) (Crash)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
}
|
||||
|
||||
class B {
|
||||
}
|
||||
|
||||
class C {
|
||||
public function __destruct() {
|
||||
if (isset($GLOBALS["a"])) {
|
||||
unset($GLOBALS["array"]);
|
||||
unset($GLOBALS["a"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$a = new A;
|
||||
$a->b = new B;
|
||||
$a->b->a = $a;
|
||||
|
||||
$i = 0;
|
||||
|
||||
$c = new A;
|
||||
$array = array($c);
|
||||
unset($c);
|
||||
|
||||
while ($i++ < 9997) {
|
||||
$t = [];
|
||||
$t[] = &$t;
|
||||
unset($t);
|
||||
}
|
||||
$t = [new C];
|
||||
$t[] = &$t;
|
||||
unset($t);
|
||||
unset($a);
|
||||
|
||||
var_dump(gc_collect_cycles());
|
||||
?>
|
||||
--EXPECT--
|
||||
int(2)
|
||||
@@ -0,0 +1,37 @@
|
||||
--TEST--
|
||||
Bug #70805 (Segmentation faults whilst running Drupal 8 test suite) (Memleak)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
}
|
||||
|
||||
class B {
|
||||
}
|
||||
|
||||
class C {
|
||||
public function __destruct() {
|
||||
if (isset($GLOBALS["a"])) {
|
||||
unset($GLOBALS["a"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$a = new A;
|
||||
$a->b = new B;
|
||||
$a->b->a = $a;
|
||||
|
||||
$i = 0;
|
||||
|
||||
while ($i++ < 9998) {
|
||||
$t = [];
|
||||
$t[] = &$t;
|
||||
unset($t);
|
||||
}
|
||||
$t = [new C];
|
||||
$t[] = &$t;
|
||||
unset($t);
|
||||
|
||||
unset($a);
|
||||
var_dump(gc_collect_cycles());
|
||||
--EXPECT--
|
||||
int(2)
|
||||
@@ -0,0 +1,34 @@
|
||||
--TEST--
|
||||
Bug #70873 (Regression on private static properties access)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
private static $x = 1;
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
function bar() {
|
||||
var_dump(self::$x);
|
||||
}
|
||||
};
|
||||
|
||||
class C extends A {
|
||||
function bar() {
|
||||
var_dump(A::$x);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$a = new B;
|
||||
$a->bar();
|
||||
|
||||
$b = new C;
|
||||
$b->bar();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Cannot access property B::$x in %sbug70873.php:%d
|
||||
Stack trace:
|
||||
#0 %sbug70873.php(%d): B->bar()
|
||||
#1 {main}
|
||||
thrown in %sbug70873.php on line %d
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #70895 null ptr deref and segfault with crafted callable
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
array_map("%n", 0);
|
||||
array_map("%n %i", 0);
|
||||
array_map("%n %i aoeu %f aoeu %p", 0);
|
||||
?>
|
||||
--EXPECTREGEX--
|
||||
Warning: array_map\(\) expects parameter 1 to be a valid callback, function '%n' not found or invalid function name in .+
|
||||
|
||||
Warning: array_map\(\) expects parameter 1 to be a valid callback, function '%n %i' not found or invalid function name in .+
|
||||
|
||||
Warning: array_map\(\) expects parameter 1 to be a valid callback, function '%n %i aoeu %f aoeu %p' not found or invalid function name in .+bug70895.php on line \d+
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #70895 null ptr deref and segfault with crafted callable
|
||||
--FILE--
|
||||
<?php
|
||||
function m($f,$a){
|
||||
return array_map($f,0);
|
||||
}
|
||||
|
||||
echo implode(m("",m("",m("",m("",m("0000000000000000000000000000000000",("")))))));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: array_map() expects parameter 1 to be a valid callback, function '0000000000000000000000000000000000' not found or invalid function name in %sbug70898.php on line %d
|
||||
|
||||
Warning: array_map() expects parameter 1 to be a valid callback, function '' not found or invalid function name in %sbug70898.php on line %d
|
||||
|
||||
Warning: array_map() expects parameter 1 to be a valid callback, function '' not found or invalid function name in %sbug70898.php on line %d
|
||||
|
||||
Warning: array_map() expects parameter 1 to be a valid callback, function '' not found or invalid function name in %sbug70898.php on line %d
|
||||
|
||||
Warning: array_map() expects parameter 1 to be a valid callback, function '' not found or invalid function name in %sbug70898.php on line %d
|
||||
|
||||
Warning: implode(): Argument must be an array in %sbug70898.php on line %d
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Bug #70912 (Null ptr dereference when class property is initialised to a dereferenced value)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
public $a=[][];
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot use [] for reading in %sbug70912.php on line %d
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #70914 zend_throw_or_error() format string vulnerability
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("pdo_sqlite")) {
|
||||
die("skip pdo_sqlite required");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$db = new PDO('sqlite::memory:');
|
||||
$st = $db->query('SELECT 1');
|
||||
$re = $st->fetchObject('%Z');
|
||||
?>
|
||||
--EXPECTREGEX--
|
||||
Fatal error: Class '%Z' not found in .+bug70914.php on line \d+
|
||||
@@ -0,0 +1,37 @@
|
||||
--TEST--
|
||||
Bug #70944 (try{ } finally{} can create infinite chains of exceptions)
|
||||
--FILE--
|
||||
<?php
|
||||
try {
|
||||
$e = new Exception("Foo");
|
||||
try {
|
||||
throw new Exception("Bar", 0, $e);
|
||||
} finally {
|
||||
throw $e;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
var_dump((string)$e);
|
||||
}
|
||||
|
||||
try {
|
||||
$e = new Exception("Foo");
|
||||
try {
|
||||
throw new Exception("Bar", 0, $e);
|
||||
} finally {
|
||||
throw new Exception("Dummy", 0, $e);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
var_dump((string)$e);
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(%d) "Exception: Foo in %sbug70944.php:%d
|
||||
Stack trace:
|
||||
#0 {main}"
|
||||
string(%d) "Exception: Foo in %sbug70944.php:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
|
||||
Next Exception: Dummy in %sbug70944.php:%d
|
||||
Stack trace:
|
||||
#0 {main}"
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #70957 (self::class can not be resolved with reflection for abstract class)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
abstract class Foo
|
||||
{
|
||||
function bar($a = self::class) {}
|
||||
}
|
||||
|
||||
trait T {
|
||||
public function bar() {
|
||||
}
|
||||
}
|
||||
|
||||
class B extends Foo
|
||||
{
|
||||
use T;
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Declaration of T::bar() should be compatible with Foo::bar($a = 'Foo') in %sbug70957.php on line %d
|
||||
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Bug #70958 (Invalid opcode while using ::class as trait method paramater default value)
|
||||
--FILE--
|
||||
<?php
|
||||
trait Foo
|
||||
{
|
||||
function bar($a = self::class) {
|
||||
var_dump($a);
|
||||
}
|
||||
}
|
||||
|
||||
class B {
|
||||
use Foo;
|
||||
}
|
||||
|
||||
$b = new B;
|
||||
|
||||
$b->bar();
|
||||
?>
|
||||
--EXPECT--
|
||||
string(1) "B"
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #70967 (Weird error handling for __toString when Error is thrown)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
public function __toString() {
|
||||
undefined_function();
|
||||
}
|
||||
}
|
||||
|
||||
echo (new A);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Method A::__toString() must not throw an exception, caught Error: Call to undefined function undefined_function() in %sbug70967.php on line %d
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
Bug #70987 (static::class within Closure::call() causes segfault)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class foo {}
|
||||
$bar = function () {
|
||||
return static::class;
|
||||
};
|
||||
|
||||
var_dump($bar->call(new foo));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(3) "foo"
|
||||
@@ -0,0 +1,26 @@
|
||||
--TEST--
|
||||
Bug #70997 (When using parentClass:: instead of parent::, static context changed)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
const TEST = false;
|
||||
|
||||
public function test()
|
||||
{
|
||||
var_dump(static::TEST);
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
const TEST = true;
|
||||
|
||||
public function test()
|
||||
{
|
||||
A::test();
|
||||
}
|
||||
}
|
||||
|
||||
$b = new B;
|
||||
$b->test();
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
@@ -0,0 +1,31 @@
|
||||
--TEST--
|
||||
Bug #71067 (Local object in class method stays in memory for each call)
|
||||
--INI--
|
||||
opcache.enable=0
|
||||
error_reporting=0
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public function test(){
|
||||
$arr = (object) [
|
||||
'children' => []
|
||||
];
|
||||
$arr->children[] = 1;
|
||||
return $arr;
|
||||
}
|
||||
}
|
||||
|
||||
$o = new Test();
|
||||
$o->test();
|
||||
|
||||
print_r($o->test());
|
||||
?>
|
||||
--EXPECT--
|
||||
stdClass Object
|
||||
(
|
||||
[children] => Array
|
||||
(
|
||||
[0] => 1
|
||||
)
|
||||
|
||||
)
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug #71086: Invalid numeric literal parse error within highlight_string() function
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$highlightedString = highlight_string("<?php \n 09 09 09;", true);
|
||||
var_dump($highlightedString);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(169) "<code><span style="color: #000000">
|
||||
<span style="color: #0000BB"><?php <br /> </span><span style="color: #007700">09 09 09;</span>
|
||||
</span>
|
||||
</code>"
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug #71154: Incorrect HT iterator invalidation causes iterator reuse
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$array = [1, 2, 3];
|
||||
foreach ($array as &$ref) {
|
||||
/* Free array, causing free of iterator */
|
||||
$array = [];
|
||||
/* Reuse the iterator.
|
||||
* However it will also be reused on next foreach iteration */
|
||||
$it = new ArrayIterator([1, 2, 3]);
|
||||
$it->rewind();
|
||||
}
|
||||
var_dump($it->current());
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
Bug #71163 (Segmentation Fault (cleanup_unfinished_calls))
|
||||
--FILE--
|
||||
<?php
|
||||
function __autoload($name) {
|
||||
eval ("class $name extends Exception { public static function foo() {}}");
|
||||
throw new Exception("boom");
|
||||
}
|
||||
|
||||
function test2() {
|
||||
try {
|
||||
Test::foo();
|
||||
} catch (Exception $e) {
|
||||
echo "okey";
|
||||
}
|
||||
}
|
||||
|
||||
function test() {
|
||||
test2();
|
||||
}
|
||||
|
||||
test();
|
||||
?>
|
||||
--EXPECT--
|
||||
okey
|
||||
@@ -64,6 +64,15 @@ $tests = [
|
||||
[new DLL, null],
|
||||
[new DLL, ClsUnrelated::class],
|
||||
]],
|
||||
|
||||
[function() {}, [
|
||||
[null, null],
|
||||
[new Cls, null],
|
||||
[new Cls, 'Cls'],
|
||||
[null, 'Cls'],
|
||||
[null, 'stdClass'],
|
||||
[new stdClass, null],
|
||||
]],
|
||||
];
|
||||
|
||||
set_error_handler(function($errno, $errstr) {
|
||||
@@ -79,6 +88,9 @@ foreach ($tests as list($fn, $bindings)) {
|
||||
$c = (new ReflectionFunction($fn))->getClosure();
|
||||
$fnStr = $fn;
|
||||
}
|
||||
if ($fn instanceof Closure) {
|
||||
$fnStr = "(function() {})";
|
||||
}
|
||||
|
||||
echo "$fnStr()\n" . str_repeat('-', strlen($fnStr) + 2), "\n\n";
|
||||
|
||||
@@ -206,3 +218,24 @@ Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure
|
||||
|
||||
bindTo(new SplDoublyLinkedList, ClsUnrelated::class):
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
(function() {})()
|
||||
-----------------
|
||||
|
||||
bindTo(null, null):
|
||||
Success!
|
||||
|
||||
bindTo(new Cls, null):
|
||||
Success!
|
||||
|
||||
bindTo(new Cls, Cls::class):
|
||||
Success!
|
||||
|
||||
bindTo(null, Cls::class):
|
||||
Success!
|
||||
|
||||
bindTo(null, stdClass::class):
|
||||
Cannot bind closure to scope of internal class stdClass
|
||||
|
||||
bindTo(new stdClass, null):
|
||||
Success!
|
||||
@@ -0,0 +1,52 @@
|
||||
--TEST--
|
||||
Concatenating many small strings should not slowdown allocations
|
||||
--SKIPIF--
|
||||
<?php if (PHP_DEBUG) { die ("skip debug version is slow"); } ?>
|
||||
--INI--
|
||||
memory_limit=256m
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/* To note is that memory usage can vary depending on whether opcache is on. The actual
|
||||
measuring that matters is timing here. */
|
||||
|
||||
$time = microtime(TRUE);
|
||||
|
||||
/* This might vary on Linux/Windows, so the worst case and also count in slow machines. */
|
||||
$t0_max = 0.1;
|
||||
$t1_max = 0.4;
|
||||
|
||||
$datas = [];
|
||||
for ($i = 0; $i < 220000; $i++)
|
||||
{
|
||||
$datas[] = [
|
||||
'000.000.000.000',
|
||||
'000.255.255.255',
|
||||
'保留地址',
|
||||
'保留地址',
|
||||
'保留地址',
|
||||
'保留地址',
|
||||
'保留地址',
|
||||
'保留地址',
|
||||
];
|
||||
}
|
||||
|
||||
$t0 = microtime(TRUE) - $time;
|
||||
var_dump($t0 < $t0_max);
|
||||
|
||||
|
||||
$texts = '';
|
||||
foreach ($datas AS $data)
|
||||
{
|
||||
$texts .= implode("\t", $data) . "\r\n";
|
||||
}
|
||||
|
||||
$t1 = microtime(TRUE) - $time;
|
||||
var_dump($t1 < $t1_max);
|
||||
|
||||
?>
|
||||
+++DONE+++
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
+++DONE+++
|
||||
@@ -0,0 +1,43 @@
|
||||
--TEST--
|
||||
Bug #70904 (yield from incorrectly marks valid generator as finished)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function g1() {
|
||||
yield 1;
|
||||
}
|
||||
|
||||
function g2($g1) {
|
||||
yield from $g1;
|
||||
echo "reached!\n";
|
||||
yield 2;
|
||||
}
|
||||
|
||||
$g1 = g1();
|
||||
$g2 = g2($g1);
|
||||
|
||||
var_dump($g2->valid());
|
||||
var_dump($g2->current());
|
||||
$g1->next();
|
||||
var_dump($g1->valid());
|
||||
var_dump($g2->valid());
|
||||
var_dump($g2->current());
|
||||
$g2->next();
|
||||
var_dump($g2->valid());
|
||||
var_dump($g2->current());
|
||||
$g2->next();
|
||||
var_dump($g2->valid());
|
||||
var_dump($g2->current());
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
int(1)
|
||||
bool(false)
|
||||
bool(true)
|
||||
int(1)
|
||||
reached!
|
||||
bool(true)
|
||||
int(2)
|
||||
bool(false)
|
||||
NULL
|
||||
@@ -0,0 +1,32 @@
|
||||
--TEST--
|
||||
Bug #70965 (yield from with a common iterator primes too much)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function it() {
|
||||
yield from [1, 2, 3, 4, 5];
|
||||
}
|
||||
|
||||
function bar($g) {
|
||||
yield from $g;
|
||||
}
|
||||
|
||||
$gen = it();
|
||||
$gens[] = bar($gen);
|
||||
$gens[] = bar($gen);
|
||||
|
||||
do {
|
||||
foreach($gens as $g) {
|
||||
var_dump($g->current());
|
||||
$gen->next();
|
||||
}
|
||||
} while ($gen->valid());
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
int(2)
|
||||
int(3)
|
||||
int(4)
|
||||
int(5)
|
||||
int(5)
|
||||
@@ -0,0 +1,49 @@
|
||||
--TEST--
|
||||
Bug #71013 (Incorrect exception handler with yield from)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class FooBar implements Iterator {
|
||||
function __construct() { echo "Constructing new FooBar\n"; }
|
||||
function __destruct() { echo "Destructing FooBar\n"; }
|
||||
function current () { throw new Exception; }
|
||||
function key () { return 0; }
|
||||
function next () {}
|
||||
function rewind () {}
|
||||
function valid () { return true; }
|
||||
}
|
||||
|
||||
function foo() {
|
||||
try {
|
||||
$f = new FooBar;
|
||||
yield from $f;
|
||||
} catch (Exception $e) {
|
||||
echo "[foo()] Caught Exception\n";
|
||||
}
|
||||
}
|
||||
|
||||
function bar() {
|
||||
echo "Starting bar()\n";
|
||||
$x = foo();
|
||||
try {
|
||||
var_dump($x->current());
|
||||
} catch (Exception $e) {
|
||||
echo "[bar()] Caught Exception\n";
|
||||
}
|
||||
echo "Unsetting \$x\n";
|
||||
unset($x);
|
||||
echo "Finishing bar()\n";
|
||||
}
|
||||
|
||||
bar();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Starting bar()
|
||||
Constructing new FooBar
|
||||
[foo()] Caught Exception
|
||||
Destructing FooBar
|
||||
NULL
|
||||
Unsetting $x
|
||||
Finishing bar()
|
||||
|
||||
@@ -37,5 +37,8 @@ int(4)
|
||||
int(6)
|
||||
int(3)
|
||||
int(5)
|
||||
int(3)
|
||||
int(5)
|
||||
NULL
|
||||
bool(false)
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
--TEST--
|
||||
Throwing into a generator yielding from an array/iterator
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$data = [1, 2, 3];
|
||||
|
||||
function yielditer($arr) {
|
||||
foreach($arr as $val) {
|
||||
yield $val;
|
||||
}
|
||||
}
|
||||
|
||||
function yf($in) {
|
||||
yield from $in;
|
||||
}
|
||||
|
||||
function test($g) {
|
||||
var_dump($g->current());
|
||||
try {
|
||||
$g->throw(new Exception("Exception!"));
|
||||
} catch (Exception $e) {
|
||||
echo "{$e->getMessage()}\n";
|
||||
}
|
||||
var_dump($g->current());
|
||||
}
|
||||
|
||||
$yfiter = yf($data);
|
||||
$yfgen = yf(yielditer($data));
|
||||
|
||||
test(yf($data));
|
||||
echo "\n";
|
||||
test(yf(yielditer($data)));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
Exception!
|
||||
NULL
|
||||
|
||||
int(1)
|
||||
Exception!
|
||||
NULL
|
||||
@@ -0,0 +1,43 @@
|
||||
--TEST--
|
||||
Using an integer as a static property name
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Foo {
|
||||
public static $bar = 42;
|
||||
}
|
||||
|
||||
$n = 42;
|
||||
|
||||
${42} = 24;
|
||||
var_dump(${42});
|
||||
var_dump(${(int) 42});
|
||||
var_dump(${(int) $n});
|
||||
|
||||
try {
|
||||
var_dump(Foo::${42});
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
try {
|
||||
var_dump(Foo::${(int) 42});
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
try {
|
||||
var_dump(Foo::${(int) $n});
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(24)
|
||||
int(24)
|
||||
int(24)
|
||||
Access to undeclared static property: Foo::$42
|
||||
Access to undeclared static property: Foo::$42
|
||||
Access to undeclared static property: Foo::$42
|
||||
|
||||
@@ -11,4 +11,4 @@ echo __NAMESPACE__ . "\n";
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
|
||||
Fatal error: Namespace declaration statement has to be the very first statement in the script in %sns_068.php on line %d
|
||||
Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in %sns_068.php on line %d
|
||||
@@ -11,4 +11,4 @@ echo "ok\n";
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Namespace declaration statement has to be the very first statement in the script in %s on line %d
|
||||
Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in %sns_083.php on line %d
|
||||
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
return type with finally
|
||||
--INI--
|
||||
opcache.enable=0
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function foo() : array {
|
||||
try {
|
||||
throw new Exception("xxxx");
|
||||
} finally {
|
||||
return ;
|
||||
}
|
||||
}
|
||||
|
||||
foo();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught TypeError: Return value of foo() must be of the type array, none returned in %s29.php:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): foo()
|
||||
#1 {main}
|
||||
thrown in %s029.php on line %d
|
||||
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
Bug #71092 (Segmentation fault with return type hinting)
|
||||
--INI--
|
||||
opcache.enable=0
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function boom(): array {
|
||||
$data = [['id']];
|
||||
switch ($data[0]) {
|
||||
case ['id']:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
boom();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught TypeError: Return value of boom() must be of the type array, none returned in %sbug71092.php:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): boom()
|
||||
#1 {main}
|
||||
thrown in %sbug71092.php on line %d
|
||||
@@ -0,0 +1,40 @@
|
||||
--TEST--
|
||||
Combination of foreach, finally and goto (call order)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
public $n = 0;
|
||||
function __construct($n) {
|
||||
$this->n = $n;
|
||||
}
|
||||
function __destruct() {
|
||||
echo "destruct" . $this->n . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
foreach ([new A(1)] as $a) {
|
||||
$a = null;
|
||||
try {
|
||||
foreach ([new A(2)] as $a) {
|
||||
$a = null;
|
||||
try {
|
||||
foreach ([new A(3)] as $a) {
|
||||
$a = null;
|
||||
goto out;
|
||||
}
|
||||
} finally {
|
||||
echo "finally1\n";
|
||||
}
|
||||
out: ;
|
||||
}
|
||||
} finally {
|
||||
echo "finally2\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
destruct3
|
||||
finally1
|
||||
destruct2
|
||||
finally2
|
||||
destruct1
|
||||
@@ -0,0 +1,42 @@
|
||||
--TEST--
|
||||
Combination of foreach, finally and exception (call order)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
public $n = 0;
|
||||
function __construct($n) {
|
||||
$this->n = $n;
|
||||
}
|
||||
function __destruct() {
|
||||
echo "destruct" . $this->n . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
foreach ([new A(1)] as $a) {
|
||||
$a = null;
|
||||
try {
|
||||
foreach ([new A(2)] as $a) {
|
||||
$a = null;
|
||||
try {
|
||||
foreach ([new A(3)] as $a) {
|
||||
$a = null;
|
||||
throw new Exception();
|
||||
}
|
||||
} finally {
|
||||
echo "finally1\n";
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
echo "catch\n";
|
||||
} finally {
|
||||
echo "finally2\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
destruct3
|
||||
finally1
|
||||
destruct2
|
||||
catch
|
||||
finally2
|
||||
destruct1
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Fully qualified (leading backslash) type names must fail
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function foo(\int $foo) {
|
||||
var_dump($foo);
|
||||
}
|
||||
foo(1);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Scalar type declaration 'int' must be unqualified in %s on line %d
|
||||
@@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
namespace\int is not a valid type hint
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test(namespace\int $i) {}
|
||||
test(0);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Scalar type declaration 'int' must be unqualified in %s on line %d
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Accessing a static property on a statically evaluable class expression
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
public static $b = 42;
|
||||
}
|
||||
var_dump(('A' . (string) '')::$b);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(42)
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Static property on constexpr class with leading backslash
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
public static $b = 42;
|
||||
}
|
||||
var_dump(('\A' . (string) '')::$b);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(42)
|
||||
@@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
Static property access on constexpr class evaluating to integer
|
||||
--FILE--
|
||||
<?php
|
||||
((int)1)::$b;
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Class name must be a valid object or a string in %s:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
+2
-3
@@ -983,7 +983,6 @@ ZEND_API void zend_deactivate(void) /* {{{ */
|
||||
fprintf(stderr, " Root Buffered buffer grey\n");
|
||||
fprintf(stderr, " -------- -------- ----------- ------\n");
|
||||
fprintf(stderr, "ZVAL %8d %8d %9d %8d\n", GC_G(zval_possible_root), GC_G(zval_buffered), GC_G(zval_remove_from_buffer), GC_G(zval_marked_grey));
|
||||
fprintf(stderr, "ZOBJ %8d %8d %9d %8d\n", GC_G(zobj_possible_root), GC_G(zobj_buffered), GC_G(zobj_remove_from_buffer), GC_G(zobj_marked_grey));
|
||||
#endif
|
||||
|
||||
zend_try {
|
||||
@@ -1316,7 +1315,7 @@ ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const c
|
||||
if (EG(current_execute_data) && !CG(in_compilation)) {
|
||||
zend_throw_exception(exception_ce, message, 0);
|
||||
} else {
|
||||
zend_error(E_ERROR, message);
|
||||
zend_error(E_ERROR, "%s", message);
|
||||
}
|
||||
|
||||
efree(message);
|
||||
@@ -1346,7 +1345,7 @@ ZEND_API ZEND_COLD void zend_internal_type_error(zend_bool throw_exception, cons
|
||||
if (throw_exception) {
|
||||
zend_throw_exception(zend_ce_type_error, message, 0);
|
||||
} else {
|
||||
zend_error(E_WARNING, message);
|
||||
zend_error(E_WARNING, "%s", message);
|
||||
}
|
||||
efree(message);
|
||||
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
#ifndef ZEND_H
|
||||
#define ZEND_H
|
||||
|
||||
#define ZEND_VERSION "3.0.0-dev"
|
||||
#define ZEND_VERSION "3.0.0"
|
||||
|
||||
#define ZEND_ENGINE_3
|
||||
|
||||
|
||||
+16
-3
@@ -25,6 +25,7 @@
|
||||
#include "zend_execute.h"
|
||||
#include "zend_API.h"
|
||||
#include "zend_modules.h"
|
||||
#include "zend_extensions.h"
|
||||
#include "zend_constants.h"
|
||||
#include "zend_exceptions.h"
|
||||
#include "zend_closures.h"
|
||||
@@ -1219,8 +1220,20 @@ ZEND_API void object_properties_load(zend_object *object, HashTable *properties)
|
||||
zend_property_info *property_info;
|
||||
|
||||
ZEND_HASH_FOREACH_KEY_VAL(properties, h, key, prop) {
|
||||
if(key) {
|
||||
property_info = zend_get_property_info(object->ce, key, 1);
|
||||
if (key) {
|
||||
if (ZSTR_VAL(key)[0] == '\0') {
|
||||
const char *class_name, *prop_name;
|
||||
size_t prop_name_len;
|
||||
if (zend_unmangle_property_name_ex(key, &class_name, &prop_name, &prop_name_len) == SUCCESS) {
|
||||
zend_string *pname = zend_string_init(prop_name, prop_name_len, 0);
|
||||
property_info = zend_get_property_info(object->ce, pname, 1);
|
||||
zend_string_release(pname);
|
||||
} else {
|
||||
property_info = ZEND_WRONG_PROPERTY_INFO;
|
||||
}
|
||||
} else {
|
||||
property_info = zend_get_property_info(object->ce, key, 1);
|
||||
}
|
||||
if (property_info != ZEND_WRONG_PROPERTY_INFO &&
|
||||
property_info &&
|
||||
(property_info->flags & ZEND_ACC_STATIC) == 0) {
|
||||
@@ -1989,7 +2002,7 @@ ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module) /
|
||||
lcname = zend_string_alloc(name_len, 0);
|
||||
zend_str_tolower_copy(ZSTR_VAL(lcname), dep->name, name_len);
|
||||
|
||||
if (zend_hash_exists(&module_registry, lcname)) {
|
||||
if (zend_hash_exists(&module_registry, lcname) || zend_get_extension(dep->name)) {
|
||||
zend_string_free(lcname);
|
||||
/* TODO: Check version relationship */
|
||||
zend_error(E_CORE_WARNING, "Cannot load module '%s' because conflicting module '%s' is already loaded", module->name, dep->name);
|
||||
|
||||
+33
-5
@@ -506,9 +506,9 @@ static void zend_mm_munmap(void *addr, size_t size)
|
||||
/* number of trailing set (1) bits */
|
||||
static zend_always_inline int zend_mm_bitset_nts(zend_mm_bitset bitset)
|
||||
{
|
||||
#if (defined(__GNUC__) || __has_builtin(__builtin_ctzl)) && SIZEOF_ZEND_LONG == SIZEOF_LONG
|
||||
#if (defined(__GNUC__) || __has_builtin(__builtin_ctzl)) && SIZEOF_ZEND_LONG == SIZEOF_LONG && defined(PHP_HAVE_BUILTIN_CTZL)
|
||||
return __builtin_ctzl(~bitset);
|
||||
#elif defined(__GNUC__) || __has_builtin(__builtin_ctzll)
|
||||
#elif (defined(__GNUC__) || __has_builtin(__builtin_ctzll)) && defined(PHP_HAVE_BUILTIN_CTZLL)
|
||||
return __builtin_ctzll(~bitset);
|
||||
#elif defined(_WIN32)
|
||||
unsigned long index;
|
||||
@@ -545,9 +545,9 @@ static zend_always_inline int zend_mm_bitset_nts(zend_mm_bitset bitset)
|
||||
/* number of trailing zero bits (0x01 -> 1; 0x40 -> 6; 0x00 -> LEN) */
|
||||
static zend_always_inline int zend_mm_bitset_ntz(zend_mm_bitset bitset)
|
||||
{
|
||||
#if (defined(__GNUC__) || __has_builtin(__builtin_ctzl)) && SIZEOF_ZEND_LONG == SIZEOF_LONG
|
||||
#if (defined(__GNUC__) || __has_builtin(__builtin_ctzl)) && SIZEOF_ZEND_LONG == SIZEOF_LONG && defined(PHP_HAVE_BUILTIN_CTZL)
|
||||
return __builtin_ctzl(bitset);
|
||||
#elif defined(__GNUC__) || __has_builtin(__builtin_ctzll)
|
||||
#elif (defined(__GNUC__) || __has_builtin(__builtin_ctzll)) && defined(PHP_HAVE_BUILTIN_CTZLL)
|
||||
return __builtin_ctzll(bitset);
|
||||
#elif defined(_WIN32)
|
||||
unsigned long index;
|
||||
@@ -1161,7 +1161,7 @@ static zend_always_inline void zend_mm_free_large(zend_mm_heap *heap, zend_mm_ch
|
||||
/* higher set bit number (0->N/A, 1->1, 2->2, 4->3, 8->4, 127->7, 128->8 etc) */
|
||||
static zend_always_inline int zend_mm_small_size_to_bit(int size)
|
||||
{
|
||||
#if defined(__GNUC__) || __has_builtin(__builtin_clz)
|
||||
#if (defined(__GNUC__) || __has_builtin(__builtin_clz)) && defined(PHP_HAVE_BUILTIN_CLZ)
|
||||
return (__builtin_clz(size) ^ 0x1f) + 1;
|
||||
#elif defined(_WIN32)
|
||||
unsigned long index;
|
||||
@@ -1462,7 +1462,15 @@ static void *zend_mm_realloc_heap(zend_mm_heap *heap, void *ptr, size_t size, si
|
||||
#if ZEND_DEBUG
|
||||
size = real_size;
|
||||
#endif
|
||||
#ifdef ZEND_WIN32
|
||||
/* On Windows we don't have ability to extend huge blocks in-place.
|
||||
* We allocate them with 2MB size granularity, to avoid many
|
||||
* reallocations when they are extended by small pieces
|
||||
*/
|
||||
new_size = ZEND_MM_ALIGNED_SIZE_EX(size, MAX(REAL_PAGE_SIZE, ZEND_MM_CHUNK_SIZE));
|
||||
#else
|
||||
new_size = ZEND_MM_ALIGNED_SIZE_EX(size, REAL_PAGE_SIZE);
|
||||
#endif
|
||||
if (new_size == old_size) {
|
||||
#if ZEND_DEBUG
|
||||
zend_mm_change_huge_block_size(heap, ptr, new_size, real_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
@@ -1507,7 +1515,9 @@ static void *zend_mm_realloc_heap(zend_mm_heap *heap, void *ptr, size_t size, si
|
||||
heap->real_size += new_size - old_size;
|
||||
#endif
|
||||
#if ZEND_MM_STAT
|
||||
heap->real_peak = MAX(heap->real_peak, heap->real_size);
|
||||
heap->size += new_size - old_size;
|
||||
heap->peak = MAX(heap->peak, heap->size);
|
||||
#endif
|
||||
#if ZEND_DEBUG
|
||||
zend_mm_change_huge_block_size(heap, ptr, new_size, real_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
@@ -1618,9 +1628,19 @@ static void *zend_mm_realloc_heap(zend_mm_heap *heap, void *ptr, size_t size, si
|
||||
}
|
||||
|
||||
/* Naive reallocation */
|
||||
#if ZEND_MM_STAT
|
||||
do {
|
||||
size_t orig_peak = heap->peak;
|
||||
size_t orig_real_peak = heap->real_peak;
|
||||
#endif
|
||||
ret = zend_mm_alloc_heap(heap, size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
memcpy(ret, ptr, MIN(old_size, copy_size));
|
||||
zend_mm_free_heap(heap, ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
#if ZEND_MM_STAT
|
||||
heap->peak = MAX(orig_peak, heap->size);
|
||||
heap->real_peak = MAX(orig_real_peak, heap->real_size);
|
||||
} while (0);
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1710,7 +1730,15 @@ static void zend_mm_change_huge_block_size(zend_mm_heap *heap, void *ptr, size_t
|
||||
|
||||
static void *zend_mm_alloc_huge(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
{
|
||||
#ifdef ZEND_WIN32
|
||||
/* On Windows we don't have ability to extend huge blocks in-place.
|
||||
* We allocate them with 2MB size granularity, to avoid many
|
||||
* reallocations when they are extended by small pieces
|
||||
*/
|
||||
size_t new_size = ZEND_MM_ALIGNED_SIZE_EX(size, MAX(REAL_PAGE_SIZE, ZEND_MM_CHUNK_SIZE));
|
||||
#else
|
||||
size_t new_size = ZEND_MM_ALIGNED_SIZE_EX(size, REAL_PAGE_SIZE);
|
||||
#endif
|
||||
void *ptr;
|
||||
|
||||
#if ZEND_MM_LIMIT
|
||||
|
||||
@@ -2481,7 +2481,7 @@ ZEND_FUNCTION(debug_print_backtrace)
|
||||
|
||||
ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int options, int limit) /* {{{ */
|
||||
{
|
||||
zend_execute_data *call, *ptr, *skip;
|
||||
zend_execute_data *ptr, *skip, *call = NULL;
|
||||
zend_object *object;
|
||||
int lineno, frameno = 0;
|
||||
zend_function *func;
|
||||
@@ -2490,8 +2490,12 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
|
||||
zend_string *include_filename = NULL;
|
||||
zval stack_frame;
|
||||
|
||||
call = NULL;
|
||||
ptr = EG(current_execute_data);
|
||||
array_init(return_value);
|
||||
|
||||
if (!(ptr = EG(current_execute_data))) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ptr->func || !ZEND_USER_CODE(ptr->func->common.type)) {
|
||||
call = ptr;
|
||||
ptr = ptr->prev_execute_data;
|
||||
@@ -2509,13 +2513,11 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
|
||||
ptr = ptr->prev_execute_data;
|
||||
}
|
||||
}
|
||||
if (!call) {
|
||||
call = ptr;
|
||||
ptr = ptr->prev_execute_data;
|
||||
}
|
||||
}
|
||||
if (!call) {
|
||||
call = ptr;
|
||||
ptr = ptr->prev_execute_data;
|
||||
}
|
||||
|
||||
array_init(return_value);
|
||||
|
||||
while (ptr && (limit == 0 || frameno < limit)) {
|
||||
frameno++;
|
||||
|
||||
@@ -150,6 +150,7 @@ ZEND_METHOD(Closure, call)
|
||||
fci.param_count = my_param_count;
|
||||
fci.object = fci_cache.object = newobj;
|
||||
fci_cache.initialized = 1;
|
||||
fci_cache.called_scope = Z_OBJCE_P(newthis);
|
||||
|
||||
if (fci_cache.function_handler->common.fn_flags & ZEND_ACC_GENERATOR) {
|
||||
zval new_closure;
|
||||
|
||||
+40
-24
@@ -190,10 +190,10 @@ typedef struct _builtin_type_info {
|
||||
} builtin_type_info;
|
||||
|
||||
static const builtin_type_info builtin_types[] = {
|
||||
{"int", sizeof("int") - 1, IS_LONG},
|
||||
{"float", sizeof("float") - 1, IS_DOUBLE},
|
||||
{"string", sizeof("string") - 1, IS_STRING},
|
||||
{"bool", sizeof("bool") - 1, _IS_BOOL},
|
||||
{ZEND_STRL("int"), IS_LONG},
|
||||
{ZEND_STRL("float"), IS_DOUBLE},
|
||||
{ZEND_STRL("string"), IS_STRING},
|
||||
{ZEND_STRL("bool"), _IS_BOOL},
|
||||
{NULL, 0, IS_UNDEF}
|
||||
};
|
||||
|
||||
@@ -2126,8 +2126,15 @@ static zend_op *zend_compile_class_ref(znode *result, zend_ast *name_ast, int th
|
||||
zend_compile_expr(&name_node, name_ast);
|
||||
|
||||
if (name_node.op_type == IS_CONST) {
|
||||
zend_string *name = Z_STR(name_node.u.constant);
|
||||
uint32_t fetch_type = zend_get_class_fetch_type(name);
|
||||
zend_string *name;
|
||||
uint32_t fetch_type;
|
||||
|
||||
if (Z_TYPE(name_node.u.constant) != IS_STRING) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Illegal class name");
|
||||
}
|
||||
|
||||
name = Z_STR(name_node.u.constant);
|
||||
fetch_type = zend_get_class_fetch_type(name);
|
||||
|
||||
opline = zend_emit_op(result, ZEND_FETCH_CLASS, NULL, NULL);
|
||||
opline->extended_value = fetch_type | (throw_exception ? ZEND_FETCH_CLASS_EXCEPTION : 0);
|
||||
@@ -2372,6 +2379,7 @@ zend_op *zend_compile_static_prop_common(znode *result, zend_ast *ast, uint32_t
|
||||
opline = zend_emit_op(result, ZEND_FETCH_R, &prop_node, NULL);
|
||||
}
|
||||
if (opline->op1_type == IS_CONST) {
|
||||
convert_to_string(CT_CONSTANT(opline->op1));
|
||||
zend_alloc_polymorphic_cache_slot(opline->op1.constant);
|
||||
}
|
||||
if (class_node.op_type == IS_CONST) {
|
||||
@@ -3575,8 +3583,6 @@ void zend_compile_return(zend_ast *ast) /* {{{ */
|
||||
zend_compile_expr(&expr_node, expr_ast);
|
||||
}
|
||||
|
||||
zend_handle_loops_and_finally();
|
||||
|
||||
if (CG(context).in_finally) {
|
||||
opline = zend_emit_op(NULL, ZEND_DISCARD_EXCEPTION, NULL, NULL);
|
||||
opline->op1_type = IS_TMP_VAR;
|
||||
@@ -3587,6 +3593,9 @@ void zend_compile_return(zend_ast *ast) /* {{{ */
|
||||
if (!(CG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) && CG(active_op_array)->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) {
|
||||
zend_emit_return_type_check(expr_ast ? &expr_node : NULL, CG(active_op_array)->arg_info - 1);
|
||||
}
|
||||
|
||||
zend_handle_loops_and_finally();
|
||||
|
||||
opline = zend_emit_op(NULL, by_ref ? ZEND_RETURN_BY_REF : ZEND_RETURN,
|
||||
&expr_node, NULL);
|
||||
|
||||
@@ -4376,6 +4385,11 @@ static void zend_compile_typename(zend_ast *ast, zend_arg_info *arg_info) /* {{{
|
||||
zend_uchar type = zend_lookup_builtin_type_by_name(class_name);
|
||||
|
||||
if (type != 0) {
|
||||
if (ast->attr != ZEND_NAME_NOT_FQ) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR,
|
||||
"Scalar type declaration '%s' must be unqualified",
|
||||
ZSTR_VAL(zend_string_tolower(class_name)));
|
||||
}
|
||||
arg_info->type_hint = type;
|
||||
} else {
|
||||
uint32_t fetch_type = zend_get_class_fetch_type_ast(ast);
|
||||
@@ -5623,7 +5637,7 @@ void zend_compile_namespace(zend_ast *ast) /* {{{ */
|
||||
}
|
||||
if (num > 0) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Namespace declaration statement has to be "
|
||||
"the very first statement in the script");
|
||||
"the very first statement or after any declare call in the script");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5792,12 +5806,9 @@ static inline void zend_ct_eval_unary_op(zval *result, uint32_t opcode, zval *op
|
||||
|
||||
static inline void zend_ct_eval_unary_pm(zval *result, zend_ast_kind kind, zval *op) /* {{{ */
|
||||
{
|
||||
binary_op_type fn = kind == ZEND_AST_UNARY_PLUS
|
||||
? add_function : sub_function;
|
||||
|
||||
zval left;
|
||||
ZVAL_LONG(&left, 0);
|
||||
fn(result, &left, op);
|
||||
ZVAL_LONG(&left, (kind == ZEND_AST_UNARY_PLUS) ? 1 : -1);
|
||||
mul_function(result, &left, op);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -5987,7 +5998,8 @@ void zend_compile_unary_op(znode *result, zend_ast *ast) /* {{{ */
|
||||
void zend_compile_unary_pm(znode *result, zend_ast *ast) /* {{{ */
|
||||
{
|
||||
zend_ast *expr_ast = ast->child[0];
|
||||
znode zero_node, expr_node;
|
||||
znode expr_node;
|
||||
znode lefthand_node;
|
||||
|
||||
ZEND_ASSERT(ast->kind == ZEND_AST_UNARY_PLUS || ast->kind == ZEND_AST_UNARY_MINUS);
|
||||
|
||||
@@ -6000,11 +6012,9 @@ void zend_compile_unary_pm(znode *result, zend_ast *ast) /* {{{ */
|
||||
return;
|
||||
}
|
||||
|
||||
zero_node.op_type = IS_CONST;
|
||||
ZVAL_LONG(&zero_node.u.constant, 0);
|
||||
|
||||
zend_emit_op_tmp(result, ast->kind == ZEND_AST_UNARY_PLUS ? ZEND_ADD : ZEND_SUB,
|
||||
&zero_node, &expr_node);
|
||||
lefthand_node.op_type = IS_CONST;
|
||||
ZVAL_LONG(&lefthand_node.u.constant, (ast->kind == ZEND_AST_UNARY_PLUS) ? 1 : -1);
|
||||
zend_emit_op_tmp(result, ZEND_MUL, &lefthand_node, &expr_node);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -7374,12 +7384,15 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
|
||||
case ZEND_AST_DIM:
|
||||
{
|
||||
/* constant expression should be always read context ... */
|
||||
|
||||
zval *container, *dim;
|
||||
|
||||
if (ast->child[1] == NULL) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Cannot use [] for reading");
|
||||
}
|
||||
|
||||
zend_eval_const_expr(&ast->child[0]);
|
||||
zend_eval_const_expr(&ast->child[1]);
|
||||
if (!ast->child[0] || !ast->child[1] || ast->child[0]->kind != ZEND_AST_ZVAL || ast->child[1]->kind != ZEND_AST_ZVAL) {
|
||||
if (ast->child[0]->kind != ZEND_AST_ZVAL || ast->child[1]->kind != ZEND_AST_ZVAL) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -7462,10 +7475,13 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
|
||||
|
||||
if (zend_try_compile_const_expr_resolve_class_name(&result, class_ast, name_ast, 0)) {
|
||||
if (Z_TYPE(result) == IS_NULL) {
|
||||
if (zend_get_class_fetch_type(zend_ast_get_str(class_ast)) == ZEND_FETCH_CLASS_SELF) {
|
||||
zend_ast_destroy(ast);
|
||||
*ast_ptr = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_CLASS_C);
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
zend_eval_const_expr(&class_ast);
|
||||
|
||||
+18
-9
@@ -70,29 +70,38 @@ ZEND_API zend_class_entry *zend_get_exception_base(zval *object)
|
||||
|
||||
void zend_exception_set_previous(zend_object *exception, zend_object *add_previous)
|
||||
{
|
||||
zval tmp, *previous, zv, *pzv, rv;
|
||||
zval *previous, *ancestor, *ex;
|
||||
zval pv, zv, rv;
|
||||
zend_class_entry *base_ce;
|
||||
|
||||
if (exception == add_previous || !add_previous || !exception) {
|
||||
return;
|
||||
}
|
||||
ZVAL_OBJ(&tmp, add_previous);
|
||||
if (!instanceof_function(Z_OBJCE(tmp), zend_ce_throwable)) {
|
||||
ZVAL_OBJ(&pv, add_previous);
|
||||
if (!instanceof_function(Z_OBJCE(pv), zend_ce_throwable)) {
|
||||
zend_error_noreturn(E_CORE_ERROR, "Previous exception must implement Throwable");
|
||||
return;
|
||||
}
|
||||
ZVAL_OBJ(&zv, exception);
|
||||
pzv = &zv;
|
||||
ex = &zv;
|
||||
do {
|
||||
base_ce = i_get_exception_base(pzv);
|
||||
previous = zend_read_property(base_ce, pzv, "previous", sizeof("previous")-1, 1, &rv);
|
||||
ancestor = zend_read_property(i_get_exception_base(&pv), &pv, "previous", sizeof("previous")-1, 1, &rv);
|
||||
while (Z_TYPE_P(ancestor) == IS_OBJECT) {
|
||||
if (Z_OBJ_P(ancestor) == Z_OBJ_P(ex)) {
|
||||
OBJ_RELEASE(add_previous);
|
||||
return;
|
||||
}
|
||||
ancestor = zend_read_property(i_get_exception_base(ancestor), ancestor, "previous", sizeof("previous")-1, 1, &rv);
|
||||
}
|
||||
base_ce = i_get_exception_base(ex);
|
||||
previous = zend_read_property(base_ce, ex, "previous", sizeof("previous")-1, 1, &rv);
|
||||
if (Z_TYPE_P(previous) == IS_NULL) {
|
||||
zend_update_property(base_ce, pzv, "previous", sizeof("previous")-1, &tmp);
|
||||
zend_update_property(base_ce, ex, "previous", sizeof("previous")-1, &pv);
|
||||
GC_REFCOUNT(add_previous)--;
|
||||
return;
|
||||
}
|
||||
pzv = previous;
|
||||
} while (pzv && Z_OBJ_P(pzv) != add_previous);
|
||||
ex = previous;
|
||||
} while (Z_OBJ_P(ex) != add_previous);
|
||||
}
|
||||
|
||||
void zend_exception_save(void) /* {{{ */
|
||||
|
||||
+18
-8
@@ -893,7 +893,7 @@ static zend_always_inline int zend_verify_missing_arg_type(zend_function *zf, ui
|
||||
return 1;
|
||||
}
|
||||
|
||||
static ZEND_COLD int zend_verify_missing_arg(zend_execute_data *execute_data, uint32_t arg_num, void **cache_slot)
|
||||
static ZEND_COLD void zend_verify_missing_arg(zend_execute_data *execute_data, uint32_t arg_num, void **cache_slot)
|
||||
{
|
||||
if (EXPECTED(!(EX(func)->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) ||
|
||||
UNEXPECTED(zend_verify_missing_arg_type(EX(func), arg_num, cache_slot))) {
|
||||
@@ -907,9 +907,7 @@ static ZEND_COLD int zend_verify_missing_arg(zend_execute_data *execute_data, ui
|
||||
} else {
|
||||
zend_error(E_WARNING, "Missing argument %u for %s%s%s()", arg_num, class_name, space, func_name);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static ZEND_COLD void zend_verify_return_error(const zend_function *zf, const char *need_msg, const char *need_kind, const char *returned_msg, const char *returned_kind)
|
||||
@@ -1956,6 +1954,12 @@ static zend_always_inline void zend_fetch_property_address(zval *result, zval *c
|
||||
return;
|
||||
}
|
||||
} else if (EXPECTED(zobj->properties != NULL)) {
|
||||
if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) {
|
||||
if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) {
|
||||
GC_REFCOUNT(zobj->properties)--;
|
||||
}
|
||||
zobj->properties = zend_array_dup(zobj->properties);
|
||||
}
|
||||
retval = zend_hash_find(zobj->properties, Z_STR_P(prop_ptr));
|
||||
if (EXPECTED(retval)) {
|
||||
ZVAL_INDIRECT(result, retval);
|
||||
@@ -2420,9 +2424,8 @@ static zend_always_inline zend_generator *zend_get_running_generator(zend_execut
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static zend_always_inline void i_cleanup_unfinished_execution(zend_execute_data *execute_data, uint32_t op_num, uint32_t catch_op_num) /* {{{ */
|
||||
static void cleanup_unfinished_calls(zend_execute_data *execute_data, uint32_t op_num) /* {{{ */
|
||||
{
|
||||
int i;
|
||||
if (UNEXPECTED(EX(call))) {
|
||||
zend_execute_data *call = EX(call);
|
||||
zend_op *opline = EX(func)->op_array.opcodes + op_num;
|
||||
@@ -2545,6 +2548,12 @@ static zend_always_inline void i_cleanup_unfinished_execution(zend_execute_data
|
||||
call = EX(call);
|
||||
} while (call);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void cleanup_live_vars(zend_execute_data *execute_data, uint32_t op_num, uint32_t catch_op_num) /* {{{ */
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < EX(func)->op_array.last_brk_cont; i++) {
|
||||
const zend_brk_cont_element *brk_cont = &EX(func)->op_array.brk_cont_array[i];
|
||||
@@ -2594,7 +2603,8 @@ static zend_always_inline void i_cleanup_unfinished_execution(zend_execute_data
|
||||
/* }}} */
|
||||
|
||||
void zend_cleanup_unfinished_execution(zend_execute_data *execute_data, uint32_t op_num, uint32_t catch_op_num) {
|
||||
i_cleanup_unfinished_execution(execute_data, op_num, catch_op_num);
|
||||
cleanup_unfinished_calls(execute_data, op_num);
|
||||
cleanup_live_vars(execute_data, op_num, catch_op_num);
|
||||
}
|
||||
|
||||
#ifdef HAVE_GCC_GLOBAL_REGS
|
||||
@@ -2736,9 +2746,9 @@ ZEND_API int ZEND_FASTCALL zend_check_arg_type(zend_function *zf, uint32_t arg_n
|
||||
return zend_verify_arg_type(zf, arg_num, arg, default_value, cache_slot);
|
||||
}
|
||||
|
||||
ZEND_API int ZEND_FASTCALL zend_check_missing_arg(zend_execute_data *execute_data, uint32_t arg_num, void **cache_slot)
|
||||
ZEND_API void ZEND_FASTCALL zend_check_missing_arg(zend_execute_data *execute_data, uint32_t arg_num, void **cache_slot)
|
||||
{
|
||||
return zend_verify_missing_arg(execute_data, arg_num, cache_slot);
|
||||
zend_verify_missing_arg(execute_data, arg_num, cache_slot);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ ZEND_API int zend_eval_stringl_ex(char *str, size_t str_len, zval *retval_ptr, c
|
||||
|
||||
ZEND_API void ZEND_FASTCALL zend_check_internal_arg_type(zend_function *zf, uint32_t arg_num, zval *arg);
|
||||
ZEND_API int ZEND_FASTCALL zend_check_arg_type(zend_function *zf, uint32_t arg_num, zval *arg, zval *default_value, void **cache_slot);
|
||||
ZEND_API int ZEND_FASTCALL zend_check_missing_arg(zend_execute_data *execute_data, uint32_t arg_num, void **cache_slot);
|
||||
ZEND_API void ZEND_FASTCALL zend_check_missing_arg(zend_execute_data *execute_data, uint32_t arg_num, void **cache_slot);
|
||||
|
||||
static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value, zend_uchar value_type)
|
||||
{
|
||||
|
||||
+11
-7
@@ -218,9 +218,9 @@ static void zend_throw_or_error(int fetch_type, zend_class_entry *exception_ce,
|
||||
zend_vspprintf(&message, 0, format, va);
|
||||
|
||||
if (fetch_type & ZEND_FETCH_CLASS_EXCEPTION) {
|
||||
zend_throw_error(exception_ce, message);
|
||||
zend_throw_error(exception_ce, "%s", message);
|
||||
} else {
|
||||
zend_error(E_ERROR, message);
|
||||
zend_error(E_ERROR, "%s", message);
|
||||
}
|
||||
|
||||
efree(message);
|
||||
@@ -397,6 +397,12 @@ void shutdown_executor(void) /* {{{ */
|
||||
|
||||
zend_shutdown_fpu();
|
||||
|
||||
#ifdef ZEND_DEBUG
|
||||
if (EG(ht_iterators_used)) {
|
||||
zend_error(E_WARNING, "Leaked %" PRIu32 " hashtable iterators", EG(ht_iterators_used));
|
||||
}
|
||||
#endif
|
||||
|
||||
EG(ht_iterators_used) = 0;
|
||||
if (EG(ht_iterators) != EG(ht_iterators_slots)) {
|
||||
efree(EG(ht_iterators));
|
||||
@@ -937,7 +943,6 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k
|
||||
zend_class_entry *ce = NULL;
|
||||
zval args[1];
|
||||
zval local_retval;
|
||||
int retval;
|
||||
zend_string *lc_name;
|
||||
zend_fcall_info fcall_info;
|
||||
zend_fcall_info_cache fcall_cache;
|
||||
@@ -1033,7 +1038,9 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k
|
||||
fcall_cache.object = NULL;
|
||||
|
||||
zend_exception_save();
|
||||
retval = zend_call_function(&fcall_info, &fcall_cache);
|
||||
if ((zend_call_function(&fcall_info, &fcall_cache) == SUCCESS) && !EG(exception)) {
|
||||
ce = zend_hash_find_ptr(EG(class_table), lc_name);
|
||||
}
|
||||
zend_exception_restore();
|
||||
|
||||
zval_ptr_dtor(&args[0]);
|
||||
@@ -1043,9 +1050,6 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k
|
||||
|
||||
zval_ptr_dtor(&local_retval);
|
||||
|
||||
if (retval == SUCCESS) {
|
||||
ce = zend_hash_find_ptr(EG(class_table), lc_name);
|
||||
}
|
||||
if (!key) {
|
||||
zend_string_release(lc_name);
|
||||
}
|
||||
|
||||
@@ -109,6 +109,14 @@ int zend_load_extension(const char *path)
|
||||
/* See http://support.microsoft.com/kb/190351 */
|
||||
#ifdef ZEND_WIN32
|
||||
fflush(stderr);
|
||||
#endif
|
||||
DL_UNLOAD(handle);
|
||||
return FAILURE;
|
||||
} else if (zend_get_extension(new_extension->name)) {
|
||||
fprintf(stderr, "Cannot load %s - extension already loaded\n", new_extension->name);
|
||||
/* See http://support.microsoft.com/kb/190351 */
|
||||
#ifdef PHP_WIN32
|
||||
fflush(stderr);
|
||||
#endif
|
||||
DL_UNLOAD(handle);
|
||||
return FAILURE;
|
||||
|
||||
@@ -242,6 +242,13 @@ ZEND_API void ZEND_FASTCALL gc_possible_root(zend_refcounted *ref)
|
||||
GC_REFCOUNT(ref)++;
|
||||
gc_collect_cycles();
|
||||
GC_REFCOUNT(ref)--;
|
||||
if (UNEXPECTED(GC_REFCOUNT(ref)) == 0) {
|
||||
zval_dtor_func_for_ptr(ref);
|
||||
return;
|
||||
}
|
||||
if (UNEXPECTED(GC_INFO(ref))) {
|
||||
return;
|
||||
}
|
||||
newRoot = GC_G(unused);
|
||||
if (!newRoot) {
|
||||
#if ZEND_GC_DEBUG
|
||||
|
||||
+35
-25
@@ -65,12 +65,6 @@ static void zend_generator_cleanup_unfinished_execution(zend_generator *generato
|
||||
|
||||
ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished_execution) /* {{{ */
|
||||
{
|
||||
zval_ptr_dtor(&generator->value);
|
||||
ZVAL_UNDEF(&generator->value);
|
||||
|
||||
zval_ptr_dtor(&generator->key);
|
||||
ZVAL_UNDEF(&generator->key);
|
||||
|
||||
if (UNEXPECTED(Z_TYPE(generator->values) != IS_UNDEF)) {
|
||||
zval_ptr_dtor(&generator->values);
|
||||
ZVAL_UNDEF(&generator->values);
|
||||
@@ -170,6 +164,10 @@ static void zend_generator_free_storage(zend_object *object) /* {{{ */
|
||||
|
||||
zend_generator_close(generator, 0);
|
||||
|
||||
/* we can't immediately free them in zend_generator_close() else yield from won't be able to fetch it */
|
||||
zval_ptr_dtor(&generator->value);
|
||||
zval_ptr_dtor(&generator->key);
|
||||
|
||||
if (EXPECTED(!Z_ISUNDEF(generator->retval))) {
|
||||
zval_ptr_dtor(&generator->retval);
|
||||
}
|
||||
@@ -289,6 +287,12 @@ ZEND_API zend_execute_data *zend_generator_check_placeholder_frame(zend_execute_
|
||||
|
||||
static void zend_generator_throw_exception(zend_generator *generator, zval *exception)
|
||||
{
|
||||
/* if we don't stop an array/iterator yield from, the exception will only reach the generator after the values were all iterated over */
|
||||
if (UNEXPECTED(Z_TYPE(generator->values) != IS_UNDEF)) {
|
||||
zval_ptr_dtor(&generator->values);
|
||||
ZVAL_UNDEF(&generator->values);
|
||||
}
|
||||
|
||||
/* Throw the exception in the context of the generator. Decrementing the opline
|
||||
* to pretend the exception happened during the YIELD opcode. */
|
||||
zend_execute_data *original_execute_data = EG(current_execute_data);
|
||||
@@ -508,6 +512,7 @@ ZEND_API zend_generator *zend_generator_update_current(zend_generator *generator
|
||||
|
||||
EG(current_execute_data) = original_execute_data;
|
||||
} else {
|
||||
ZVAL_COPY(&root->value, &root->node.parent->value);
|
||||
ZVAL_COPY(ZEND_CALL_VAR(root->execute_data, yield_from->result.var), &root->node.parent->retval);
|
||||
}
|
||||
}
|
||||
@@ -568,7 +573,7 @@ static int zend_generator_get_next_delegated_value(zend_generator *generator) /*
|
||||
if (iter->index++ > 0) {
|
||||
iter->funcs->move_forward(iter);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
goto failure;
|
||||
goto exception;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -578,7 +583,9 @@ static int zend_generator_get_next_delegated_value(zend_generator *generator) /*
|
||||
}
|
||||
|
||||
value = iter->funcs->get_current_data(iter);
|
||||
if (UNEXPECTED(EG(exception) != NULL || !value)) {
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
goto exception;
|
||||
} else if (UNEXPECTED(!value)) {
|
||||
goto failure;
|
||||
}
|
||||
|
||||
@@ -590,7 +597,7 @@ static int zend_generator_get_next_delegated_value(zend_generator *generator) /*
|
||||
iter->funcs->get_current_key(iter, &generator->key);
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
ZVAL_UNDEF(&generator->key);
|
||||
goto failure;
|
||||
goto exception;
|
||||
}
|
||||
} else {
|
||||
ZVAL_LONG(&generator->key, iter->index);
|
||||
@@ -598,6 +605,13 @@ static int zend_generator_get_next_delegated_value(zend_generator *generator) /*
|
||||
}
|
||||
return SUCCESS;
|
||||
|
||||
exception: {
|
||||
zend_execute_data *ex = EG(current_execute_data);
|
||||
EG(current_execute_data) = generator->execute_data;
|
||||
zend_throw_exception_internal(NULL);
|
||||
EG(current_execute_data) = ex;
|
||||
}
|
||||
|
||||
failure:
|
||||
zval_ptr_dtor(&generator->values);
|
||||
ZVAL_UNDEF(&generator->values);
|
||||
@@ -622,6 +636,11 @@ try_again:
|
||||
return;
|
||||
}
|
||||
|
||||
if (UNEXPECTED((orig_generator->flags & ZEND_GENERATOR_DO_INIT) != 0 && !Z_ISUNDEF(generator->value))) {
|
||||
/* We must not advance Generator if we yield from a Generator being currently run */
|
||||
return;
|
||||
}
|
||||
|
||||
if (UNEXPECTED(!Z_ISUNDEF(generator->values))) {
|
||||
if (EXPECTED(zend_generator_get_next_delegated_value(generator) == SUCCESS)) {
|
||||
return;
|
||||
@@ -630,11 +649,6 @@ try_again:
|
||||
* after the "yield from" expression. */
|
||||
}
|
||||
|
||||
if (UNEXPECTED((orig_generator->flags & ZEND_GENERATOR_DO_INIT) != 0) && !Z_ISUNDEF(generator->value)) {
|
||||
/* We must not advance Generator if we yield from a Generator being currently run */
|
||||
return;
|
||||
}
|
||||
|
||||
/* Drop the AT_FIRST_YIELD flag */
|
||||
orig_generator->flags &= ~ZEND_GENERATOR_AT_FIRST_YIELD;
|
||||
|
||||
@@ -708,7 +722,7 @@ try_again:
|
||||
|
||||
static void inline zend_generator_ensure_initialized(zend_generator *generator) /* {{{ */
|
||||
{
|
||||
if (EXPECTED(generator->execute_data) && UNEXPECTED(Z_TYPE(generator->value) == IS_UNDEF) && EXPECTED(generator->node.parent == NULL)) {
|
||||
if (UNEXPECTED(Z_TYPE(generator->value) == IS_UNDEF) && EXPECTED(generator->execute_data) && EXPECTED(generator->node.parent == NULL)) {
|
||||
generator->flags |= ZEND_GENERATOR_DO_INIT;
|
||||
zend_generator_resume(generator);
|
||||
generator->flags &= ~ZEND_GENERATOR_DO_INIT;
|
||||
@@ -759,7 +773,7 @@ ZEND_METHOD(Generator, valid)
|
||||
|
||||
zend_generator_get_current(generator);
|
||||
|
||||
RETURN_BOOL(EXPECTED(Z_TYPE(generator->value) != IS_UNDEF || generator->node.parent != NULL));
|
||||
RETURN_BOOL(EXPECTED(generator->execute_data != NULL));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -778,7 +792,7 @@ ZEND_METHOD(Generator, current)
|
||||
zend_generator_ensure_initialized(generator);
|
||||
|
||||
root = zend_generator_get_current(generator);
|
||||
if (EXPECTED(Z_TYPE(root->value) != IS_UNDEF)) {
|
||||
if (EXPECTED(generator->execute_data != NULL && Z_TYPE(root->value) != IS_UNDEF)) {
|
||||
zval *value = &root->value;
|
||||
|
||||
ZVAL_DEREF(value);
|
||||
@@ -802,7 +816,7 @@ ZEND_METHOD(Generator, key)
|
||||
zend_generator_ensure_initialized(generator);
|
||||
|
||||
root = zend_generator_get_current(generator);
|
||||
if (EXPECTED(Z_TYPE(root->key) != IS_UNDEF)) {
|
||||
if (EXPECTED(generator->execute_data != NULL && Z_TYPE(root->key) != IS_UNDEF)) {
|
||||
zval *key = &root->key;
|
||||
|
||||
ZVAL_DEREF(key);
|
||||
@@ -865,7 +879,7 @@ ZEND_METHOD(Generator, send)
|
||||
zend_generator_resume(generator);
|
||||
|
||||
root = zend_generator_get_current(generator);
|
||||
if (EXPECTED(Z_TYPE(root->value) != IS_UNDEF)) {
|
||||
if (EXPECTED(generator->execute_data)) {
|
||||
zval *value = &root->value;
|
||||
|
||||
ZVAL_DEREF(value);
|
||||
@@ -905,7 +919,7 @@ ZEND_METHOD(Generator, throw)
|
||||
zend_generator_resume(generator);
|
||||
|
||||
root = zend_generator_get_current(generator);
|
||||
if (Z_TYPE(root->value) != IS_UNDEF) {
|
||||
if (generator->execute_data) {
|
||||
zval *value = &root->value;
|
||||
|
||||
ZVAL_DEREF(value);
|
||||
@@ -982,11 +996,7 @@ static int zend_generator_iterator_valid(zend_object_iterator *iterator) /* {{{
|
||||
|
||||
zend_generator_get_current(generator);
|
||||
|
||||
if (EXPECTED(Z_TYPE(generator->value) != IS_UNDEF || generator->node.parent != NULL)) {
|
||||
return SUCCESS;
|
||||
} else {
|
||||
return FAILURE;
|
||||
}
|
||||
return generator->execute_data ? SUCCESS : FAILURE;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
+81
-21
@@ -31,6 +31,8 @@
|
||||
# define HT_ASSERT(c)
|
||||
#endif
|
||||
|
||||
#define HT_POISONED_PTR ((HashTable *) (intptr_t) -1)
|
||||
|
||||
#if ZEND_DEBUG
|
||||
/*
|
||||
#define HASH_MASK_CONSISTENCY 0xc0
|
||||
@@ -112,7 +114,7 @@ static uint32_t zend_always_inline zend_hash_check_size(uint32_t nSize)
|
||||
rather than using an undefined bis scan result. */
|
||||
return nSize;
|
||||
}
|
||||
#elif defined(__GNUC__) || __has_builtin(__builtin_clz)
|
||||
#elif (defined(__GNUC__) || __has_builtin(__builtin_clz)) && defined(PHP_HAVE_BUILTIN_CLZ)
|
||||
return 0x2 << (__builtin_clz(nSize - 1) ^ 0x1f);
|
||||
#else
|
||||
nSize -= 1;
|
||||
@@ -283,6 +285,40 @@ ZEND_API void ZEND_FASTCALL zend_hash_extend(HashTable *ht, uint32_t nSize, zend
|
||||
}
|
||||
}
|
||||
|
||||
static uint32_t zend_array_recalc_elements(HashTable *ht)
|
||||
{
|
||||
zval *val;
|
||||
uint32_t num = ht->nNumOfElements;
|
||||
|
||||
ZEND_HASH_FOREACH_VAL(ht, val) {
|
||||
if (Z_TYPE_P(val) == IS_UNDEF) continue;
|
||||
if (Z_TYPE_P(val) == IS_INDIRECT) {
|
||||
if (UNEXPECTED(Z_TYPE_P(Z_INDIRECT_P(val)) == IS_UNDEF)) {
|
||||
num--;
|
||||
}
|
||||
}
|
||||
} ZEND_HASH_FOREACH_END();
|
||||
return num;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API uint32_t zend_array_count(HashTable *ht)
|
||||
{
|
||||
uint32_t num;
|
||||
if (UNEXPECTED(ht->u.v.flags & HASH_FLAG_HAS_EMPTY_IND)) {
|
||||
num = zend_array_recalc_elements(ht);
|
||||
if (UNEXPECTED(ht->nNumOfElements == num)) {
|
||||
ht->u.v.flags &= ~HASH_FLAG_HAS_EMPTY_IND;
|
||||
}
|
||||
} else if (UNEXPECTED(ht == &EG(symbol_table))) {
|
||||
num = zend_array_recalc_elements(ht);
|
||||
} else {
|
||||
num = zend_hash_num_elements(ht);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API void ZEND_FASTCALL zend_hash_set_apply_protection(HashTable *ht, zend_bool bApplyProtection)
|
||||
{
|
||||
if (bApplyProtection) {
|
||||
@@ -337,7 +373,8 @@ ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterator_pos(uint32_t idx, HashTab
|
||||
if (iter->pos == HT_INVALID_IDX) {
|
||||
return HT_INVALID_IDX;
|
||||
} else if (UNEXPECTED(iter->ht != ht)) {
|
||||
if (EXPECTED(iter->ht) && EXPECTED(iter->ht->u.v.nIteratorsCount != 255)) {
|
||||
if (EXPECTED(iter->ht) && EXPECTED(iter->ht != HT_POISONED_PTR)
|
||||
&& EXPECTED(iter->ht->u.v.nIteratorsCount != 255)) {
|
||||
iter->ht->u.v.nIteratorsCount--;
|
||||
}
|
||||
if (EXPECTED(ht->u.v.nIteratorsCount != 255)) {
|
||||
@@ -349,13 +386,38 @@ ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterator_pos(uint32_t idx, HashTab
|
||||
return iter->pos;
|
||||
}
|
||||
|
||||
ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterator_pos_ex(uint32_t idx, zval *array)
|
||||
{
|
||||
HashTable *ht = Z_ARRVAL_P(array);
|
||||
HashTableIterator *iter = EG(ht_iterators) + idx;
|
||||
|
||||
ZEND_ASSERT(idx != (uint32_t)-1);
|
||||
if (iter->pos == HT_INVALID_IDX) {
|
||||
return HT_INVALID_IDX;
|
||||
} else if (UNEXPECTED(iter->ht != ht)) {
|
||||
if (EXPECTED(iter->ht) && EXPECTED(iter->ht != HT_POISONED_PTR)
|
||||
&& EXPECTED(iter->ht->u.v.nIteratorsCount != 255)) {
|
||||
iter->ht->u.v.nIteratorsCount--;
|
||||
}
|
||||
SEPARATE_ARRAY(array);
|
||||
ht = Z_ARRVAL_P(array);
|
||||
if (EXPECTED(ht->u.v.nIteratorsCount != 255)) {
|
||||
ht->u.v.nIteratorsCount++;
|
||||
}
|
||||
iter->ht = ht;
|
||||
iter->pos = ht->nInternalPointer;
|
||||
}
|
||||
return iter->pos;
|
||||
}
|
||||
|
||||
ZEND_API void ZEND_FASTCALL zend_hash_iterator_del(uint32_t idx)
|
||||
{
|
||||
HashTableIterator *iter = EG(ht_iterators) + idx;
|
||||
|
||||
ZEND_ASSERT(idx != (uint32_t)-1);
|
||||
|
||||
if (EXPECTED(iter->ht) && EXPECTED(iter->ht->u.v.nIteratorsCount != 255)) {
|
||||
if (EXPECTED(iter->ht) && EXPECTED(iter->ht != HT_POISONED_PTR)
|
||||
&& EXPECTED(iter->ht->u.v.nIteratorsCount != 255)) {
|
||||
iter->ht->u.v.nIteratorsCount--;
|
||||
}
|
||||
iter->ht = NULL;
|
||||
@@ -372,20 +434,13 @@ static zend_never_inline void ZEND_FASTCALL _zend_hash_iterators_remove(HashTabl
|
||||
{
|
||||
HashTableIterator *iter = EG(ht_iterators);
|
||||
HashTableIterator *end = iter + EG(ht_iterators_used);
|
||||
uint32_t idx;
|
||||
|
||||
while (iter != end) {
|
||||
if (iter->ht == ht) {
|
||||
iter->ht = NULL;
|
||||
iter->ht = HT_POISONED_PTR;
|
||||
}
|
||||
iter++;
|
||||
}
|
||||
|
||||
idx = EG(ht_iterators_used);
|
||||
while (idx > 0 && EG(ht_iterators)[idx - 1].ht == NULL) {
|
||||
idx--;
|
||||
}
|
||||
EG(ht_iterators_used) = idx;
|
||||
}
|
||||
|
||||
static zend_always_inline void zend_hash_iterators_remove(HashTable *ht)
|
||||
@@ -1049,9 +1104,14 @@ ZEND_API int ZEND_FASTCALL zend_hash_del_ind(HashTable *ht, zend_string *key)
|
||||
return FAILURE;
|
||||
} else {
|
||||
if (ht->pDestructor) {
|
||||
ht->pDestructor(data);
|
||||
zval tmp;
|
||||
ZVAL_COPY_VALUE(&tmp, data);
|
||||
ZVAL_UNDEF(data);
|
||||
ht->pDestructor(&tmp);
|
||||
} else {
|
||||
ZVAL_UNDEF(data);
|
||||
}
|
||||
ZVAL_UNDEF(data);
|
||||
ht->u.v.flags |= HASH_FLAG_HAS_EMPTY_IND;
|
||||
}
|
||||
} else {
|
||||
_zend_hash_del_el_ex(ht, idx, p, prev);
|
||||
@@ -1095,6 +1155,7 @@ ZEND_API int ZEND_FASTCALL zend_hash_str_del_ind(HashTable *ht, const char *str,
|
||||
ht->pDestructor(data);
|
||||
}
|
||||
ZVAL_UNDEF(data);
|
||||
ht->u.v.flags |= HASH_FLAG_HAS_EMPTY_IND;
|
||||
}
|
||||
} else {
|
||||
_zend_hash_del_el_ex(ht, idx, p, prev);
|
||||
@@ -1454,8 +1515,8 @@ ZEND_API void ZEND_FASTCALL zend_hash_apply(HashTable *ht, apply_func_t apply_fu
|
||||
HT_ASSERT(GC_REFCOUNT(ht) == 1);
|
||||
|
||||
HASH_PROTECT_RECURSION(ht);
|
||||
p = ht->arData;
|
||||
for (idx = 0; idx < ht->nNumUsed; idx++, p++) {
|
||||
for (idx = 0; idx < ht->nNumUsed; idx++) {
|
||||
p = ht->arData + idx;
|
||||
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
|
||||
result = apply_func(&p->val);
|
||||
|
||||
@@ -1480,8 +1541,8 @@ ZEND_API void ZEND_FASTCALL zend_hash_apply_with_argument(HashTable *ht, apply_f
|
||||
HT_ASSERT(GC_REFCOUNT(ht) == 1);
|
||||
|
||||
HASH_PROTECT_RECURSION(ht);
|
||||
p = ht->arData;
|
||||
for (idx = 0; idx < ht->nNumUsed; idx++, p++) {
|
||||
for (idx = 0; idx < ht->nNumUsed; idx++) {
|
||||
p = ht->arData + idx;
|
||||
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
|
||||
result = apply_func(&p->val, argument);
|
||||
|
||||
@@ -1509,8 +1570,8 @@ ZEND_API void ZEND_FASTCALL zend_hash_apply_with_arguments(HashTable *ht, apply_
|
||||
|
||||
HASH_PROTECT_RECURSION(ht);
|
||||
|
||||
p = ht->arData;
|
||||
for (idx = 0; idx < ht->nNumUsed; idx++, p++) {
|
||||
for (idx = 0; idx < ht->nNumUsed; idx++) {
|
||||
p = ht->arData + idx;
|
||||
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
|
||||
va_start(args, num_args);
|
||||
hash_key.h = p->h;
|
||||
@@ -1543,10 +1604,9 @@ ZEND_API void ZEND_FASTCALL zend_hash_reverse_apply(HashTable *ht, apply_func_t
|
||||
|
||||
HASH_PROTECT_RECURSION(ht);
|
||||
idx = ht->nNumUsed;
|
||||
p = ht->arData + idx;
|
||||
while (idx > 0) {
|
||||
idx--;
|
||||
p--;
|
||||
p = ht->arData + idx;
|
||||
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
|
||||
|
||||
result = apply_func(&p->val);
|
||||
|
||||
@@ -216,6 +216,7 @@ ZEND_API zval* ZEND_FASTCALL zend_hash_minmax(const HashTable *ht, compare_func_
|
||||
|
||||
ZEND_API int ZEND_FASTCALL zend_hash_rehash(HashTable *ht);
|
||||
|
||||
ZEND_API uint32_t zend_array_count(HashTable *ht);
|
||||
ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source);
|
||||
ZEND_API void ZEND_FASTCALL zend_array_destroy(HashTable *ht);
|
||||
ZEND_API void ZEND_FASTCALL zend_symtable_clean(HashTable *ht);
|
||||
@@ -224,6 +225,7 @@ ZEND_API int ZEND_FASTCALL _zend_handle_numeric_str_ex(const char *key, size_t l
|
||||
|
||||
ZEND_API uint32_t ZEND_FASTCALL zend_hash_iterator_add(HashTable *ht, HashPosition pos);
|
||||
ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterator_pos(uint32_t idx, HashTable *ht);
|
||||
ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterator_pos_ex(uint32_t idx, zval *array);
|
||||
ZEND_API void ZEND_FASTCALL zend_hash_iterator_del(uint32_t idx);
|
||||
ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterators_lower_pos(HashTable *ht, HashPosition start);
|
||||
ZEND_API void ZEND_FASTCALL _zend_hash_iterators_update(HashTable *ht, HashPosition from, HashPosition to);
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "zend_highlight.h"
|
||||
#include "zend_ptr_stack.h"
|
||||
#include "zend_globals.h"
|
||||
#include "zend_exceptions.h"
|
||||
|
||||
ZEND_API void zend_html_putc(char c)
|
||||
{
|
||||
@@ -168,6 +169,9 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
|
||||
}
|
||||
zend_printf("</span>\n");
|
||||
zend_printf("</code>");
|
||||
|
||||
/* Discard parse errors thrown during tokenization */
|
||||
zend_clear_exception();
|
||||
}
|
||||
|
||||
ZEND_API void zend_strip(void)
|
||||
|
||||
@@ -106,16 +106,19 @@ static void zend_ini_add_string(zval *result, zval *op1, zval *op2)
|
||||
|
||||
if (Z_TYPE_P(op1) != IS_STRING) {
|
||||
zend_string *str = zval_get_string(op1);
|
||||
ZVAL_PSTRINGL(op1, str->val, str->len);
|
||||
/* ZEND_ASSERT(!Z_REFCOUNTED_P(op1)); */
|
||||
ZVAL_PSTRINGL(op1, ZSTR_VAL(str), ZSTR_LEN(str));
|
||||
zend_string_release(str);
|
||||
}
|
||||
|
||||
op1_len = (int)Z_STRLEN_P(op1);
|
||||
|
||||
if (Z_TYPE_P(op2) != IS_STRING) {
|
||||
convert_to_string(op2);
|
||||
}
|
||||
length = op1_len + (int)Z_STRLEN_P(op2);
|
||||
|
||||
ZVAL_NEW_STR(result, zend_string_extend(Z_STR_P(op1), length, 1));
|
||||
memcpy(Z_STRVAL_P(result)+op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2));
|
||||
Z_STRVAL_P(result)[length] = 0;
|
||||
memcpy(Z_STRVAL_P(result) + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2) + 1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
|
||||
|
||||
/* Eat leading whitespace */
|
||||
#define EAT_LEADING_WHITESPACE() \
|
||||
while (yytext[0]) { \
|
||||
while (yyleng) { \
|
||||
if (yytext[0] == ' ' || yytext[0] == '\t') { \
|
||||
SCNG(yy_text)++; \
|
||||
yyleng--; \
|
||||
@@ -125,7 +125,7 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
|
||||
|
||||
/* Eat trailing whitespace + extra char */
|
||||
#define EAT_TRAILING_WHITESPACE_EX(ch) \
|
||||
while (yyleng > 0 && ( \
|
||||
while (yyleng && ( \
|
||||
(ch != 'X' && yytext[yyleng - 1] == ch) || \
|
||||
yytext[yyleng - 1] == '\n' || \
|
||||
yytext[yyleng - 1] == '\r' || \
|
||||
|
||||
@@ -112,7 +112,7 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
|
||||
|
||||
/* Eat leading whitespace */
|
||||
#define EAT_LEADING_WHITESPACE() \
|
||||
while (yytext[0]) { \
|
||||
while (yyleng) { \
|
||||
if (yytext[0] == ' ' || yytext[0] == '\t') { \
|
||||
SCNG(yy_text)++; \
|
||||
yyleng--; \
|
||||
@@ -123,7 +123,7 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
|
||||
|
||||
/* Eat trailing whitespace + extra char */
|
||||
#define EAT_TRAILING_WHITESPACE_EX(ch) \
|
||||
while (yyleng > 0 && ( \
|
||||
while (yyleng && ( \
|
||||
(ch != 'X' && yytext[yyleng - 1] == ch) || \
|
||||
yytext[yyleng - 1] == '\n' || \
|
||||
yytext[yyleng - 1] == '\r' || \
|
||||
|
||||
+44
-28
@@ -1278,50 +1278,66 @@ isset_variable:
|
||||
would have been. */
|
||||
static YYSIZE_T zend_yytnamerr(char *yyres, const char *yystr)
|
||||
{
|
||||
if (!yyres) {
|
||||
return yystrlen(yystr);
|
||||
/* CG(parse_error) states:
|
||||
* 0 => yyres = NULL, yystr is the unexpected token
|
||||
* 1 => yyres = NULL, yystr is one of the expected tokens
|
||||
* 2 => yyres != NULL, yystr is the unexpected token
|
||||
* 3 => yyres != NULL, yystr is one of the expected tokens
|
||||
*/
|
||||
if (yyres && CG(parse_error) < 2) {
|
||||
CG(parse_error) = 2;
|
||||
}
|
||||
{
|
||||
if (CG(parse_error) == 0) {
|
||||
char buffer[120];
|
||||
const unsigned char *end, *str, *tok1 = NULL, *tok2 = NULL;
|
||||
unsigned int len = 0, toklen = 0, yystr_len;
|
||||
|
||||
CG(parse_error) = 1;
|
||||
if (CG(parse_error) % 2 == 0) {
|
||||
/* The unexpected token */
|
||||
char buffer[120];
|
||||
const unsigned char *end, *str, *tok1 = NULL, *tok2 = NULL;
|
||||
unsigned int len = 0, toklen = 0, yystr_len;
|
||||
|
||||
if (LANG_SCNG(yy_text)[0] == 0 &&
|
||||
LANG_SCNG(yy_leng) == 1 &&
|
||||
memcmp(yystr, "\"end of file\"", sizeof("\"end of file\"") - 1) == 0) {
|
||||
CG(parse_error)++;
|
||||
|
||||
if (LANG_SCNG(yy_text)[0] == 0 &&
|
||||
LANG_SCNG(yy_leng) == 1 &&
|
||||
memcmp(yystr, "\"end of file\"", sizeof("\"end of file\"") - 1) == 0) {
|
||||
if (yyres) {
|
||||
yystpcpy(yyres, "end of file");
|
||||
return sizeof("end of file")-1;
|
||||
}
|
||||
return sizeof("end of file")-1;
|
||||
}
|
||||
|
||||
str = LANG_SCNG(yy_text);
|
||||
end = memchr(str, '\n', LANG_SCNG(yy_leng));
|
||||
yystr_len = (unsigned int)yystrlen(yystr);
|
||||
str = LANG_SCNG(yy_text);
|
||||
end = memchr(str, '\n', LANG_SCNG(yy_leng));
|
||||
yystr_len = (unsigned int)yystrlen(yystr);
|
||||
|
||||
if ((tok1 = memchr(yystr, '(', yystr_len)) != NULL
|
||||
&& (tok2 = zend_memrchr(yystr, ')', yystr_len)) != NULL) {
|
||||
toklen = (tok2 - tok1) + 1;
|
||||
} else {
|
||||
tok1 = tok2 = NULL;
|
||||
toklen = 0;
|
||||
}
|
||||
if ((tok1 = memchr(yystr, '(', yystr_len)) != NULL
|
||||
&& (tok2 = zend_memrchr(yystr, ')', yystr_len)) != NULL) {
|
||||
toklen = (tok2 - tok1) + 1;
|
||||
} else {
|
||||
tok1 = tok2 = NULL;
|
||||
toklen = 0;
|
||||
}
|
||||
|
||||
if (end == NULL) {
|
||||
len = LANG_SCNG(yy_leng) > 30 ? 30 : LANG_SCNG(yy_leng);
|
||||
} else {
|
||||
len = (end - str) > 30 ? 30 : (end - str);
|
||||
}
|
||||
if (end == NULL) {
|
||||
len = LANG_SCNG(yy_leng) > 30 ? 30 : LANG_SCNG(yy_leng);
|
||||
} else {
|
||||
len = (end - str) > 30 ? 30 : (end - str);
|
||||
}
|
||||
if (yyres) {
|
||||
if (toklen) {
|
||||
snprintf(buffer, sizeof(buffer), "'%.*s' %.*s", len, str, toklen, tok1);
|
||||
} else {
|
||||
snprintf(buffer, sizeof(buffer), "'%.*s'", len, str);
|
||||
}
|
||||
yystpcpy(yyres, buffer);
|
||||
return len + (toklen ? toklen + 1 : 0) + 2;
|
||||
}
|
||||
return len + (toklen ? toklen + 1 : 0) + 2;
|
||||
}
|
||||
|
||||
/* One of the expected tokens */
|
||||
if (!yyres) {
|
||||
return yystrlen(yystr) - (*yystr == '"' ? 2 : 0);
|
||||
}
|
||||
|
||||
if (*yystr == '"') {
|
||||
YYSIZE_T yyn = 0;
|
||||
const char *yyp = yystr;
|
||||
|
||||
+1
-1
@@ -84,7 +84,7 @@ static void zend_resource_dtor(zend_resource *res)
|
||||
ZEND_API int zend_list_close(zend_resource *res)
|
||||
{
|
||||
if (GC_REFCOUNT(res) <= 0) {
|
||||
return zend_list_delete(res);
|
||||
return zend_list_free(res);
|
||||
} else if (res->type >= 0) {
|
||||
zend_resource_dtor(res);
|
||||
}
|
||||
|
||||
@@ -275,10 +275,10 @@ static zend_always_inline int zend_verify_property_access(zend_property_info *pr
|
||||
return 1;
|
||||
} else if (property_info->flags & ZEND_ACC_PRIVATE) {
|
||||
return (ce == EG(scope) || property_info->ce == EG(scope));
|
||||
} else {
|
||||
ZEND_ASSERT(property_info->flags & ZEND_ACC_PROTECTED);
|
||||
} else if (property_info->flags & ZEND_ACC_PROTECTED) {
|
||||
return zend_check_protected(property_info->ce, EG(scope));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -1526,9 +1526,18 @@ ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int ty
|
||||
if (ce->__tostring &&
|
||||
(zend_call_method_with_0_params(readobj, ce, &ce->__tostring, "__tostring", &retval) || EG(exception))) {
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
zval *msg, ex, rv;
|
||||
zval_ptr_dtor(&retval);
|
||||
ZVAL_OBJ(&ex, EG(exception));
|
||||
EG(exception) = NULL;
|
||||
zend_error_noreturn(E_ERROR, "Method %s::__toString() must not throw an exception", ZSTR_VAL(ce->name));
|
||||
msg = zend_read_property(Z_OBJCE(ex), &ex, "message", sizeof("message") - 1, 1, &rv);
|
||||
if (UNEXPECTED(Z_TYPE_P(msg) != IS_STRING)) {
|
||||
ZVAL_EMPTY_STRING(&rv);
|
||||
msg = &rv;
|
||||
}
|
||||
zend_error_noreturn(E_ERROR,
|
||||
"Method %s::__toString() must not throw an exception, caught %s: %s",
|
||||
ZSTR_VAL(ce->name), ZSTR_VAL(Z_OBJCE(ex)->name), Z_STRVAL_P(msg));
|
||||
return FAILURE;
|
||||
}
|
||||
if (EXPECTED(Z_TYPE(retval) == IS_STRING)) {
|
||||
|
||||
@@ -2277,7 +2277,7 @@ try_again:
|
||||
zval *val;
|
||||
|
||||
val = Z_OBJ_HANDLER_P(op1, get)(op1, &rv);
|
||||
Z_ADDREF_P(val);
|
||||
Z_TRY_ADDREF_P(val);
|
||||
increment_function(val);
|
||||
Z_OBJ_HANDLER_P(op1, set)(op1, val);
|
||||
zval_ptr_dtor(val);
|
||||
@@ -2345,7 +2345,7 @@ try_again:
|
||||
zval *val;
|
||||
|
||||
val = Z_OBJ_HANDLER_P(op1, get)(op1, &rv);
|
||||
Z_ADDREF_P(val);
|
||||
Z_TRY_ADDREF_P(val);
|
||||
decrement_function(val);
|
||||
Z_OBJ_HANDLER_P(op1, set)(op1, val);
|
||||
zval_ptr_dtor(val);
|
||||
|
||||
@@ -757,7 +757,7 @@ static zend_always_inline int fast_is_not_identical_function(zval *op1, zval *op
|
||||
int ret; \
|
||||
zval rv; \
|
||||
zval *objval = Z_OBJ_HANDLER_P(op1, get)(op1, &rv); \
|
||||
Z_ADDREF_P(objval); \
|
||||
Z_TRY_ADDREF_P(objval); \
|
||||
ret = binary_op(objval, objval, op2); \
|
||||
Z_OBJ_HANDLER_P(op1, set)(op1, objval); \
|
||||
zval_ptr_dtor(objval); \
|
||||
|
||||
@@ -459,6 +459,9 @@ CWD_API void virtual_cwd_startup(void) /* {{{ */
|
||||
}
|
||||
}
|
||||
#else
|
||||
#ifdef ZEND_WIN32
|
||||
ZeroMemory(&cwd, sizeof(cwd));
|
||||
#endif
|
||||
result = getcwd(cwd, sizeof(cwd));
|
||||
#endif
|
||||
if (!result) {
|
||||
@@ -1563,6 +1566,20 @@ CWD_API int virtual_chmod(const char *filename, mode_t mode) /* {{{ */
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
{
|
||||
mode_t _tmp = mode;
|
||||
|
||||
mode = 0;
|
||||
|
||||
if (_tmp & _S_IREAD) {
|
||||
mode |= _S_IREAD;
|
||||
}
|
||||
if (_tmp & _S_IWRITE) {
|
||||
mode |= _S_IWRITE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
ret = chmod(new_state.cwd, mode);
|
||||
|
||||
CWD_STATE_FREE_ERR(&new_state);
|
||||
|
||||
+38
-35
@@ -328,12 +328,9 @@ ZEND_VM_HANDLER(15, ZEND_IS_IDENTICAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
FREE_OP1();
|
||||
FREE_OP2();
|
||||
ZEND_VM_SMART_BRANCH(result, (OP1_TYPE|OP2_TYPE) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((OP1_TYPE|OP2_TYPE) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
ZEND_VM_HANDLER(16, ZEND_IS_NOT_IDENTICAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
|
||||
@@ -349,12 +346,9 @@ ZEND_VM_HANDLER(16, ZEND_IS_NOT_IDENTICAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
FREE_OP1();
|
||||
FREE_OP2();
|
||||
ZEND_VM_SMART_BRANCH(result, (OP1_TYPE|OP2_TYPE) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((OP1_TYPE|OP2_TYPE) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
ZEND_VM_HANDLER(17, ZEND_IS_EQUAL, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
|
||||
@@ -1543,6 +1537,9 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMPVAR|CV, UNUSED|CONST|V
|
||||
}
|
||||
retval = zend_std_get_static_property(ce, name, 0);
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
if (OP1_TYPE != IS_CONST) {
|
||||
zend_string_release(name);
|
||||
}
|
||||
FREE_OP1();
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
@@ -2386,7 +2383,7 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
const zend_op *old_opline = EX(opline);
|
||||
zend_throw_exception_internal(NULL);
|
||||
if (RETURN_VALUE_USED(old_opline)) {
|
||||
if (old_opline->opcode != ZEND_HANDLE_EXCEPTION && RETURN_VALUE_USED(old_opline)) {
|
||||
zval_ptr_dtor(EX_VAR(old_opline->result.var));
|
||||
}
|
||||
HANDLE_EXCEPTION_LEAVE();
|
||||
@@ -3108,8 +3105,8 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMPVAR|UNUSE
|
||||
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
|
||||
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
|
||||
object = Z_OBJ(EX(This));
|
||||
}
|
||||
if (!object) {
|
||||
ce = object->ce;
|
||||
} else {
|
||||
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
|
||||
/* Allowed for PHP 4 compatibility. */
|
||||
zend_error(
|
||||
@@ -4714,9 +4711,8 @@ ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY)
|
||||
|
||||
if (UNEXPECTED(arg_num > EX_NUM_ARGS())) {
|
||||
SAVE_OPLINE();
|
||||
if (UNEXPECTED(!zend_verify_missing_arg(execute_data, arg_num, CACHE_ADDR(opline->op2.num)))) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
zend_verify_missing_arg(execute_data, arg_num, CACHE_ADDR(opline->op2.num));
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
} else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
|
||||
zval *param = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var);
|
||||
|
||||
@@ -5520,8 +5516,14 @@ ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMPVAR|CV, UNUSED|CONST|VAR)
|
||||
ZVAL_UNDEF(var);
|
||||
zval_dtor_func_for_ptr(garbage);
|
||||
} else {
|
||||
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
|
||||
ZVAL_UNDEF(var);
|
||||
zval *z = var;
|
||||
ZVAL_DEREF(z);
|
||||
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
|
||||
ZVAL_UNDEF(var);
|
||||
gc_possible_root(Z_COUNTED_P(z));
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
@@ -5852,8 +5854,9 @@ ZEND_VM_HANDLER(125, ZEND_FE_RESET_RW, CONST|TMP|VAR|CV, ANY)
|
||||
Z_ADDREF_P(array_ref);
|
||||
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), array_ref);
|
||||
} else {
|
||||
array_ptr = EX_VAR(opline->result.var);
|
||||
ZVAL_COPY_VALUE(array_ptr, array_ref);
|
||||
array_ref = EX_VAR(opline->result.var);
|
||||
ZVAL_NEW_REF(array_ref, array_ptr);
|
||||
array_ptr = Z_REFVAL_P(array_ref);
|
||||
}
|
||||
if (OP1_TYPE == IS_CONST) {
|
||||
zval_copy_ctor_func(array_ptr);
|
||||
@@ -6179,8 +6182,8 @@ ZEND_VM_HANDLER(126, ZEND_FE_FETCH_RW, VAR, ANY)
|
||||
|
||||
ZVAL_DEREF(array);
|
||||
if (EXPECTED(Z_TYPE_P(array) == IS_ARRAY)) {
|
||||
pos = zend_hash_iterator_pos_ex(Z_FE_ITER_P(EX_VAR(opline->op1.var)), array);
|
||||
fe_ht = Z_ARRVAL_P(array);
|
||||
pos = zend_hash_iterator_pos(Z_FE_ITER_P(EX_VAR(opline->op1.var)), fe_ht);
|
||||
p = fe_ht->arData + pos;
|
||||
while (1) {
|
||||
if (UNEXPECTED(pos >= fe_ht->nNumUsed)) {
|
||||
@@ -7125,11 +7128,12 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
|
||||
}
|
||||
}
|
||||
|
||||
i_cleanup_unfinished_execution(execute_data, op_num, catch_op_num);
|
||||
cleanup_unfinished_calls(execute_data, op_num);
|
||||
|
||||
if (finally_op_num && (!catch_op_num || catch_op_num >= finally_op_num)) {
|
||||
zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[finally_op_end].op1.var);
|
||||
|
||||
cleanup_live_vars(execute_data, op_num, finally_op_num);
|
||||
if (in_finally && Z_OBJ_P(fast_call)) {
|
||||
zend_exception_set_previous(EG(exception), Z_OBJ_P(fast_call));
|
||||
}
|
||||
@@ -7139,6 +7143,7 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
|
||||
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[finally_op_num]);
|
||||
ZEND_VM_CONTINUE();
|
||||
} else {
|
||||
cleanup_live_vars(execute_data, op_num, catch_op_num);
|
||||
if (in_finally) {
|
||||
/* we are going out of current finally scope */
|
||||
zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[finally_op_end].op1.var);
|
||||
@@ -7177,14 +7182,10 @@ ZEND_VM_HANDLER(150, ZEND_USER_OPCODE, ANY, ANY)
|
||||
|
||||
SAVE_OPLINE();
|
||||
ret = zend_user_opcode_handlers[opline->opcode](execute_data);
|
||||
|
||||
if (EG(exception)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
opline = EX(opline);
|
||||
|
||||
switch (ret) {
|
||||
case ZEND_USER_OPCODE_CONTINUE:
|
||||
LOAD_OPLINE();
|
||||
ZEND_VM_CONTINUE();
|
||||
case ZEND_USER_OPCODE_RETURN:
|
||||
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
|
||||
@@ -7197,13 +7198,10 @@ ZEND_VM_HANDLER(150, ZEND_USER_OPCODE, ANY, ANY)
|
||||
case ZEND_USER_OPCODE_ENTER:
|
||||
ZEND_VM_ENTER();
|
||||
case ZEND_USER_OPCODE_LEAVE:
|
||||
LOAD_OPLINE();
|
||||
ZEND_VM_LEAVE();
|
||||
case ZEND_USER_OPCODE_DISPATCH:
|
||||
ZEND_ASSERT(EX(opline) == opline);
|
||||
ZEND_VM_DISPATCH(opline->opcode, opline);
|
||||
default:
|
||||
ZEND_ASSERT(EX(opline) == opline);
|
||||
ZEND_VM_DISPATCH((zend_uchar)(ret & 0xff), opline);
|
||||
}
|
||||
}
|
||||
@@ -7565,20 +7563,25 @@ ZEND_VM_HANDLER(163, ZEND_FAST_RET, ANY, ANY)
|
||||
USE_OPLINE
|
||||
|
||||
if (opline->extended_value == ZEND_FAST_RET_TO_FINALLY) {
|
||||
cleanup_live_vars(execute_data, opline - EX(func)->op_array.opcodes, opline->op2.opline_num);
|
||||
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
|
||||
ZEND_VM_CONTINUE();
|
||||
} else {
|
||||
EG(exception) = Z_OBJ_P(fast_call);
|
||||
Z_OBJ_P(fast_call) = NULL;
|
||||
if (opline->extended_value == ZEND_FAST_RET_TO_CATCH) {
|
||||
cleanup_live_vars(execute_data, opline - EX(func)->op_array.opcodes, opline->op2.opline_num);
|
||||
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
|
||||
ZEND_VM_CONTINUE();
|
||||
} else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
|
||||
zend_generator *generator = zend_get_running_generator(execute_data);
|
||||
zend_generator_close(generator, 1);
|
||||
ZEND_VM_RETURN();
|
||||
} else {
|
||||
ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper);
|
||||
cleanup_live_vars(execute_data, opline - EX(func)->op_array.opcodes, 0);
|
||||
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
|
||||
zend_generator *generator = zend_get_running_generator(execute_data);
|
||||
zend_generator_close(generator, 1);
|
||||
ZEND_VM_RETURN();
|
||||
} else {
|
||||
ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+209
-221
@@ -501,7 +501,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
const zend_op *old_opline = EX(opline);
|
||||
zend_throw_exception_internal(NULL);
|
||||
if (RETURN_VALUE_USED(old_opline)) {
|
||||
if (old_opline->opcode != ZEND_HANDLE_EXCEPTION && RETURN_VALUE_USED(old_opline)) {
|
||||
zval_ptr_dtor(EX_VAR(old_opline->result.var));
|
||||
}
|
||||
HANDLE_EXCEPTION_LEAVE();
|
||||
@@ -1204,9 +1204,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_
|
||||
|
||||
if (UNEXPECTED(arg_num > EX_NUM_ARGS())) {
|
||||
SAVE_OPLINE();
|
||||
if (UNEXPECTED(!zend_verify_missing_arg(execute_data, arg_num, CACHE_ADDR(opline->op2.num)))) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
zend_verify_missing_arg(execute_data, arg_num, CACHE_ADDR(opline->op2.num));
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
} else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
|
||||
zval *param = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var);
|
||||
|
||||
@@ -1515,11 +1514,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(
|
||||
}
|
||||
}
|
||||
|
||||
i_cleanup_unfinished_execution(execute_data, op_num, catch_op_num);
|
||||
cleanup_unfinished_calls(execute_data, op_num);
|
||||
|
||||
if (finally_op_num && (!catch_op_num || catch_op_num >= finally_op_num)) {
|
||||
zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[finally_op_end].op1.var);
|
||||
|
||||
cleanup_live_vars(execute_data, op_num, finally_op_num);
|
||||
if (in_finally && Z_OBJ_P(fast_call)) {
|
||||
zend_exception_set_previous(EG(exception), Z_OBJ_P(fast_call));
|
||||
}
|
||||
@@ -1529,6 +1529,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(
|
||||
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[finally_op_num]);
|
||||
ZEND_VM_CONTINUE();
|
||||
} else {
|
||||
cleanup_live_vars(execute_data, op_num, catch_op_num);
|
||||
if (in_finally) {
|
||||
/* we are going out of current finally scope */
|
||||
zval *fast_call = EX_VAR(EX(func)->op_array.opcodes[finally_op_end].op1.var);
|
||||
@@ -1567,14 +1568,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_
|
||||
|
||||
SAVE_OPLINE();
|
||||
ret = zend_user_opcode_handlers[opline->opcode](execute_data);
|
||||
|
||||
if (EG(exception)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
opline = EX(opline);
|
||||
|
||||
switch (ret) {
|
||||
case ZEND_USER_OPCODE_CONTINUE:
|
||||
LOAD_OPLINE();
|
||||
ZEND_VM_CONTINUE();
|
||||
case ZEND_USER_OPCODE_RETURN:
|
||||
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
|
||||
@@ -1587,13 +1584,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_
|
||||
case ZEND_USER_OPCODE_ENTER:
|
||||
ZEND_VM_ENTER();
|
||||
case ZEND_USER_OPCODE_LEAVE:
|
||||
LOAD_OPLINE();
|
||||
ZEND_VM_LEAVE();
|
||||
case ZEND_USER_OPCODE_DISPATCH:
|
||||
ZEND_ASSERT(EX(opline) == opline);
|
||||
ZEND_VM_DISPATCH(opline->opcode, opline);
|
||||
default:
|
||||
ZEND_ASSERT(EX(opline) == opline);
|
||||
ZEND_VM_DISPATCH((zend_uchar)(ret & 0xff), opline);
|
||||
}
|
||||
}
|
||||
@@ -1647,20 +1641,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FAST_RET_SPEC_HANDLER(ZEND_OPC
|
||||
USE_OPLINE
|
||||
|
||||
if (opline->extended_value == ZEND_FAST_RET_TO_FINALLY) {
|
||||
cleanup_live_vars(execute_data, opline - EX(func)->op_array.opcodes, opline->op2.opline_num);
|
||||
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
|
||||
ZEND_VM_CONTINUE();
|
||||
} else {
|
||||
EG(exception) = Z_OBJ_P(fast_call);
|
||||
Z_OBJ_P(fast_call) = NULL;
|
||||
if (opline->extended_value == ZEND_FAST_RET_TO_CATCH) {
|
||||
cleanup_live_vars(execute_data, opline - EX(func)->op_array.opcodes, opline->op2.opline_num);
|
||||
ZEND_VM_SET_OPCODE(&EX(func)->op_array.opcodes[opline->op2.opline_num]);
|
||||
ZEND_VM_CONTINUE();
|
||||
} else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
|
||||
zend_generator *generator = zend_get_running_generator(execute_data);
|
||||
zend_generator_close(generator, 1);
|
||||
ZEND_VM_RETURN();
|
||||
} else {
|
||||
ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
|
||||
cleanup_live_vars(execute_data, opline - EX(func)->op_array.opcodes, 0);
|
||||
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
|
||||
zend_generator *generator = zend_get_running_generator(execute_data);
|
||||
zend_generator_close(generator, 1);
|
||||
ZEND_VM_RETURN();
|
||||
} else {
|
||||
ZEND_VM_TAIL_CALL(zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3834,8 +3833,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_CONST_HANDLER
|
||||
Z_ADDREF_P(array_ref);
|
||||
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), array_ref);
|
||||
} else {
|
||||
array_ptr = EX_VAR(opline->result.var);
|
||||
ZVAL_COPY_VALUE(array_ptr, array_ref);
|
||||
array_ref = EX_VAR(opline->result.var);
|
||||
ZVAL_NEW_REF(array_ref, array_ptr);
|
||||
array_ptr = Z_REFVAL_P(array_ref);
|
||||
}
|
||||
if (IS_CONST == IS_CONST) {
|
||||
zval_copy_ctor_func(array_ptr);
|
||||
@@ -4596,12 +4596,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_CONST_
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_CONST) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CONST|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -4617,12 +4614,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CO
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_CONST) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CONST|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -5003,6 +4997,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
|
||||
}
|
||||
retval = zend_std_get_static_property(ce, name, 0);
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
if (IS_CONST != IS_CONST) {
|
||||
zend_string_release(name);
|
||||
}
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
@@ -5699,8 +5696,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
|
||||
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
|
||||
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
|
||||
object = Z_OBJ(EX(This));
|
||||
}
|
||||
if (!object) {
|
||||
ce = object->ce;
|
||||
} else {
|
||||
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
|
||||
/* Allowed for PHP 4 compatibility. */
|
||||
zend_error(
|
||||
@@ -6119,8 +6116,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_CONST_HAN
|
||||
ZVAL_UNDEF(var);
|
||||
zval_dtor_func_for_ptr(garbage);
|
||||
} else {
|
||||
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
|
||||
ZVAL_UNDEF(var);
|
||||
zval *z = var;
|
||||
ZVAL_DEREF(z);
|
||||
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
|
||||
ZVAL_UNDEF(var);
|
||||
gc_possible_root(Z_COUNTED_P(z));
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
@@ -6646,12 +6649,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_TMP_HA
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CONST|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -6667,12 +6667,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_TM
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CONST|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -6829,12 +6826,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_VAR_HA
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CONST|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -6850,12 +6844,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_VA
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CONST|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_VAR(int type ZEND_OPCODE_HANDLER_ARGS_DC)
|
||||
@@ -6925,6 +6916,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
|
||||
}
|
||||
retval = zend_std_get_static_property(ce, name, 0);
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
if (IS_CONST != IS_CONST) {
|
||||
zend_string_release(name);
|
||||
}
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
@@ -7060,8 +7054,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_VAR_HANDL
|
||||
ZVAL_UNDEF(var);
|
||||
zval_dtor_func_for_ptr(garbage);
|
||||
} else {
|
||||
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
|
||||
ZVAL_UNDEF(var);
|
||||
zval *z = var;
|
||||
ZVAL_DEREF(z);
|
||||
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
|
||||
ZVAL_UNDEF(var);
|
||||
gc_possible_root(Z_COUNTED_P(z));
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
@@ -7422,6 +7422,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
|
||||
}
|
||||
retval = zend_std_get_static_property(ce, name, 0);
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
if (IS_CONST != IS_CONST) {
|
||||
zend_string_release(name);
|
||||
}
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
@@ -7674,8 +7677,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
|
||||
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
|
||||
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
|
||||
object = Z_OBJ(EX(This));
|
||||
}
|
||||
if (!object) {
|
||||
ce = object->ce;
|
||||
} else {
|
||||
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
|
||||
/* Allowed for PHP 4 compatibility. */
|
||||
zend_error(
|
||||
@@ -7920,8 +7923,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_UNUSED_HA
|
||||
ZVAL_UNDEF(var);
|
||||
zval_dtor_func_for_ptr(garbage);
|
||||
} else {
|
||||
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
|
||||
ZVAL_UNDEF(var);
|
||||
zval *z = var;
|
||||
ZVAL_DEREF(z);
|
||||
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
|
||||
ZVAL_UNDEF(var);
|
||||
gc_possible_root(Z_COUNTED_P(z));
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
@@ -8540,12 +8549,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_CV_HAN
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_CV) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CONST|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -8561,12 +8567,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CV
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CONST|IS_CV) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CONST|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -9417,8 +9420,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
|
||||
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
|
||||
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
|
||||
object = Z_OBJ(EX(This));
|
||||
}
|
||||
if (!object) {
|
||||
ce = object->ce;
|
||||
} else {
|
||||
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
|
||||
/* Allowed for PHP 4 compatibility. */
|
||||
zend_error(
|
||||
@@ -11225,8 +11228,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
|
||||
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
|
||||
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
|
||||
object = Z_OBJ(EX(This));
|
||||
}
|
||||
if (!object) {
|
||||
ce = object->ce;
|
||||
} else {
|
||||
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
|
||||
/* Allowed for PHP 4 compatibility. */
|
||||
zend_error(
|
||||
@@ -12180,8 +12183,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_TMP_HANDLER(Z
|
||||
Z_ADDREF_P(array_ref);
|
||||
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), array_ref);
|
||||
} else {
|
||||
array_ptr = EX_VAR(opline->result.var);
|
||||
ZVAL_COPY_VALUE(array_ptr, array_ref);
|
||||
array_ref = EX_VAR(opline->result.var);
|
||||
ZVAL_NEW_REF(array_ref, array_ptr);
|
||||
array_ptr = Z_REFVAL_P(array_ref);
|
||||
}
|
||||
if (IS_TMP_VAR == IS_CONST) {
|
||||
zval_copy_ctor_func(array_ptr);
|
||||
@@ -12573,12 +12577,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_CONST_HA
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_TMP_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -12594,12 +12595,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CONS
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_TMP_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -13128,12 +13126,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_TMP_HAND
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_TMP_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -13149,12 +13144,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_TMP_
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_TMP_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -13311,12 +13303,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_VAR_HAND
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -13332,12 +13321,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_VAR_
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -13864,12 +13850,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_CV_HANDL
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_TMP_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -13885,12 +13868,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CV_H
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_TMP_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_TMP_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -15649,8 +15629,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_VAR_HANDLER(Z
|
||||
Z_ADDREF_P(array_ref);
|
||||
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), array_ref);
|
||||
} else {
|
||||
array_ptr = EX_VAR(opline->result.var);
|
||||
ZVAL_COPY_VALUE(array_ptr, array_ref);
|
||||
array_ref = EX_VAR(opline->result.var);
|
||||
ZVAL_NEW_REF(array_ref, array_ptr);
|
||||
array_ptr = Z_REFVAL_P(array_ref);
|
||||
}
|
||||
if (IS_VAR == IS_CONST) {
|
||||
zval_copy_ctor_func(array_ptr);
|
||||
@@ -15976,8 +15957,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_FETCH_RW_SPEC_VAR_HANDLER(Z
|
||||
|
||||
ZVAL_DEREF(array);
|
||||
if (EXPECTED(Z_TYPE_P(array) == IS_ARRAY)) {
|
||||
pos = zend_hash_iterator_pos_ex(Z_FE_ITER_P(EX_VAR(opline->op1.var)), array);
|
||||
fe_ht = Z_ARRVAL_P(array);
|
||||
pos = zend_hash_iterator_pos(Z_FE_ITER_P(EX_VAR(opline->op1.var)), fe_ht);
|
||||
p = fe_ht->arData + pos;
|
||||
while (1) {
|
||||
if (UNEXPECTED(pos >= fe_ht->nNumUsed)) {
|
||||
@@ -16414,12 +16395,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_CONST_HA
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -16435,12 +16413,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONS
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_VAR|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(binary_op_type binary_op ZEND_OPCODE_HANDLER_ARGS_DC)
|
||||
@@ -17584,8 +17559,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
|
||||
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
|
||||
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
|
||||
object = Z_OBJ(EX(This));
|
||||
}
|
||||
if (!object) {
|
||||
ce = object->ce;
|
||||
} else {
|
||||
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
|
||||
/* Allowed for PHP 4 compatibility. */
|
||||
zend_error(
|
||||
@@ -18156,12 +18131,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_TMP_HAND
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -18177,12 +18149,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP_
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_VAR|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -18368,12 +18337,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_VAR_HAND
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -18389,12 +18355,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_VAR_
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_VAR|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -19224,8 +19187,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
|
||||
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
|
||||
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
|
||||
object = Z_OBJ(EX(This));
|
||||
}
|
||||
if (!object) {
|
||||
ce = object->ce;
|
||||
} else {
|
||||
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
|
||||
/* Allowed for PHP 4 compatibility. */
|
||||
zend_error(
|
||||
@@ -19622,12 +19585,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_CV_HANDL
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -19643,12 +19603,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CV_H
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_VAR|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(binary_op_type binary_op ZEND_OPCODE_HANDLER_ARGS_DC)
|
||||
@@ -20851,8 +20808,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
|
||||
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
|
||||
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
|
||||
object = Z_OBJ(EX(This));
|
||||
}
|
||||
if (!object) {
|
||||
ce = object->ce;
|
||||
} else {
|
||||
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
|
||||
/* Allowed for PHP 4 compatibility. */
|
||||
zend_error(
|
||||
@@ -22421,8 +22378,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
|
||||
if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
|
||||
if (Z_OBJ(EX(This)) && instanceof_function(Z_OBJCE(EX(This)), ce)) {
|
||||
object = Z_OBJ(EX(This));
|
||||
}
|
||||
if (!object) {
|
||||
ce = object->ce;
|
||||
} else {
|
||||
if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
|
||||
/* Allowed for PHP 4 compatibility. */
|
||||
zend_error(
|
||||
@@ -29358,8 +29315,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_CV_HANDLER(ZE
|
||||
Z_ADDREF_P(array_ref);
|
||||
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), array_ref);
|
||||
} else {
|
||||
array_ptr = EX_VAR(opline->result.var);
|
||||
ZVAL_COPY_VALUE(array_ptr, array_ref);
|
||||
array_ref = EX_VAR(opline->result.var);
|
||||
ZVAL_NEW_REF(array_ref, array_ptr);
|
||||
array_ptr = Z_REFVAL_P(array_ref);
|
||||
}
|
||||
if (IS_CV == IS_CONST) {
|
||||
zval_copy_ctor_func(array_ptr);
|
||||
@@ -30100,12 +30058,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_CONST_HAN
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_CONST) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CV|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -30121,12 +30076,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_CONST
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_CONST) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CV|IS_CONST) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -31074,6 +31026,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
|
||||
}
|
||||
retval = zend_std_get_static_property(ce, name, 0);
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
if (IS_CV != IS_CONST) {
|
||||
zend_string_release(name);
|
||||
}
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
@@ -32214,8 +32169,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_CONST_HANDLE
|
||||
ZVAL_UNDEF(var);
|
||||
zval_dtor_func_for_ptr(garbage);
|
||||
} else {
|
||||
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
|
||||
ZVAL_UNDEF(var);
|
||||
zval *z = var;
|
||||
ZVAL_DEREF(z);
|
||||
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
|
||||
ZVAL_UNDEF(var);
|
||||
gc_possible_root(Z_COUNTED_P(z));
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
@@ -32981,12 +32942,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_TMP_HANDL
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CV|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -33002,12 +32960,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_TMP_H
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CV|IS_TMP_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -33192,12 +33147,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_VAR_HANDL
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CV|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -33213,12 +33165,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR_H
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
|
||||
zval_ptr_dtor_nogc(free_op2);
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_VAR) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CV|IS_VAR) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_VAR(int type ZEND_OPCODE_HANDLER_ARGS_DC)
|
||||
@@ -33288,6 +33237,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
|
||||
}
|
||||
retval = zend_std_get_static_property(ce, name, 0);
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
if (IS_CV != IS_CONST) {
|
||||
zend_string_release(name);
|
||||
}
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
@@ -33510,8 +33462,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_VAR_HANDLER(
|
||||
ZVAL_UNDEF(var);
|
||||
zval_dtor_func_for_ptr(garbage);
|
||||
} else {
|
||||
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
|
||||
ZVAL_UNDEF(var);
|
||||
zval *z = var;
|
||||
ZVAL_DEREF(z);
|
||||
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
|
||||
ZVAL_UNDEF(var);
|
||||
gc_possible_root(Z_COUNTED_P(z));
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
@@ -34226,6 +34184,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
|
||||
}
|
||||
retval = zend_std_get_static_property(ce, name, 0);
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
if (IS_CV != IS_CONST) {
|
||||
zend_string_release(name);
|
||||
}
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
@@ -34740,8 +34701,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_UNUSED_HANDL
|
||||
ZVAL_UNDEF(var);
|
||||
zval_dtor_func_for_ptr(garbage);
|
||||
} else {
|
||||
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
|
||||
ZVAL_UNDEF(var);
|
||||
zval *z = var;
|
||||
ZVAL_DEREF(z);
|
||||
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
|
||||
ZVAL_UNDEF(var);
|
||||
gc_possible_root(Z_COUNTED_P(z));
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
@@ -35338,12 +35305,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_CV_HANDLE
|
||||
result = fast_is_identical_function(op1, op2);
|
||||
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_CV) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CV|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -35359,12 +35323,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV_HA
|
||||
result = fast_is_not_identical_function(op1, op2);
|
||||
|
||||
|
||||
ZEND_VM_SMART_BRANCH(result, (IS_CV|IS_CV) & (IS_VAR|IS_TMP_VAR));
|
||||
ZEND_VM_SMART_BRANCH(result, 1);
|
||||
ZVAL_BOOL(EX_VAR(opline->result.var), result);
|
||||
if ((IS_CV|IS_CV) & (IS_VAR|IS_TMP_VAR)) {
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
|
||||
}
|
||||
|
||||
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
@@ -41418,6 +41379,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
|
||||
}
|
||||
retval = zend_std_get_static_property(ce, name, 0);
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
|
||||
zend_string_release(name);
|
||||
}
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
@@ -41951,8 +41915,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMPVAR_CONST_HA
|
||||
ZVAL_UNDEF(var);
|
||||
zval_dtor_func_for_ptr(garbage);
|
||||
} else {
|
||||
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
|
||||
ZVAL_UNDEF(var);
|
||||
zval *z = var;
|
||||
ZVAL_DEREF(z);
|
||||
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
|
||||
ZVAL_UNDEF(var);
|
||||
gc_possible_root(Z_COUNTED_P(z));
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
@@ -42400,6 +42370,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
|
||||
}
|
||||
retval = zend_std_get_static_property(ce, name, 0);
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
|
||||
zend_string_release(name);
|
||||
}
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
@@ -42536,8 +42509,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMPVAR_VAR_HAND
|
||||
ZVAL_UNDEF(var);
|
||||
zval_dtor_func_for_ptr(garbage);
|
||||
} else {
|
||||
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
|
||||
ZVAL_UNDEF(var);
|
||||
zval *z = var;
|
||||
ZVAL_DEREF(z);
|
||||
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
|
||||
ZVAL_UNDEF(var);
|
||||
gc_possible_root(Z_COUNTED_P(z));
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
@@ -42802,6 +42781,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
|
||||
}
|
||||
retval = zend_std_get_static_property(ce, name, 0);
|
||||
if (UNEXPECTED(EG(exception))) {
|
||||
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
|
||||
zend_string_release(name);
|
||||
}
|
||||
zval_ptr_dtor_nogc(free_op1);
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
@@ -42938,8 +42920,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMPVAR_UNUSED_H
|
||||
ZVAL_UNDEF(var);
|
||||
zval_dtor_func_for_ptr(garbage);
|
||||
} else {
|
||||
GC_ZVAL_CHECK_POSSIBLE_ROOT(var);
|
||||
ZVAL_UNDEF(var);
|
||||
zval *z = var;
|
||||
ZVAL_DEREF(z);
|
||||
if (Z_COLLECTABLE_P(z) && UNEXPECTED(!Z_GC_INFO_P(z))) {
|
||||
ZVAL_UNDEF(var);
|
||||
gc_possible_root(Z_COUNTED_P(z));
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ZVAL_UNDEF(var);
|
||||
|
||||
@@ -3050,3 +3050,57 @@ AC_DEFUN([PHP_CHECK_BUILTIN_EXPECT], [
|
||||
AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_EXPECT], [$have_builtin_expect], [Whether the compiler supports __builtin_expect])
|
||||
|
||||
])
|
||||
|
||||
dnl PHP_CHECK_BUILTIN_CLZ
|
||||
AC_DEFUN([PHP_CHECK_BUILTIN_CLZ], [
|
||||
AC_MSG_CHECKING([for __builtin_clz])
|
||||
|
||||
AC_TRY_LINK(, [
|
||||
return __builtin_clz(1) ? 1 : 0;
|
||||
], [
|
||||
have_builtin_clz=1
|
||||
AC_MSG_RESULT([yes])
|
||||
], [
|
||||
have_builtin_clz=0
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
|
||||
AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_CLZ], [$have_builtin_clz], [Whether the compiler supports __builtin_clz])
|
||||
|
||||
])
|
||||
|
||||
dnl PHP_CHECK_BUILTIN_CTZL
|
||||
AC_DEFUN([PHP_CHECK_BUILTIN_CTZL], [
|
||||
AC_MSG_CHECKING([for __builtin_ctzl])
|
||||
|
||||
AC_TRY_LINK(, [
|
||||
return __builtin_ctzl(2L) ? 1 : 0;
|
||||
], [
|
||||
have_builtin_ctzl=1
|
||||
AC_MSG_RESULT([yes])
|
||||
], [
|
||||
have_builtin_ctzl=0
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
|
||||
AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_CTZL], [$have_builtin_ctzl], [Whether the compiler supports __builtin_ctzl])
|
||||
|
||||
])
|
||||
|
||||
dnl PHP_CHECK_BUILTIN_CTZLL
|
||||
AC_DEFUN([PHP_CHECK_BUILTIN_CTZLL], [
|
||||
AC_MSG_CHECKING([for __builtin_ctzll])
|
||||
|
||||
AC_TRY_LINK(, [
|
||||
return __builtin_ctzll(2LL) ? 1 : 0;
|
||||
], [
|
||||
have_builtin_ctzll=1
|
||||
AC_MSG_RESULT([yes])
|
||||
], [
|
||||
have_builtin_ctzll=0
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
|
||||
AC_DEFINE_UNQUOTED([PHP_HAVE_BUILTIN_CTZLL], [$have_builtin_ctzll], [Whether the compiler supports __builtin_ctzll])
|
||||
|
||||
])
|
||||
+4
-2
@@ -4,7 +4,9 @@
|
||||
|
||||
dir=$1; shift
|
||||
for stubfile in $dir/*/config0.m4 $dir/*/config.m4 $dir/*/config9.m4; do
|
||||
echo "config_m4_src=$stubfile
|
||||
config_m4_dir=`dirname $stubfile`
|
||||
echo "dnl Define where extension directories are located in the configure context
|
||||
AC_DEFUN([PHP_EXT_BUILDDIR], [`dirname $stubfile`])
|
||||
AC_DEFUN([PHP_EXT_DIR], [`dirname $stubfile`])
|
||||
AC_DEFUN([PHP_EXT_SRCDIR], [\$abs_srcdir/`dirname $stubfile`])
|
||||
sinclude($stubfile)"
|
||||
done
|
||||
+8
-2
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=7
|
||||
PHP_MINOR_VERSION=0
|
||||
PHP_RELEASE_VERSION=0
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
PHP_RELEASE_VERSION=2
|
||||
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`
|
||||
|
||||
@@ -577,6 +577,12 @@ PHP_CHECK_STDINT_TYPES
|
||||
|
||||
dnl Check __builtin_expect
|
||||
PHP_CHECK_BUILTIN_EXPECT
|
||||
dnl Check __builtin_clz
|
||||
PHP_CHECK_BUILTIN_CLZ
|
||||
dnl Check __builtin_ctzl
|
||||
PHP_CHECK_BUILTIN_CTZL
|
||||
dnl Check __builtin_ctzll
|
||||
PHP_CHECK_BUILTIN_CTZLL
|
||||
|
||||
dnl Check for members of the stat structure
|
||||
AC_STRUCT_ST_BLKSIZE
|
||||
|
||||
@@ -810,7 +810,7 @@ PHP_FUNCTION(com_message_pump)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool com_load_typelib(string typelib_name [, int case_insensitive])
|
||||
/* {{{ proto bool com_load_typelib(string typelib_name [, bool case_insensitive])
|
||||
Loads a Typelibrary and registers its constants */
|
||||
PHP_FUNCTION(com_load_typelib)
|
||||
{
|
||||
|
||||
@@ -1851,7 +1851,9 @@ static void _php_curl_set_default_options(php_curl *ch)
|
||||
curl_easy_setopt(ch->cp, CURLOPT_INFILE, (void *) ch);
|
||||
curl_easy_setopt(ch->cp, CURLOPT_HEADERFUNCTION, curl_write_header);
|
||||
curl_easy_setopt(ch->cp, CURLOPT_WRITEHEADER, (void *) ch);
|
||||
#if !defined(ZTS)
|
||||
curl_easy_setopt(ch->cp, CURLOPT_DNS_USE_GLOBAL_CACHE, 1);
|
||||
#endif
|
||||
curl_easy_setopt(ch->cp, CURLOPT_DNS_CACHE_TIMEOUT, 120);
|
||||
curl_easy_setopt(ch->cp, CURLOPT_MAXREDIRS, 20); /* prevent infinite redirects */
|
||||
|
||||
@@ -2183,6 +2185,12 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
# if defined(ZTS)
|
||||
if (option == CURLOPT_DNS_USE_GLOBAL_CACHE) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_DNS_USE_GLOBAL_CACHE cannot be activated when thread safety is enabled");
|
||||
return 1;
|
||||
}
|
||||
# endif
|
||||
error = curl_easy_setopt(ch->cp, option, lval);
|
||||
break;
|
||||
case CURLOPT_SAFE_UPLOAD:
|
||||
|
||||
@@ -9,6 +9,8 @@ if (!extension_loaded('curl')) exit("skip curl extension not loaded");
|
||||
$curl = curl_init("http://www.google.com");
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl, CURLOPT_PRIVATE, "123");
|
||||
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 1);
|
||||
curl_setopt($curl, CURLOPT_TIMEOUT, 1);
|
||||
curl_exec($curl);
|
||||
|
||||
var_dump(curl_getinfo($curl, CURLINFO_PRIVATE));
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Test curl_opt() function with POST params from array with a numeric key
|
||||
--SKIPIF--
|
||||
<?php
|
||||
include 'skipinf.inc';
|
||||
include 'skipif.inc';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -15,7 +15,9 @@ var_dump(curl_setopt_array($c, [
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_UPLOAD => true,
|
||||
CURLOPT_INFILE => $f,
|
||||
CURLOPT_INFILESIZE => filesize(__FILE__)
|
||||
CURLOPT_INFILESIZE => filesize(__FILE__),
|
||||
CURLOPT_CONNECTTIMEOUT => 1,
|
||||
CURLOPT_TIMEOUT => 1,
|
||||
]));
|
||||
fclose($f);
|
||||
var_dump(curl_setopt_array($c, [
|
||||
|
||||
@@ -17,7 +17,9 @@ curl_setopt_array($ch, array(
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Length: 1',
|
||||
),
|
||||
CURLOPT_READFUNCTION => 'curl_read'
|
||||
CURLOPT_READFUNCTION => 'curl_read',
|
||||
CURLOPT_CONNECTTIMEOUT=> 1,
|
||||
CURLOPT_TIMEOUT=>1
|
||||
));
|
||||
|
||||
function curl_read($ch, $fp, $len) {
|
||||
|
||||
@@ -18,7 +18,9 @@ curl_setopt_array($ch, array(
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Length: 1',
|
||||
),
|
||||
CURLOPT_READFUNCTION => 'curl_read'
|
||||
CURLOPT_READFUNCTION => 'curl_read',
|
||||
CURLOPT_CONNECTTIMEOUT => 1,
|
||||
CURLOPT_TIMEOUT => 1
|
||||
));
|
||||
|
||||
function curl_read($ch, $fp, $len) {
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #71144 (Sementation fault when using cURL with ZTS)
|
||||
--SKIPIF--
|
||||
<?php include 'skipif.inc'; ?>
|
||||
<?php if (!PHP_ZTS) { print "skip only for zts build"; } ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$ch = curl_init();
|
||||
var_dump(curl_setopt($ch, CURLOPT_DNS_USE_GLOBAL_CACHE, 1));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: curl_setopt(): CURLOPT_DNS_USE_GLOBAL_CACHE cannot be activated when thread safety is enabled in %sbug71144.php on line %d
|
||||
bool(false)
|
||||
+2
-2
@@ -3579,9 +3579,9 @@ PHP_FUNCTION(date_diff)
|
||||
zval *object1, *object2;
|
||||
php_date_obj *dateobj1, *dateobj2;
|
||||
php_interval_obj *interval;
|
||||
zend_long absolute = 0;
|
||||
zend_bool absolute = 0;
|
||||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO|l", &object1, date_ce_interface, &object2, date_ce_interface, &absolute) == FAILURE) {
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO|b", &object1, date_ce_interface, &object2, date_ce_interface, &absolute) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
dateobj1 = Z_PHPDATE_P(object1);
|
||||
|
||||
+5
-1
@@ -320,6 +320,10 @@ if test "$PHP_DB4" != "no"; then
|
||||
THIS_PREFIX=$i
|
||||
THIS_INCLUDE=$i/db4/db.h
|
||||
break
|
||||
elif test -f "$i/include/db5.3/db.h"; then
|
||||
THIS_PREFIX=$i
|
||||
THIS_INCLUDE=$i/include/db5.3/db.h
|
||||
break
|
||||
elif test -f "$i/include/db5.1/db.h"; then
|
||||
THIS_PREFIX=$i
|
||||
THIS_INCLUDE=$i/include/db5.1/db.h
|
||||
@@ -362,7 +366,7 @@ if test "$PHP_DB4" != "no"; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
PHP_DBA_DB_CHECK(4, db-5.1 db-5.0 db-4.8 db-4.7 db-4.6 db-4.5 db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db-4 db4 db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)])
|
||||
PHP_DBA_DB_CHECK(4, db-5.3 db-5.1 db-5.0 db-4.8 db-4.7 db-4.6 db-4.5 db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db-4 db4 db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)])
|
||||
fi
|
||||
PHP_DBA_STD_RESULT(db4,Berkeley DB4)
|
||||
|
||||
|
||||
+13
-6
@@ -209,7 +209,7 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free)
|
||||
|
||||
if (zend_hash_num_elements(Z_ARRVAL_P(key)) != 2) {
|
||||
php_error_docref(NULL, E_RECOVERABLE_ERROR, "Key does not have exactly two elements: (key, name)");
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(key), &pos);
|
||||
group = zend_hash_get_current_data_ex(Z_ARRVAL_P(key), &pos);
|
||||
@@ -232,9 +232,10 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free)
|
||||
ZVAL_COPY(&tmp, key);
|
||||
convert_to_string(&tmp);
|
||||
|
||||
*key_free = *key_str = estrndup(Z_STRVAL(tmp), Z_STRLEN(tmp));
|
||||
len = Z_STRLEN(tmp);
|
||||
|
||||
if (len) {
|
||||
*key_free = *key_str = estrndup(Z_STRVAL(tmp), Z_STRLEN(tmp));
|
||||
}
|
||||
zval_ptr_dtor(&tmp);
|
||||
return len;
|
||||
}
|
||||
@@ -281,8 +282,14 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free)
|
||||
RETURN_FALSE; \
|
||||
}
|
||||
|
||||
#define DBA_ID_GET2 DBA_ID_PARS; DBA_GET2; DBA_FETCH_RESOURCE(info, id)
|
||||
#define DBA_ID_GET2_3 DBA_ID_PARS; DBA_GET2_3; DBA_FETCH_RESOURCE(info, id)
|
||||
#define DBA_FETCH_RESOURCE_WITH_ID(info, id) \
|
||||
if ((info = (dba_info *)zend_fetch_resource2(Z_RES_P(id), "DBA identifier", le_db, le_pdb)) == NULL) { \
|
||||
DBA_ID_DONE; \
|
||||
RETURN_FALSE; \
|
||||
}
|
||||
|
||||
#define DBA_ID_GET2 DBA_ID_PARS; DBA_GET2; DBA_FETCH_RESOURCE_WITH_ID(info, id)
|
||||
#define DBA_ID_GET2_3 DBA_ID_PARS; DBA_GET2_3; DBA_FETCH_RESOURCE_WITH_ID(info, id)
|
||||
|
||||
#define DBA_ID_DONE \
|
||||
if (key_free) efree(key_free)
|
||||
@@ -578,7 +585,7 @@ static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
DBA_FETCH_RESOURCE(info, id);
|
||||
DBA_FETCH_RESOURCE_WITH_ID(info, id);
|
||||
|
||||
DBA_WRITE_CHECK_WITH_ID;
|
||||
|
||||
|
||||
+2
-2
@@ -1348,9 +1348,9 @@ PHP_FUNCTION(dom_node_clone_node)
|
||||
xmlNode *n, *node;
|
||||
int ret;
|
||||
dom_object *intern;
|
||||
zend_long recursive = 0;
|
||||
zend_bool recursive = 0;
|
||||
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|l", &id, dom_node_class_entry, &recursive) == FAILURE) {
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|b", &id, dom_node_class_entry, &recursive) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -546,7 +546,7 @@ static zval *php_filter_get_storage(zend_long arg)/* {{{ */
|
||||
if (PG(auto_globals_jit)) {
|
||||
zend_is_auto_global_str(ZEND_STRL("_ENV"));
|
||||
}
|
||||
array_ptr = &IF_G(env_array) ? &IF_G(env_array) : &PG(http_globals)[TRACK_VARS_ENV];
|
||||
array_ptr = !Z_ISUNDEF(IF_G(env_array)) ? &IF_G(env_array) : &PG(http_globals)[TRACK_VARS_ENV];
|
||||
break;
|
||||
case PARSE_SESSION:
|
||||
/* FIXME: Implement session source */
|
||||
|
||||
Loaded 100 of 369 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user