Commit graph

41593 commits

Author SHA1 Message Date
Nikita Popov
0d62dfdf81 Improve previous fix
Do not mark loop var free blocks as reachable after all -- as we
can't construct SSA for unreachable blocks, this would cause
issues down the line.

Instead add an extra UNREACHABLE_FREE flag and retain only the
FREE instruction during NOP removal. (If we retain all
instructions in the BB we might leave a jump instruction that goes
into the nowhere.)
2016-05-22 00:05:06 +02:00
Nikita Popov
fa9566627b Fix reachability detection if live ranges aren't split
Even if we don't split, we still want to keep the same logic for
reachibility detection.
2016-05-21 20:17:09 +02:00
Derick Rethans
932c9520bc Merge branch 'PHP-7.0' 2016-05-18 12:19:58 +01:00
Derick Rethans
c572968900 Merge branch 'PHP-5.6' into PHP-7.0 2016-05-18 12:19:49 +01:00
Derick Rethans
f43f6fc39b Fixed bug #63740 (strtotime seems to use both sunday and monday as start of week) 2016-05-18 12:19:11 +01:00
Dmitry Stogov
0d77222473 Merge branch 'PHP-7.0'
* PHP-7.0:
  Use PHP_VERSION as OPcahce version
2016-05-17 17:17:09 +03:00
Dmitry Stogov
d41920c57d Use PHP_VERSION as OPcahce version 2016-05-17 17:16:10 +03:00
Nikita Popov
b65b15c6f4 Mark assert() as INDIRECT_VAR_ACCESS
I don't like this... we may want to detect "obviously not string"
operands by checking for the result of a comparison instruction.
2016-05-17 16:13:17 +02:00
Xinchen Hui
0c8879e3da Merge branch 'PHP-7.0'
* PHP-7.0:
  Let's only read-only here
2016-05-17 18:07:36 +08:00
Xinchen Hui
2eb7e75c25 Let's only read-only here 2016-05-17 18:07:20 +08:00
Xinchen Hui
60d743dd3b Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed bug #72229 (Wrong reference when serialize/unserialize an object)
2016-05-17 17:40:37 +08:00
Xinchen Hui
7989db975f Fixed bug #72229 (Wrong reference when serialize/unserialize an object) 2016-05-17 17:40:26 +08:00
Anatol Belski
41cb432ec4 Merge branch 'PHP-7.0'
* PHP-7.0:
  update NEWS
  Tidy up
  Remove unnecessary boundary checks
  Resolve bug #72017
2016-05-16 19:31:20 +02:00
Thomas Punt
0e21742bf8 Tidy up 2016-05-16 19:15:40 +02:00
Thomas Punt
367fde9947 Remove unnecessary boundary checks 2016-05-16 19:15:40 +02:00
Thomas Punt
39052d4d75 Resolve bug #72017 2016-05-16 19:15:40 +02:00
Xinchen Hui
0b3a4c6101 Revert "Revert "fix #72143 (preg_replace uses int instead of size_t on zend_string_allocs)""
obviously I read the change is in argument lists by mistake :<

This reverts commit 9e7afa7514.
2016-05-16 06:22:13 -07:00
Xinchen Hui
9e7afa7514 Revert "fix #72143 (preg_replace uses int instead of size_t on zend_string_allocs)"
ABI break

This reverts commit fb951553be.
2016-05-16 11:24:16 +08:00
Jakub Zelenka
89d02e0019 Merge branch 'json_parser_method' 2016-05-15 13:50:23 +01:00
Nikita Popov
dd8379e046 Inference: $a[]= results in long keys 2016-05-14 17:16:32 +02:00
Nikita Popov
6079ba4b0c Inference: Fix undef handling for binary ops
We need to be careful about correctly handling that undef results
in a null value. Otherwise, apart from simply generating incorrect
results, we may also end up performing non-monotonic lattice
transitions, thus causing an infinite type inference loop (see
test).
2016-05-14 17:16:32 +02:00
Nikita Popov
773b377888 Inference: Use common handling for compound assign ops
Extract the inference code for binary operators and then handle all
ASSIGN_* opcodes the same way.
2016-05-14 17:16:32 +02:00
Nikita Popov
c5160d78f1 Add COPY_SSA_OBJ_TYPE macro
Use it consistently in the ASSIGN_* implementations, previously
it was only present in ASSIGN_ADD.
2016-05-14 17:16:32 +02:00
Nikita Popov
94d09163e7 Fix & improve assign_dim inference
Extract a helper function for handling ASSIGN_DIM and ASSIGN_*
with ASSIGN_DIM ev uniformly. Previously the code was copy pasted
for each ASSIGN_* op, but the variable names were not correctly
adjusted (tmp vs orig), so the type inference result was wrong.

Also sligthly improve handling:
 * Result cannot be false, will always be converted to array.
 * If the dim is a CONST string operand, we don't have to assume
   numeric strings.
 * If the inserted value may be undef, the array may contain null.
2016-05-14 17:16:32 +02:00
Joe Watkins
90f46f2c5b fix #72143 (preg_replace uses int instead of size_t on zend_string_allocs) 2016-05-14 08:21:32 +01:00
Joe Watkins
fb951553be fix #72143 (preg_replace uses int instead of size_t on zend_string_allocs) 2016-05-14 08:20:41 +01:00
Joe Watkins
4a42fbbbc7 fix #72206 (xml_parser_create/xml_parser_free leaks mem) 2016-05-14 08:11:18 +01:00
Joe Watkins
b165114013 fix #72206 (xml_parser_create/xml_parser_free leaks mem) 2016-05-14 08:10:16 +01:00
Joe Watkins
3684d41172 fix #72209 (ReflectionProperty::getValue() doesn't fail if object doesn't match type) 2016-05-14 06:28:11 +01:00
Sara Golemon
49a7be0697 Implement FIPS 180-4 algos: sha512/256 and sha512/224
These algorithms are simple extensions to the existing sha512 algo
using different initialization vectors and producing truncated output.
2016-05-14 04:39:39 +00:00
Dmitry Stogov
ccf18da450 Eliminated checks for (func->op_array.fn_flags & ZEND_ACC_GENERATOR) in fast path of DO_FCALL* handlers.
This slightly improves calls to regular function and method calls in cost of a bit slower generator initialization.
Separate call frame for generators, allocated on heap, now created by ZEND_GENERATOR_CREATE instruction.
2016-05-13 01:40:15 +03:00
Nikita Popov
b5bdb40cb5 Fix phi placement for pi targets
If the pi target has multiple predecessors, we need to place a
phi there. However it's not possible to express this in terms of
dominance frontiers, so we need to explicitly add it to the phi
set.

This does not yet solve the problem of non-minimal SSA for the
case where the target has multiple predecessors, but dominates
all predecessors (apart from the one creating the pi) -- but
that's an existing issue.
2016-05-12 22:08:28 +02:00
Nikita Popov
b1c3c9a525 Explicitly construct phi set during def propagation
Previously the phi set was first computed during def propagation
and then computed again (per-block) during actual phi placement.
This commit changes this to store the phi set computed during
def propagation.

This makes SSA construction slightly faster (5%), but the main
purpose here is to pave the way for the next commit.

This also fixes a potential issue with the handling of irreducible
loops -- they generated additional phis, but these were not
accounted for in def propagation. (Though I'm not sure if we can
even have any irreducible loops right now.)
2016-05-12 22:08:28 +02:00
Anatol Belski
ed2ec7be80 Merge branch 'PHP-7.0'
* PHP-7.0:
  workaround the extra new line in the test out on another env
2016-05-12 12:49:31 +02:00
Dmitry Stogov
7b94b958cc Intern some known (and offten used) strings. 2016-05-12 13:47:22 +03:00
Anatol Belski
9f50bb5bfa workaround the extra new line in the test out on another env 2016-05-12 12:45:04 +02:00
Anatol Belski
00390449c6 Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed bug #72197 pg_lo_create arbitrary read
2016-05-12 11:41:18 +02:00
Anatol Belski
7f6e285430 Fixed bug #72197 pg_lo_create arbitrary read 2016-05-12 11:40:28 +02:00
Xinchen Hui
28f35c1799 Merge branch 'PHP-7.0'
* PHP-7.0:
  Committed by accident
2016-05-12 13:40:32 +08:00
Xinchen Hui
92828ae204 Committed by accident 2016-05-12 13:40:22 +08:00
Xinchen Hui
8fd92e0518 Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed bug #72195 (pg_pconnect/pg_connect cause use-after-free)
2016-05-12 13:15:57 +08:00
Xinchen Hui
3c0341e6f9 Fixed bug #72195 (pg_pconnect/pg_connect cause use-after-free) 2016-05-12 13:15:33 +08:00
Jakub Zelenka
0a0e42d1f5 Add php_json_yyparse for direct use in json ext 2016-05-11 21:11:47 +01:00
Jakub Zelenka
b91c05ea14 Fix and clean up exporting of json parser 2016-05-11 20:54:42 +01:00
Xinchen Hui
904ea128ee Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed Bug #72193 (dns_get_record returns array containing elements of type 'unknown')
2016-05-11 17:32:06 +08:00
Xinchen Hui
df404e2e0e Fixed Bug #72193 (dns_get_record returns array containing elements of type 'unknown') 2016-05-11 17:31:46 +08:00
Xinchen Hui
233562c2da Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed bug #71573 (Segfault (core dumped) if paramno beyond bound)
2016-05-11 11:12:46 +08:00
Xinchen Hui
66ad4fc393 Fixed bug #71573 (Segfault (core dumped) if paramno beyond bound) 2016-05-11 11:12:27 +08:00
Dmitry Stogov
13ea086945 Merge branch 'PHP-7.0'
* PHP-7.0:
  The "flock" structure has to be writable on AIX.
2016-05-10 17:53:43 +03:00
Dmitry Stogov
f7372f648f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  The "flock" structure has to be writable on AIX.
2016-05-10 17:53:33 +03:00