1
0
mirror of https://github.com/php/php-src.git synced 2026-04-24 16:38:25 +02:00
Commit Graph

1571 Commits

Author SHA1 Message Date
Nikita Popov 34bb5ba2ea Remove support for EXT_NOP
This is an annoying edge case that regularly gets broken. As we're
not aware of significant users of this API, and there are other
ways to hook this, remove support for EXT_NOP.
2020-09-18 11:03:08 +02:00
Dmitry Stogov a9cbdafa69 Support for ZEND_COMPILE_EXTENDED_STMT 2020-09-17 23:19:28 +03:00
Nikita Popov 801cf66ab8 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #80083
2020-09-17 10:14:19 +02:00
Nikita Popov 9c136f10cd Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #80083
2020-09-17 10:13:53 +02:00
Nikita Popov a4f806aa79 Fixed bug #80083
Add db2_execute() to the list of functions accessing the local
scope. Ideally the API wouldn't do that, but it seems most
pragmatic to address this on the opcache side at this point.
2020-09-17 10:12:10 +02:00
Dmitry Stogov f896b982cc Exclude trait methods from call-graph 2020-09-16 12:04:29 +03:00
George Peter Banyard 95f4ee38bb Add some ValueErrors to ext/date
Closes GH-5613
2020-09-16 01:29:28 +02:00
George Peter Banyard 7a95e943d6 Promote warnings to Error in MySQLi extension
Closes GH-5803
2020-09-15 19:12:02 +02:00
Máté Kocsis c37a1cd650 Promote a few remaining errors in ext/standard
Closes GH-6110
2020-09-15 14:26:16 +02:00
George Peter Banyard d0111d785d Promote warnings to Errors in PostgreSQL extension
Do some drive by indentation fixes
Also fix pg_select() in regards to the $result_type arg which was missing from ZPP

Closes GH-6129
2020-09-14 17:01:35 +02:00
Nikita Popov 8446e28275 Handle missing result_var in binary_op_result_type
For dim/obj compound ops we don't have a result_var. Not sure why
this never caused issues before, but this can crash with JIT.
2020-09-11 22:36:41 +02:00
Dmitry Stogov d2efb7e6c4 Eliminate unnecessary IS_INDIRECT guards 2020-09-10 02:20:15 +03:00
Dmitry Stogov 1c59bd5caa Avoid more exception checks 2020-09-09 23:25:54 +03:00
Nikita Popov 3861cb87c2 More pgsql func info fixes 2020-09-09 21:49:13 +02:00
Máté Kocsis 8a5e3e40a9 Fix opcache return type info for pgsql functions 2020-09-09 21:43:44 +02:00
Dmitry Stogov ee9948bc46 Eliminate unnecessary exception checks 2020-09-09 16:15:37 +03:00
Nikita Popov 8516434a56 Fixed bug #80046
We already protect against optimizing away loop frees in DFA pass,
but not in block pass.
2020-09-03 11:19:04 +02:00
Nikita Popov ce74ff2b3d Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #80046
2020-09-03 11:18:11 +02:00
Nikita Popov 04e77d2dea Fixed bug #80046
We already protect against optimizing away loop frees in DFA pass,
but not in block pass.
2020-09-03 11:18:01 +02:00
Dmitry Stogov bd8e0a96a5 Eliminate useless EG(exception) checks aftr FE_RESET/FE_FETCH 2020-09-01 18:56:47 +03:00
Nikita Popov a99d08b5d1 Fix type inference for FE_RESET on invalid type
FE_RESET sets the result to UNDEF in this case. We should infer
some type here, because no type generally implies unreachable
code. In this case SCCP ended up replacing the FE_RESET result
with null, including in FE_FREE.
2020-09-01 13:59:36 +02:00
Nikita Popov c088a9369f Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix pi node removal when removing predecessor
2020-09-01 12:26:18 +02:00
Nikita Popov 37612936a1 Fix pi node removal when removing predecessor
We can't just remove the uses, we need to replace uses.

The test case only fails on master with SSA integrity violations,
but I believe the root issue also existed previously.
2020-09-01 12:25:00 +02:00
Nikita Popov 50975640bc Fixed bug #80030 2020-08-31 12:38:11 +02:00
George Peter Banyard fa8d9b1183 Improve type declarations for Zend APIs
Voidification of Zend API which always succeeded
Use bool argument types instead of int for boolean arguments
Use bool return type for functions which return true/false (1/0)
Use zend_result return type for functions which return SUCCESS/FAILURE as they don't follow normal boolean semantics

Closes GH-6002
2020-08-28 15:41:27 +02:00
Dmitry Stogov 16b3b339ed Check reference guard once 2020-08-27 00:40:55 +03:00
Dmitry Stogov d4383be6fa Use guard to check if array is packed or hash 2020-08-26 02:34:31 +03:00
Dmitry Stogov e99954492e Avoid priniting "array [long, string] of" 2020-08-25 21:38:23 +03:00
Dmitry Stogov 2369f48092 Infer information about packed/hash arrays and use it for JIT 2020-08-25 18:28:23 +03:00
Dmitry Stogov d384537859 Move AVOID_REFCOUNTING type info flag into a separate bit 2020-08-25 11:37:30 +03:00
Máté Kocsis 4c89ed61fb Promote warnings to exceptions in ext/gettext, ext/sysvmsg and ext/xml
Closes GH-5926
2020-08-03 20:09:28 +02:00
Nikita Popov d92229d8c7 Implement named parameters
From an engine perspective, named parameters mainly add three
concepts:

 * The SEND_* opcodes now accept a CONST op2, which is the
   argument name. For now, it is looked up by linear scan and
   runtime cached.
 * This may leave UNDEF arguments on the stack. To avoid having
   to deal with them in other places, a CHECK_UNDEF_ARGS opcode
   is used to either replace them with defaults, or error.
 * For variadic functions, EX(extra_named_params) are collected
   and need to be freed based on ZEND_CALL_HAS_EXTRA_NAMED_PARAMS.

RFC: https://wiki.php.net/rfc/named_params

Closes GH-5357.
2020-07-31 15:53:36 +02:00
Nikita Popov 47e4001976 Remove more unused func_info fields 2020-07-30 18:50:12 +02:00
Nikita Popov 9dacc85251 Add type inference support for RECV_VARIADIC 2020-07-30 17:14:34 +02:00
Nikita Popov 104b7addc4 Remove unused recv_arg_info from func_info 2020-07-30 17:04:56 +02:00
Nikita Popov ce22cf5198 Remove some dead code in RECV type inference
We must always have arg_info corresponding to RECV.
2020-07-30 16:55:21 +02:00
Nikita Popov d8d2a7801a Merge branch 'PHP-7.4'
* PHP-7.4:
  Consider op1 literal of FETCH_OBJ_R
2020-07-29 17:05:42 +02:00
Nikita Popov f8ff8bb767 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Consider op1 literal of FETCH_OBJ_R
2020-07-29 17:05:35 +02:00
Nikita Popov 57ad5b3432 Consider op1 literal of FETCH_OBJ_R
FETCH_OBJ_R may have an op1 CONST operand, even though it will
always error. We should take this into account when compacting
literals.
2020-07-29 17:04:23 +02:00
Nikita Popov dc1a6dc0de Remove unused func_info variable 2020-07-27 18:40:51 +02:00
Dmitry Stogov b23188962e Remove unused fields 2020-07-27 17:31:02 +03:00
Ilija Tovilo 9bf119832d Implement nullsafe ?-> operator
RFC: https://wiki.php.net/rfc/nullsafe_operator

Closes GH-5619.

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2020-07-24 10:05:03 +02:00
Dmitry Stogov 2940839d28 Prevent incorrect trasing JIT TSSA usage for range() result type inference 2020-07-22 13:01:11 +03:00
Nikita Popov f7f557926e Fix arg/func info
* mysqli_get_server_info() cannot return null. The underlying API
   is infallible.
 * mysqli_select_db() func info is redundant.
 * mb_detect_order() can only return array|true, not array|false.

Also make the func_info.phpt test that is supposed to catch these
kinds of issues actually work.
2020-07-21 15:00:33 +02:00
Nikita Popov ae2b214be2 Check for redundant func info 2020-07-21 13:01:12 +02:00
Nikita Popov 3a9036ac54 Stricter verification of func info against arg info
Make sure they're actually the same up to cases where func info
allows more accurate expressions. There are some awkward edge cases
around true/false/null limitations in union types.
2020-07-21 11:47:52 +02:00
Nikita Popov e4c1366b63 Remove some redundant func info
This is fully covered by arginfo.

The array_merge_recursive() RC information was also wrong,
it should be the same as array_merge().
2020-07-21 11:10:07 +02:00
Nikita Popov 33ddc3bb96 Fix mb_ereg_search* arg and func info 2020-07-21 10:40:08 +02:00
Nikita Popov be9c5daf28 Remove null from highlight_* return types
Also fix show_source() discrepancy in func_info.
2020-07-21 10:40:08 +02:00
Nikita Popov 9d37a57411 Remove bool return type from assert_options
Not seeing any way this function can return bool.
2020-07-21 10:18:33 +02:00