Commit Graph
519 Commits
Author SHA1 Message Date
Dmitry Stogov c218c4f01e Special handling for $php_errormsg and $http_response_header. 2016-09-30 02:41:08 +03:00
Nikita Popov c7651c2396 Fix a couple of ASSIGN_DIM/OBJ inference bugs
Account for possible null return values better.
2016-09-24 22:43:27 +02:00
Nikita Popov db801763e4 Add range inference for ZEND_STRLEN
On 32-bit systems we conservatively allow negative lengths.
On 64-bit systems, the range could additionally be restricted to
the canonical 48-bit size.
2016-09-24 22:43:27 +02:00
Dmitry Stogov 846441ab4b Prevent optimization of huge functions. 2016-09-16 14:03:05 +03:00
Xinchen Hui a90e438af3 Merge branch 'PHP-7.1' of git.php.net:/php-src into PHP-7.1
* 'PHP-7.1' of git.php.net:/php-src:
  Don't optimize (string) cast on arrays
2016-09-09 22:40:53 +08:00
Xinchen Hui 2a3b75a0eb Fixed function info 2016-09-09 22:40:08 +08:00
Nikita Popov 1d4b831d63 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-09 16:38:42 +02:00
Nikita Popov e3c08de08a Don't optimize (string) cast on arrays
Otherwise we throw a notice during pass1_5 optimization.
2016-09-09 16:38:26 +02:00
Nikita Popov 766264f8d2 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-09 16:02:59 +02:00
Nikita Popov bbcf77c309 Fix some block_pass bugs 2016-09-09 15:58:36 +02:00
Dmitry Stogov 6aa07c9083 Fixed type inference bug 2016-09-07 11:36:14 +03:00
Dmitry Stogov 94fbcbe172 Allow optional splitting of basic blocks at RECV/RECV_INIT opcodes. 2016-08-29 20:35:17 +03:00
Dmitry Stogov b5bab0fce8 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72944 (Null pointer deref in zval_delref_p).
2016-08-29 12:07:54 +03:00
Dmitry Stogov b66039db33 Fixed bug #72944 (Null pointer deref in zval_delref_p). 2016-08-29 12:02:50 +03:00
Dmitry Stogov 129e8dadf4 op_arrays may be optimized independetly and "script" might be NULL 2016-08-23 13:17:53 +03:00
Dmitry Stogov 76707dc204 Don't keep dangling pointers. 2016-08-23 12:58:46 +03:00
Dmitry Stogov caf890b291 Fixed CFG construction for stackless execution (split basic blocks after calls) 2016-08-22 16:48:26 +03:00
Xinchen Hui 66a527b8c1 Fixed segfault introduced in 447e57a1e1 2016-08-18 15:37:39 +08:00
Kalle Sommer Nielsen 447e57a1e1 Fixed 7.1 build, decls first please! 2016-08-17 20:26:32 +02:00
Nikita Popov 1a780e6727 Add assertion to prevent type narrowing
Currently type narrowing is always a bug, make sure we know about
it.
2016-08-05 16:30:57 +02:00
Nikita Popov fc7c81ff54 Fixed bug #72762 2016-08-05 16:27:55 +02:00
Nikita Popov 42260325a4 Fix optimization of $i = $i++ 2016-07-17 22:47:49 +02:00
Dmitry Stogov 0da7c08e39 Prevent wrong optimization 2016-07-13 15:05:11 +03:00
Nikita Popov 5f6effed43 Add opcodes to zend_wrong_string_offset() 2016-07-10 15:15:34 +02:00
Aaron Piotrowski d9a9cf8eca Merge branch 'master' into iterable 2016-07-03 22:42:10 -05:00
Dmitry Stogov acdafc0a27 Prevent inlining through call_user_func() and call_user_func_array() 2016-07-01 00:16:54 +03:00
Dmitry Stogov f2e4fc307b Fixed ext/opcache/tests/bug70207.phpt 2016-06-30 21:50:57 +03:00
Dmitry Stogov 1a14533806 Introduce new CHECK_VAR instruction to keep warnings about undefined variables. 2016-06-30 21:40:34 +03:00
Dmitry Stogov 3a45242669 Disable inlining for $this->foo(), because $this may be not in object context 2016-06-30 21:05:48 +03:00
Dmitry Stogov c3667a5eed Disable inlining for $this->foo(), because $this may be used not in object context 2016-06-30 21:03:08 +03:00
Dmitry Stogov 5ae07dc34a Fixed incorrect constant propagation 2016-06-30 20:48:16 +03:00
Nikita Popov 6f8273e3bf Fix RT_CONSTANT_EX typo 2016-06-30 17:42:57 +02:00
Dmitry Stogov d898344663 Inline simple constant functions 2016-06-30 17:04:25 +03:00
Dmitry Stogov 871cd76af4 clanup 2016-06-29 17:53:39 +03:00
Nikita Popov 2710ce22a0 Remove assert for now 2016-06-28 18:47:29 +02:00
Nikita Popov cdd58edf42 More type inferences fixes 2016-06-28 11:49:50 +02:00
Dmitry Stogov 1433162083 Fixed compilation warnings 2016-06-21 20:12:29 +03:00
Nikita Popov a171522983 Exception safety for direct CV assign of *CALL instrs
Converting T = *CALL; ASSIGN $v, T into $v = *CALL may not be
safe if an exception is thrown after the return value has been
populated -- in this case the value might be destroyed twice.
2016-06-18 00:08:38 +02:00
Nikita Popov 811dfba4bf More type inference fixes 2016-06-16 14:25:48 +02:00
Dmitry Stogov ff363e2e7c Implemented RFC: Replace "Missing argument" warning with "Too few arguments" exception
Squashed commit of the following:

commit 8b45fa2acb8cd92542a39e1e4720fe1f4fabc26c
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Jun 16 01:52:50 2016 +0300

    Separate slow path of ZEND_RECV into a cold function.

commit 9e18895ee59c64c93a96b1ba3061355c4663e962
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jun 15 23:26:28 2016 +0300

    Required argument can't be IS_UNDEF anymore.

commit 662db66e3943d4455c65e4f987bb54abf724ecb2
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue May 31 17:14:50 2016 +0300

    Replace "Missing argument" warning by "Too few arguments" exception.
2016-06-16 02:32:02 +03:00
Dmitry Stogov a9512af810 Implemented RFC: Fix inconsistent behavior of $this variable
Squashed commit of the following:

commit bdd3b6895c3ce3eacfcf7d4bf4feb8dfa61801fd
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Jun 16 00:19:42 2016 +0300

    Fixed GOTO VM

commit 2f1d7c8b89ce821086d357cf65f629f040a85c03
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jun 15 21:01:57 2016 +0300

    Removed unused variable

commit cf749c42b0b1919f70b1e7d6dcbfff76899506af
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jun 15 19:06:16 2016 +0300

    Protection from $this reassign through mb_parse_str()

commit 59a9a6c83c66b666971e57f1173b33a422166efd
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jun 15 18:14:50 2016 +0300

    Added type inference rule for FETCH_THIS opcode

commit 73f8d14a856f14a461430b3c7534ab2ce870cbf6
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jun 15 18:11:18 2016 +0300

    Restored PHP-7 behavior of isset($this->foo).
    It throws exception if not in object context.
    Removed useless opcode handlers.

commit fa0881381e8ae97e022ae5d1ec0851c952f33c82
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue May 31 12:25:47 2016 +0300

    Changed "Notice: Undefined variable: this" into "Exception: Using $this when not in object context".

commit e32cc528c0f2c97963d8ec83eff0269f1f45af18
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue May 24 02:02:43 2016 +0300

    Throw exception on attempt to re-assign $this through extract() and parse_str().

commit 41f1531b52113ec8a4c208aa6b9ef50f1386bb3f
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon May 23 22:18:36 2016 +0300

    Fixed inconsistent $this behavior
2016-06-16 02:30:23 +03:00
Nikita Popov fba6f90ae3 Fix type inference bugs
* Add proper array_key_any|array_of_any|array_of_ref in some more
  places
* strlen() on objects may be null
* IS fetch on string dim may be null
2016-06-15 22:52:48 +02:00
Dmitry Stogov d12987256a Fixed mistakes in type inference rules. 2016-06-15 23:04:17 +03:00
Nikita Popov 046889518d Add support for "instanceof" pi nodes 2016-06-13 19:03:59 +02:00
Nikita Popov 9877d8f019 Use union for pi constraints
This will make it easier to extend pi constraints without impacting
structure sizes.
2016-06-13 19:03:57 +02:00
Aaron Piotrowski 0dc772c9b4 Add iterable type to opcache 2016-06-10 19:01:27 -05:00
Nikita Popov be37de1ff1 Use LCA for object(ce) type joins
For B, C extending A the join of object(B) and object(C) should
be object(instanceof A). For simplicity we only handle the class
hierarchy, as computing the least common unique ancestor for
interfaces would be more involved.

Also ignore phi sources that don't have an object type: The join
of null and object(A) is now null|object(A) rather than
null|object.
2016-06-07 20:42:00 +02:00
Nikita Popov d8a2370884 Cleanup 2016-06-07 20:42:00 +02:00
Dmitry Stogov 80b39b498a Improve type narrowing (check only SSA definitions). 2016-06-06 14:57:02 +03:00
Nikita Popov 543649bd4c Fix correctness issues with type narrowing
Fixes bug #72335.
2016-06-06 14:56:17 +03:00