Commit graph

1337 commits

Author SHA1 Message Date
Yussuf Khalil
35f6f9b0db Fix use-after-free of ZCG(cwd) in Zend Optimizer 2016-02-10 10:33:57 +01:00
Nikita Popov
7174af4074 Support CFG construction without live range splitting
We must not split at live range boundaries for SSA constructions,
otherwise an OP_DATA instruction may be separated into new block
and not picked up during renaming.

It's also unnecessary for this use case and only blows up the CFG.
2016-02-09 13:02:33 +01:00
Dmitry Stogov
4095d5f245 Cleanup OP_DATA usage. Now only first operand of OP_DATA is used for ASSIGN_DIM, ASSIGN_OBJ and ASSIGN_OP (DIM/OBJ) instructions. 2016-02-09 13:12:57 +03:00
Dmitry Stogov
f4bec6e137 After DFA pass result of FE_FETCH may be CV 2016-02-09 12:16:17 +03:00
Dmitry Stogov
1544fec94b Removed wrong (old) code 2016-02-08 12:20:37 +03:00
Nikita Popov
80c15ac784 Move pi placement into separate function
Non-functional change, just moving code. This makes it easier to
change the order of operations.
2016-02-02 17:39:59 +01:00
Nikita Popov
1c709f08c7 Merge branch 'PHP-7.0' 2016-01-29 17:03:32 +01:00
Guillaume Outters
d01566fe2f opcache config.m4: Use = for comparison
HAVE_OPCACHE_FILE_CACHE and HAVE_HUGE_CODE_PAGES where not
correctly set on old systems (e.g. FreeBSD 8), due to a PHPism in
config.m4.  Using the standard shell operator = instead of == makes
the configure script produce the correct output.
2016-01-29 17:02:21 +01:00
Xinchen Hui
7b32ec1671 Merge branch 'PHP-7.0'
* PHP-7.0:
  Added test for bug #71443
2016-01-26 15:59:32 +08:00
Xinchen Hui
bdbb32158c Added test for bug #71443 2016-01-26 15:59:18 +08:00
Xinchen Hui
c58ad955a9 Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed bug #71443 (Segfault using built-in webserver with intl using symfony)
  Fix memory leak with not freeing OpenSSL errors
  check for NULL and avoid crashes
  Update libmagic.patch for PHP-5.6
  Fixed bug #7143	(finfo throws notice for specific python file)
2016-01-26 15:57:49 +08:00
Xinchen Hui
9ff08ae17c Fixed bug #71443 (Segfault using built-in webserver with intl using symfony) 2016-01-26 15:57:39 +08:00
Xinchen Hui
63fb2b7118 Improve the names 2016-01-25 16:00:10 +08:00
Nikita Popov
319e82838a Remove dead code
OP_DATA isn't used in that way anymore
2016-01-24 23:04:15 +01:00
Nikita Popov
c2fea2a46d Respect RC_INFERENCE during DFG construction
To avoid inserting phis that are only relevant with rc inference
enabled. Suprisingly, this affects only 0.8% of phis.
2016-01-24 23:04:06 +01:00
Nikita Popov
949aaea66e Don't insert duplicate predecessors
Otherwise we'll get corrupt phis
2016-01-24 23:03:57 +01:00
Nikita Popov
cf6aa46dbd Fix SSA for ZEND_YIELD
Yield-by-ref defs a ref var, yield-by-var only defs an rc1/rcn var
if rc inference is used.

Also move BIND_LEXICAL where it belongs in DFG construction.
2016-01-24 23:03:50 +01:00
Xinchen Hui
d74cc3afcf Fixed Bug #71435 (Reproducible crash using opcache.file_cache_only=1 and class constant) 2016-01-24 03:56:47 -08:00
Dmitry Stogov
9b854ebab4 More accurate handling of isset() and unset() 2016-01-22 13:32:20 +03:00
Dmitry Stogov
79071fe227 Added optimization constraint (don't optimize result of NEW, because constructor may throw exception) 2016-01-22 13:30:34 +03:00
Nikita Popov
b1e4883d26 Don't print try-catch offset for FAST_RET w/o ev 2016-01-21 21:53:13 +01:00
Nikita Popov
9b57e07298 Consolidate op1/op2 vm flags 2016-01-21 21:15:05 +01:00
Nikita Popov
dcf3db6ac8 Mark isset($$var) as INDIRECT_VAR_ACCESS 2016-01-19 22:26:32 +01:00
Nikita Popov
5662d73528 Add support for Pi type constraints
Supports TYPE_CHECK and IS_IDENTICAL for now.
2016-01-19 22:09:29 +01:00
Dmitry Stogov
a8900b5636 Typo (ASSESS->ACCESS) 2016-01-19 15:54:44 +03:00
Dmitry Stogov
a2ff3a46a4 Use ZEND_FUNC_INDIRECT_VAR_ASSESS instead of ZEND_FUNC_TOO_DYNAMIC. Handle function with exceptions handlers and generators separately. 2016-01-19 15:33:08 +03:00
Dmitry Stogov
6579e48417 Introduced BIND_STATIC opcode instead of FETCH_R/FETCH_W(static)+ASSIGN/ASSIGN_REF (similar to BIND_GLOBAL).
In the future we may refer to static variable by index instead of name, to eliminate hash lookup.
2016-01-12 12:20:35 +03:00
Nikita Popov
0e936db801 Make PI construction human-readable
Also makes it easy to add PIs for TI.
2016-01-11 21:53:22 +01:00
Nikita Popov
c817ac4d52 Use worklist for DFG construction
About 40x faster.
2016-01-11 21:53:10 +01:00
Nikita Popov
bb357e0617 Fix bitset initialization 2016-01-07 23:49:42 +01:00
Nikita Popov
c602ac60b9 Fix CE fetching for NEW object type inference
Create a common function for getting a class entry.
2016-01-07 18:53:10 +01:00
Nikita Popov
04dc5d7420 Range&type inference for JMP_SET 2016-01-07 18:53:02 +01:00
Anatol Belski
e712764dfe Merge branch 'PHP-7.0'
* PHP-7.0:
  more informative error message for opcache fallback
  add SKIPIF condition
2016-01-07 17:58:44 +01:00
Anatol Belski
e72848c171 more informative error message for opcache fallback 2016-01-07 17:57:41 +01:00
Xinchen Hui
563659822d Merge branch 'PHP-7.0' 2016-01-02 17:56:54 +08:00
Xinchen Hui
97a9470d97 bump year which is missed in rev 49493a2 2016-01-02 17:56:11 +08:00
Xinchen Hui
3537e95dae bump year which is missed in rev 49493a2 2016-01-02 17:51:24 +08:00
Lior Kaplan
71c1980025 Happy new year (Update copyright to 2016) 2016-01-01 20:06:12 +02:00
Lior Kaplan
3d5438bf7b Merge branch 'PHP-7.0'
* PHP-7.0:
  Update header to PHP Version 7
  Happy new year (Update copyright to 2016)
  Happy new year (Update copyright to 2016)
2016-01-01 20:04:31 +02:00
Lior Kaplan
2eb1f38d24 Happy new year (Update copyright to 2016) 2016-01-01 20:03:16 +02:00
Lior Kaplan
ed35de784f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Happy new year (Update copyright to 2016)
2016-01-01 19:48:25 +02:00
Lior Kaplan
49493a2dcf Happy new year (Update copyright to 2016) 2016-01-01 19:21:47 +02:00
Nikita Popov
83c4417330 Mark uses of scope functions in namespaces as TOO_DYNAMIC
Of course they are not necessarily, but it's very likely and we have
to be conservative anyway.

Also use zend_string_equals_literal().
2015-12-30 23:38:03 +01:00
Nikita Popov
65e456f364 Introduce BIND_LEXICAL
This opcodes inserts a local CV into the closure static variable
table. This replaces the previous mechanism of having static
variables marked as LEXICAL, which perform a symtable lookup
during copying.

This means a) functions which contain closures no longer have to
rebuild their symtable (better performance) and b) we can now track
used variables in SSA.
2015-12-29 23:14:53 +01:00
Xinchen Hui
cb1db49d0a Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed info while setting opcache.file_cache_only
  Drop extra line
  Add CVE for #71105 (PHP 7.0.1)
2015-12-29 15:49:52 +08:00
Xinchen Hui
3f07a256f7 Fixed info while setting opcache.file_cache_only 2015-12-29 15:49:10 +08:00
Nikita Popov
d77b74a1f3 Use ZEND_HASH_FOREACH 2015-12-26 23:43:33 +01:00
Nikita Popov
33870c525a Don't reuse SSA var in UNSET_VAR
Instead use the SSA var that UNSET_VAR actually defines. Otherwise
we get issues trying to DCE unsets.
2015-12-26 23:33:58 +01:00
Dmitry Stogov
b3d0178915 Rearrange code to enable inner precedure inference 2015-12-24 19:05:27 +03:00
Dmitry Stogov
b4def0ee88 Added call-graph analyses 2015-12-24 14:30:41 +03:00