Commit Graph

1536 Commits

Author SHA1 Message Date
Dmitry Stogov
b6a41ad5ba Fixed use-after-free 2018-03-14 09:11:48 +03:00
Dmitry Stogov
5574562f8f Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Revert "More accurate symbolic constraints oferflow/unserflow handling (better fix for bug #76074)."
2018-03-13 11:03:57 +03:00
Dmitry Stogov
0643c7ab4d Revert "More accurate symbolic constraints oferflow/unserflow handling (better fix for bug #76074)."
This reverts commit 44ba557de5.
2018-03-13 11:03:45 +03:00
Dmitry Stogov
575f5002c0 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  More accurate symbolic constraints oferflow/unserflow handling (better fix for bug #76074).
2018-03-13 10:45:53 +03:00
Dmitry Stogov
44ba557de5 More accurate symbolic constraints oferflow/unserflow handling (better fix for bug #76074). 2018-03-13 10:44:53 +03:00
Anatol Belski
8a985403f6 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Use string literal as format
2018-03-12 15:18:11 +01:00
Anatol Belski
eaa5b1f911 Use string literal as format 2018-03-12 15:17:08 +01:00
Dmitry Stogov
e6fb787c66 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Replaced usafe reference from SHM to process memory with SHM to SHM reference
2018-03-12 11:18:33 +03:00
Dmitry Stogov
f31c4d5398 Replaced usafe reference from SHM to process memory with SHM to SHM reference 2018-03-12 11:18:12 +03:00
Bob Weinand
cfd0979be5 Merge branch 'PHP-7.1' into PHP-7.2 2018-03-10 15:21:16 +01:00
Bob Weinand
9c6df8a238 Fix bug #76074 (opcache corrupts variable in for-loop) 2018-03-10 15:20:45 +01:00
Dmitry Stogov
020a02ef9d Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Replaced usafe reference from SHM to process memory with SHM to SHM reference.
2018-03-06 02:47:01 +03:00
Dmitry Stogov
50949c9332 Replaced usafe reference from SHM to process memory with SHM to SHM reference. 2018-03-06 02:43:26 +03:00
Dmitry Stogov
b48d2f6d10 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Don't keep HashTable.pDestructor in SHM and always set it into ZVAL_PTR_DTOR in zval_array_dup(). Keeping pointer to a function in SHM is not safe because of ASLR.
2018-03-06 01:00:14 +03:00
Dmitry Stogov
b711a96acb Don't keep HashTable.pDestructor in SHM and always set it into ZVAL_PTR_DTOR in zval_array_dup().
Keeping pointer to a function in SHM is not safe because of ASLR.
2018-03-06 00:56:16 +03:00
Dmitry Stogov
b7ebf90221 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed invalid destructor
2018-03-06 00:46:40 +03:00
Dmitry Stogov
a83581e223 Fixed invalid destructor 2018-03-06 00:46:19 +03:00
Dmitry Stogov
53baf6fa1d Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed invalid destructor
2018-03-05 23:33:53 +03:00
Dmitry Stogov
87553b0730 Fixed invalid destructor 2018-03-05 23:33:08 +03:00
Anatol Belski
54212dfbf9 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Include username into the file cache path
2018-03-05 15:21:31 +01:00
Anatol Belski
27a603e811 Include username into the file cache path 2018-03-05 15:16:55 +01:00
Dmitry Stogov
a8fbb15311 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed "opcache.file_cache_fallback" mode.
2018-03-05 16:15:38 +03:00
Dmitry Stogov
350082ed71 Fixed "opcache.file_cache_fallback" mode.
It's not safe to change value of ZCG(accel_directives).file_cache_only, becuse it might be altered by INI subsystem.
Use global variable instead.
2018-03-05 16:01:43 +03:00
Nikita Popov
500632ac13 Fix pfsockopen() func info 2018-02-18 17:42:12 +01:00
Nikita Popov
c0abab5fca Fix ZEND_SL range inference
This is a bit tricker than right shifts because shifting in the
sign bit flips the sign. The computed bounds are not tight.
2018-02-18 17:42:12 +01:00
Nikita Popov
202989edf8 Fix ZEND_SR range inference
Handle out-of-range RHS correctly.
2018-02-18 17:42:12 +01:00
Nikita Popov
40ff001381 Fix constant() func info
Since PHP 5.6 this can also be an array.
2018-02-18 17:42:11 +01:00
Nikita Popov
ae837db8cf Handle overloaded GMP operators in type inference 2018-02-18 15:33:30 +01:00
Nikita Popov
39974dd65d Disable negative range inference
The negative range inference implementation does not work correctly,
and it's not clear right now how it can be fixed. As such, disable
it entirely for now.
2018-02-18 15:33:28 +01:00
Nikita Popov
846e8a3ec9 Fix COUNT range inference
count() on objects may return a negative number :(
2018-02-17 23:18:30 +01:00
Nikita Popov
fa7c23ba27 Fix hash_init() and hash_copy() func info
These functions were switched to use objects instead of resources.
2018-02-17 23:18:29 +01:00
Nikita Popov
acb9426a6b Fix curl_multi_close() func info
Returns false on failure
2018-02-17 23:18:29 +01:00
Nikita Popov
8bdf9905da Fix get_object_vars() func info
Numeric keys will be converted to integer nowadays.
2018-02-17 23:18:29 +01:00
Nikita Popov
1a50a50bcf Add RC flags in init_func_return_info 2018-02-17 23:18:29 +01:00
Nikita Popov
fd5644cd0b Fix array_values() and array_keys() func info
Can return RCN for empty/packed arrays
2018-02-17 23:18:28 +01:00
Nikita Popov
0674d677bc Merge branch 'PHP-7.1' into PHP-7.2 2018-02-16 20:30:49 +01:00
Nikita Popov
372bf8a923 Fixed bug #75969
Move NOP stripping out of zend_optimize_block: NOP stripping may
move instructions, which may invalidate a Tsource shared across
an extended basic block.
2018-02-16 20:30:03 +01:00
Anatol Belski
2235da59af Extend skipif check 2018-02-13 14:04:51 +01:00
Nikita Popov
7aac61ce76 Fixed bug #75938
New modulus range inference implementation has been verified using
https://gist.github.com/nikic/67947ff92cf0e1f7e931f2f0d4cf817f.

The computed bounds are not tight, but it seems to be very hard to
compute tight bounds on modulus operations.
2018-02-09 15:10:23 +01:00
Nikita Popov
1391a0fa0b Fixed bug #75893
It is not sufficient to just add the additional types for aliased
variables at the end of type inference, because types of derived
variables may depend on them. Make sure the additional types are
always added whenever the type of an aliased variable is updated.
2018-02-05 21:41:44 +01:00
Nikita Popov
d9e71169e6 Fixed bug #75729
Don't try to evaluate substr() and strpos() at compile-time if
mbstring function overloading is enabled. I'm reusing the
COMPILE_NO_BUILTIN_STRLEN for the detection of mbstring function
overloading here, even if it's technically only about strlen()...
2018-02-05 21:08:18 +01:00
Nikita Popov
f208187773 Backport narrowing fix to 7.1
This is a cherry-pick of 8a4532319d.
2018-01-09 18:41:46 +01:00
Xinchen Hui
0e62639d28 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Happy new year (Update copyright to 2018)
2018-01-03 16:00:34 +08:00
Lior Kaplan
fbfdd1e1c4 Happy new year (Update copyright to 2018) 2018-01-02 23:42:29 +02:00
Xinchen Hui
7a7ec01a49 year++ 2018-01-02 12:55:14 +08:00
Xinchen Hui
ccd4716ec7 year++ 2018-01-02 12:53:31 +08:00
Dmitry Stogov
9188f1d861 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #75720 (File cache not populated after SHM runs full)
2017-12-28 14:08:38 +03:00
Dmitry Stogov
60b2d67828 Fixed bug #75720 (File cache not populated after SHM runs full) 2017-12-28 14:08:12 +03:00
Dmitry Stogov
a1810758d5 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #75579 (Interned strings buffer overflow may cause crash)
2017-12-21 23:36:51 +03:00
Dmitry Stogov
f2c22d11cc Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #75579 (Interned strings buffer overflow may cause crash)
2017-12-21 23:35:23 +03:00
Dmitry Stogov
37bf8bdc14 Fixed bug #75579 (Interned strings buffer overflow may cause crash) 2017-12-21 23:34:21 +03:00
Xinchen Hui
a3b5b93ba9 Updated NEWS 2017-12-17 09:42:01 +08:00
Nikita Popov
ee45104dba Fixed bug #75698 2017-12-16 22:04:18 +01:00
Nikita Popov
19d0c5dc9f Add test for bug #75681
The issue itself has been fixed by 8a4532319d.
2017-12-16 21:24:26 +01:00
Nikita Popov
8a4532319d Improve fix for bug #75687
Adding an (incorrect) UNDEF here may cause subsequent narrowing in
other places.

Instead, let's try to handle this edge-case once for all
instructions...
2017-12-16 21:11:40 +01:00
Xinchen Hui
a20c9bd3fe Fixed bug #75687 (var 8 (TMP) has array key type but not value type) 2017-12-16 23:59:10 +08:00
Dmitry Stogov
3503dc7482 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #75608 ("Narrowing occurred during type inference" error)
2017-12-04 17:22:28 +03:00
Dmitry Stogov
5934bff913 Fixed bug #75608 ("Narrowing occurred during type inference" error) 2017-12-04 17:22:06 +03:00
Xinchen Hui
e02c2d2dfb Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Update NEWs (added bug entry)
2017-11-28 13:16:22 +08:00
Xinchen Hui
ee9e32caca Update NEWs (added bug entry) 2017-11-28 13:15:54 +08:00
Dmitry Stogov
a4b2ae69e9 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug in type inference
2017-11-27 10:16:46 +03:00
Dmitry Stogov
776bef8447 Fixed bug in type inference 2017-11-27 10:16:16 +03:00
Xinchen Hui
9d02227243 Improved fix 2017-11-27 12:03:37 +08:00
Xinchen Hui
c412b8b384 Fixed bug #75556 (Invalid opcode 138/1/1) 2017-11-25 00:54:15 +08:00
Dmitry Stogov
2a6a1fd22c typo 2017-11-22 16:30:57 +03:00
Nikita Popov
95e9cc2871 Backport some printf() fixes to 7.2 2017-11-16 21:26:33 +01:00
Dmitry Stogov
b6294bbc6c Fixed assertion on phpMyAdmin-4.7.5 home page 2017-11-08 12:51:53 +03:00
Joe Watkins
c3ee17065b
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  fix wrong check of definition_phi->constraint.range.max_ssa_var
2017-11-03 17:49:52 +00:00
MITSUNARI Shigeo
21dbd2ffcd
fix wrong check of definition_phi->constraint.range.max_ssa_var 2017-11-03 17:49:42 +00:00
Xinchen Hui
db4eb54149 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Use abbrev
2017-10-30 18:17:41 +08:00
Xinchen Hui
d9de0f8683 Use abbrev 2017-10-30 16:26:59 +08:00
Dmitry Stogov
49256dcf6f Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed type inference
2017-10-30 10:44:12 +03:00
Dmitry Stogov
230e505fd8 Fixed type inference 2017-10-30 10:41:27 +03:00
Anatol Belski
5315cea6e2 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Backport 7ff13badda into 7.0+
2017-10-18 16:27:31 +02:00
Anatol Belski
53d8775015 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Backport 7ff13badda into 7.0+
2017-10-18 16:24:23 +02:00
Anatol Belski
d82805f097 Backport 7ff13badda into 7.0+ 2017-10-18 16:02:56 +02:00
Xinchen Hui
e53a9aaa4a Fixed bug (assertion fails with extended info generated) 2017-10-17 19:47:29 +08:00
Xinchen Hui
8e147f12b9 Fixed bug (Phi sources removel) 2017-10-16 15:01:06 +08:00
Xinchen Hui
abbdbc21b0 Fixed bug #75357 (segfault loading WordPress wp-admin) 2017-10-14 23:12:29 +08:00
Xinchen Hui
a52d1088e5 Added skipf 2017-10-13 18:21:41 +08:00
Xinchen Hui
e4f7ff9c0f Fixed bug #75370 (Webserver hangs on valid PHP text) 2017-10-13 18:18:10 +08:00
Xinchen Hui
e50cc4d3af Fixed typo 2017-10-13 17:35:02 +08:00
Dmitry Stogov
2929110ce1 Fixed cleanup after optimization passes 2017-10-10 19:25:51 +03:00
Rasmus Lerdorf
ec3ea3081d Add line numbers to Optimizer debug output 2017-10-06 17:18:58 -03:00
Dmitry Stogov
e9426cf816 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed rarely possible use-after-free
2017-10-04 16:39:47 +03:00
Dmitry Stogov
b6e34eaf04 Fixed rarely possible use-after-free 2017-10-04 16:38:55 +03:00
Xinchen Hui
d3aa65231e Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #75267 (possible &/&& mixup)
2017-09-29 11:17:07 +08:00
Xinchen Hui
9fd33c1f20 Fixed bug #75267 (possible &/&& mixup) 2017-09-29 11:16:32 +08:00
Dmitry Stogov
978c6c4e31 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #75255 (Request hangs and not finish)
2017-09-27 17:17:46 +03:00
Dmitry Stogov
1c68d63f35 Fixed bug #75255 (Request hangs and not finish) 2017-09-27 17:16:24 +03:00
Dmitry Stogov
2a33e357cd Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Added missed ~
2017-09-25 12:23:01 +03:00
Dmitry Stogov
550595c085 Added missed ~ 2017-09-25 12:22:35 +03:00
Dmitry Stogov
801cdb8945 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed type inference
2017-09-25 12:04:13 +03:00
Dmitry Stogov
d526ddec85 Fixed type inference 2017-09-25 12:03:47 +03:00
Xinchen Hui
ed2a5ebaeb Fixed bug #75230 (Invalid opcode 49/1/8 using opcache) 2017-09-24 18:01:29 +08:00
Dmitry Stogov
28391b9e7f Using "enum" types as bit-fields is not portable. 2017-09-22 13:35:41 +03:00
Dmitry Stogov
6544ec5460 Fixed NOP removal (empty blocks should be shifted as well) 2017-09-20 01:10:31 +03:00
Dmitry Stogov
084e34098a Fixed optimization (the bug caused endless-loop on micro_bench.php in master branch) 2017-09-18 14:10:18 +03:00
Dmitry Stogov
251a5599b4 Fixed SSA reconstruction 2017-09-07 17:10:38 +03:00
Dmitry Stogov
384da65a97 Fixed edge-case in SSA use/def chain construction and type inference. 2017-09-04 21:58:24 +03:00