Commit Graph

12944 Commits

Author SHA1 Message Date
Nikita Popov
de66e80d75 Don't leave holes in func_get_args() and backtraces
Argument lists should always be continuous and hole-free, even if
local variables are unset. Replace UNDEF values with NULLs.
2017-06-25 15:27:45 +02:00
Dmitry Stogov
d55b43d9cb Merge branch 'fast_shutdown'
* fast_shutdown:
  Reseet EG(active) a bit early.
  Reuse "nIndex"
  shutdown_executor() refactoring (reuse opcache fast request shutdown code)
2017-06-23 14:59:29 +03:00
Dmitry Stogov
866d3b40e9 Reseet EG(active) a bit early. 2017-06-23 14:58:19 +03:00
Nikita Popov
748069e3a0 Merge branch 'PHP-7.1' 2017-06-23 13:32:51 +02:00
Dmitry Stogov
40ed9aaa48 Reuse "nIndex" 2017-06-23 14:23:00 +03:00
Joe Watkins
5796fff344
Merge branch 'PHP-7.1'
* PHP-7.1:
  Remove superfluous branch
2017-06-23 07:51:59 +01:00
Joe Watkins
b903733762
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Remove superfluous branch
2017-06-23 07:51:46 +01:00
Thomas Punt
b1301a0686
Remove superfluous branch 2017-06-23 07:51:32 +01:00
Dmitry Stogov
f25ecdacf8 shutdown_executor() refactoring (reuse opcache fast request shutdown code) 2017-06-22 01:45:28 +03:00
Dmitry Stogov
06e41cadd9 We don't need any special handling for CG(unclean_shutdown) at this point, because in case of exit() or die() all destructors must be already called before. 2017-06-21 16:11:50 +03:00
Dmitry Stogov
7802cf8c1a Added specialized FE_FETCH_R handler for iteration over array 2017-06-20 23:25:09 +03:00
Dmitry Stogov
31a2198fd9 FE_RESER/FE_FETCH optimisation 2017-06-20 22:26:46 +03:00
Dmitry Stogov
bfa154448d VM refactoring, to avoid passing "execute_data" into helper functions that can access it using global register variable. 2017-06-16 01:42:49 +03:00
Dmitry Stogov
8bb29704ea Refactored API for constant array element propagation 2017-06-15 22:50:04 +03:00
Dmitry Stogov
76db01d9ff Moved "Using $this when not in object context" exception code into single VM helper. 2017-06-15 16:23:05 +03:00
Dmitry Stogov
8fe47a47cf Avoid run-time checks performed at compile-time. 2017-06-13 13:48:58 +03:00
ZiMuyang
5c9d6e89fe Delete extra semicolon 2017-06-12 23:14:11 +02:00
Michael Moravec
586a22cbad Bump Modules API number for 7.2 to distinguish from 7.1 2017-06-12 12:04:02 -04:00
Remi Collet
22cdfc2504 cleanup, MEMORY_LIMIT is not used anymore 2017-06-09 08:07:21 +02:00
Dmitry Stogov
db4561bfff Introduced "zif_handler" type (zif = zend internal function). 2017-06-08 16:52:39 +03:00
Dmitry Stogov
ace9fe5317 Improved new Zend Parameter Parsing API to avoid useless dereferences.
This derefernce made sense only for explicit paramter passing by reference, but this feature was removed in PHP-7.
The improvement is 100% backward compatible, only few "tricky" functions may be affected (e.g. extract and usort).
2017-06-08 13:03:24 +03:00
Jakub Zelenka
eb6614e458 Constify str in add_assoc_string_ex and add_assoc_stringl_ex 2017-06-07 23:44:23 +02:00
Richard Fussenegger
7cce220be8 Updated some str functions to new parameter API 2017-06-07 23:43:37 +02:00
Dmitry Stogov
6a024146bb Removed unused variable. 2017-06-06 16:08:44 +03:00
Pedro Magalhães
c6c1e75e6b Fix bug #74607: Don't check for bi-directional compatibility in traits 2017-06-03 00:24:43 +02:00
Dmitry Stogov
02e6c9c757 ZVAL_COPY_UNREF() micro-optimization 2017-06-02 00:38:09 +03:00
marcosptf
3efef6d0c0
test for ErrorException::getSeverity(); 2017-06-01 08:23:53 +01:00
Dmitry Stogov
a916bed8f8 Fixed function name resolution 2017-05-30 21:48:16 +03:00
Dmitry Stogov
65edf44291 Check for possible run-time function name resolution 2017-05-30 17:37:54 +03:00
Dmitry Stogov
c015be131d Update opcode description 2017-05-30 14:47:21 +03:00
Dmitry Stogov
33d42802d3 Fixed support for C compilers that don't support global register variables. 2017-05-30 13:31:58 +03:00
Dmitry Stogov
6043f76ad7 Added ZEND_FUNC_NUM_ARGS, ZEND_FUNC_GET_ARGS instructions, to implement corresponding builtin functions.
Special optimisation for "array_slice(INT, func_get_args())" pattern.
2017-05-30 13:23:17 +03:00
Dmitry Stogov
017d65d74a Extend ZEND_SEND_ARRAY to eliminate array_slice() call for "call_user_func_array(_, array_slice(_, LONG, _))" pattern. 2017-05-30 12:25:46 +03:00
Xinchen Hui
225f6cc11f Merge branch 'PHP-7.1'
* PHP-7.1:
  Correct the location
2017-05-27 12:12:17 +08:00
Xinchen Hui
1838f965bc Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Correct the location
2017-05-27 12:12:12 +08:00
Xinchen Hui
ece7d223e8 Correct the location 2017-05-27 12:11:53 +08:00
Xinchen Hui
8af21f3ca6 Merge branch 'PHP-7.1'
* PHP-7.1:
  Added NEWs
  Fixed bug #74657 (Undefined constants in array properties result in broken properties)
2017-05-27 12:09:28 +08:00
Xinchen Hui
cd3520c4d3 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #74657 (Undefined constants in array properties result in broken properties)
2017-05-27 12:08:48 +08:00
Xinchen Hui
5269c4cacb Fixed bug #74657 (Undefined constants in array properties result in broken properties) 2017-05-27 12:06:43 +08:00
Kalle Sommer Nielsen
7b5ba8e68b Remove accidently added byte 2017-05-26 17:37:44 +02:00
Kalle Sommer Nielsen
0affe1e7bd Added zend_parse_parameters_none_throw() 2017-05-26 17:29:50 +02:00
Dmitry Stogov
d32288b5bf Fixed copy-paste mistake 2017-05-25 20:20:57 +03:00
Dmitry Stogov
f00d1c72b4 Added ZEND_GET_CLASS, ZEMD_GET_CALLED_CLASS, ZEND_GET_TYPE instructions, to implement corresponding builtin functions. 2017-05-25 18:41:28 +03:00
Dmitry Stogov
cd953269d3 Added ZEND_COUNT instruction, to implement corresponding builtin. 2017-05-25 12:52:34 +03:00
Dmitry Stogov
27e7aea412 "Countable" interface is moved from SPL to Core 2017-05-25 12:47:43 +03:00
Dmitry Stogov
44ec732752 Fixed ZEND_IN_ARRAY related issues 2017-05-25 10:26:42 +03:00
Dmitry Stogov
7c7383067f Added ZEND_IN_ARRAY instruction, implementing optimized in_array() builtin function, through hash lookup in flipped array 2017-05-24 23:00:48 +03:00
Pedro Magalhães
a5eb57c96e Allow overriding abstract methods
RFC: https://wiki.php.net/rfc/allow-abstract-function-override
2017-05-24 17:42:01 +02:00
Dmitry Stogov
490960d861 Avoid useless string duplication 2017-05-23 15:25:21 +03:00
Dmitry Stogov
293d99052d Optimized parse_url() by using "known" strings 2017-05-22 23:23:12 +03:00
Xinchen Hui
26a6d20ab5 Fixed segfult in JIT (emalloc may trigger memory limitation)
Zend/tests/bug68412.phpt
2017-05-21 20:48:07 +08:00
Dmitry Stogov
a08723d3d3 Use interned empty and "one char" strings. 2017-05-18 17:59:59 +03:00
Dmitry Stogov
8203a175b1 Remove unused opcode handlers 2017-05-18 13:18:08 +03:00
Bob Weinand
ccb5591728 Merge branch 'PHP-7.1' 2017-05-17 19:59:36 +02:00
Bob Weinand
649494c0ee Fixed bug #74606 (Segfault within try/catch/finally nesting in Generators)
Thanks to Nikita for pointing out the error source.
2017-05-17 19:58:51 +02:00
Dmitry Stogov
fc927dc263 Switch to HYBRID VM 2017-05-17 15:07:33 +03:00
Anatol Belski
d5bc862470 avoid strlen in common case 2017-05-16 12:52:16 +02:00
Dmitry Stogov
7640e0a5f9 HYBRID VM cleanup 2017-05-16 09:24:23 +03:00
Dmitry Stogov
69b4f8ed79 Fixed USER_OPCODE handling in HYBRID VM. 2017-05-15 21:17:58 +03:00
Anatol Belski
de9124a2e7 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed bug #74589 __DIR__ wrong for unicode character
  fixing run-tests.php for variables_order="GPCS"
2017-05-15 16:36:40 +02:00
Anatol Belski
ae3f975c5d Fixed bug #74589 __DIR__ wrong for unicode character 2017-05-15 16:35:22 +02:00
Markus Staab
2fd94e6be7
Removed always true condition
Since 5a9d8a00b4 this can no longer be false
2017-05-11 06:28:08 +01:00
Dmitry Stogov
dfffe6cb32 Type hint inheritance check optimization 2017-05-10 22:25:32 +03:00
Dmitry Stogov
5a9d8a00b4 Constant class names are already verifyed by PHP compiler. 2017-05-10 14:26:44 +03:00
Dmitry Stogov
c8f073d0d7 Avoid useless checks 2017-05-10 13:27:37 +03:00
Xinchen Hui
e1c32646b4 typo 2017-05-09 17:15:42 +08:00
Dmitry Stogov
6f6ad066ea Merge branch 'hybrid-vm'
* hybrid-vm:
  Cleanup
  Fixed zend_vm_call_opcode_handler(). Make phpdbg work with HYBRID VM.
  Added missing ZEND_VM_HOT define
  Implemented HYBRID VM instruction dispatch method that takes advantages of both CALL and GOTO VMs.
2017-05-09 09:38:34 +03:00
Dmitry Stogov
2f9d72b309 Cleanup 2017-05-09 09:37:46 +03:00
Xinchen Hui
8daef7e423 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed another potential dangling pointer
2017-05-08 11:36:35 +08:00
Xinchen Hui
2d30bc96a1 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed another potential dangling pointer
2017-05-08 11:36:29 +08:00
Xinchen Hui
b966a8b5fa Fixed another potential dangling pointer 2017-05-08 11:36:07 +08:00
Xinchen Hui
1466925cb0 Merge branch 'PHP-7.1'
* PHP-7.1:
  Update NEWS
  Fixed bug #74546 (SIGILL in ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_CONST_HANDLER())
2017-05-08 11:33:01 +08:00
Xinchen Hui
2c070847e7 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #74546 (SIGILL in ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_CONST_HANDLER())
2017-05-08 11:32:27 +08:00
Xinchen Hui
87d56a3d07 Fixed bug #74546 (SIGILL in ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_CONST_HANDLER()) 2017-05-08 11:32:08 +08:00
Xinchen Hui
705bd6df78 Unused var 2017-05-08 10:56:21 +08:00
Nikita Popov
5af997ed81 Don't use zend_try around dtor_obj() and free_obj()
Without these zend_trys we may
a) leak the object (fine)
b) don't add it to the free list (also fine, we just lose an
   object store bucket)
c) don't remove it from the GC root buffer (also fine, because GC
   explicitly checks for both FREE_CALLED and invalid buckets)
2017-05-04 20:57:25 +02:00
Nikita Popov
3abef9c960 Don't double initialize object properties 2017-05-04 20:57:21 +02:00
Dmitry Stogov
71bfb430af Fixed zend_vm_call_opcode_handler(). Make phpdbg work with HYBRID VM. 2017-05-04 18:56:28 +03:00
Dmitry Stogov
b5e857b905 Added missing ZEND_VM_HOT define 2017-05-04 17:57:49 +03:00
Dmitry Stogov
27e01cd918 Implemented HYBRID VM instruction dispatch method that takes advantages of both CALL and GOTO VMs. 2017-05-03 10:01:22 +03:00
Dmitry Stogov
476866783c Keep Z_IMMUTABLE*() macros for compatibility 2017-05-02 10:00:54 +03:00
Nikita Popov
d8aa99ed94 Drop unused variable 2017-05-01 14:16:26 +02:00
Pedro Magalhães
5324fb1f34 Fixed bug #61970: Allow a child class to restrict access to ctor 2017-05-01 14:15:57 +02:00
Pedro Magalhães
92124f9cdc Fixed bug #74269: Strict comparison of initial trait property values 2017-05-01 12:59:27 +02:00
Sammy Kaye Powers
12300f465e Add trailing comma syntax support for mixed and unmixed group use lists
RFC: https://wiki.php.net/rfc/list-syntax-trailing-commas
2017-05-01 12:19:47 +02:00
Andrea Faulds
44156b3114 Drop ZEND_API from zend_assert_valid_class_name
This is a convenience function for internal use and shouldn't have been
exported.
2017-04-29 16:09:08 +01:00
Anatol Belski
6a010ad492 Avoid unnecessary string copy
which is the case when there's no impersonation.
2017-04-27 16:03:12 +02:00
Anatol Belski
24ae881080 get rid of two strlen calls 2017-04-27 15:41:09 +02:00
Nikita Popov
b6a4aad820 Remove the ZEND_ACC_CLONE flag
This one is completely unused
2017-04-22 15:47:53 +02:00
Nikita Popov
6ae40ca0e2 Document which function flags are still free
Also clearly separate method and class flags.
2017-04-22 15:47:53 +02:00
Nikita Popov
28218b4acc Merge branch 'PHP-7.1' 2017-04-15 18:15:45 +02:00
Nikita Popov
2719b8e91c Merge branch 'PHP-7.0' into PHP-7.1 2017-04-15 18:15:33 +02:00
Nikita Popov
e433c23b96 Improve accuracy of opline lineno information
If compile_var() was used instead of compile_expr() we did not
update the current lineno.
2017-04-15 18:15:24 +02:00
Nikita Popov
0c3bc43207 Remove leftover code for generator stack page handling 2017-04-15 12:11:30 +02:00
Nikita Popov
cfa6fa1525 Initialize retval in INCLUDE_OR_EVAL
In case the eval'd code throws.
2017-04-15 12:11:30 +02:00
Nikita Popov
7f5d47dfd1 Merge branch 'PHP-7.1' 2017-04-15 01:40:59 +02:00
David Matejka
2135b057ec Fixed bug #74444: multiple catch freezes in some cases
zend_emit_jump() may reallocate, so reload the opline.
2017-04-15 01:38:37 +02:00
Xinchen Hui
5340587c25 Merge branch 'PHP-7.1'
* PHP-7.1:
  Update NEWS
  Fixed bug #74408 (Endless loop bypassing execution time limit)
2017-04-11 18:47:06 +08:00
Xinchen Hui
87e6e1982b Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #74408 (Endless loop bypassing execution time limit)
2017-04-11 18:46:41 +08:00
Xinchen Hui
eb03f16442 Fixed bug #74408 (Endless loop bypassing execution time limit) 2017-04-11 18:46:16 +08:00
Sammy Kaye Powers
e92896f735 Remove spurious CG(context).in_finally dingleberry 2017-04-10 22:58:44 +02:00
Nikita Popov
ad8652818a Implement jumptable optimization 2017-04-10 22:23:14 +02:00
Nikita Popov
75b83ec2fd Add NEWS 2017-04-09 15:52:37 +02:00
Nikita Popov
3895aa2f77 Merge branch 'PHP-7.1' 2017-04-09 15:51:38 +02:00
Nikita Popov
515e1e0cea Merge branch 'PHP-7.0' into PHP-7.1 2017-04-09 15:35:44 +02:00
Thomas Punt
744c4a5592 Resolve bug #74188 (undefined statics raising with ?? operator) 2017-04-09 15:29:31 +02:00
Anatol Belski
ad4ef13c5d Switch to FindFirstFileEx with basic info level
That omits querying of short names, thus improving perf.
2017-04-07 21:15:37 +02:00
Xinchen Hui
f16bb1be51 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed bug #74353 (Segfault when killing within bash script trap code)
2017-04-07 16:15:44 +08:00
Xinchen Hui
7a796d18ee Fixed bug #74353 (Segfault when killing within bash script trap code) 2017-04-07 16:15:36 +08:00
Anatol Belski
936e341b5e missing bits for php_sys_stat_ex so everything is handled with wide chars
rename to pathw_len
2017-04-03 17:39:15 +02:00
Anatol Belski
f02b4d575f Merge branch 'PHP-7.1'
* PHP-7.1:
  fix possible out of bounds buffer access
2017-04-03 15:22:59 +02:00
Anatol Belski
3438e62b30 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix possible out of bounds buffer access
2017-04-03 15:22:04 +02:00
Anatol Belski
feeb35e438 fix possible out of bounds buffer access 2017-04-03 15:20:32 +02:00
Nikita Popov
3a890180d3 Merge branch 'PHP-7.1' 2017-04-02 13:31:07 +02:00
Nikita Popov
fe46a7da78 Fixed bug #74340 2017-04-02 13:30:35 +02:00
Nikita Popov
16861838a5 Merge branch 'PHP-7.1' 2017-03-23 22:50:21 +01:00
Nikita Popov
e3e3547627 Merge branch 'PHP-7.0' into PHP-7.1 2017-03-23 22:49:51 +01:00
Nikita Popov
d719b46222 Fix sequencing UB 2017-03-23 22:48:45 +01:00
Nikita Popov
f5951cc81b Fix lineno for AST_ZVAL nodes 2017-03-23 22:48:41 +01:00
xKhorasan
6a1d4cd47a Fixed bug #74300 2017-03-23 22:06:46 +01:00
Sara Golemon
819e66599a Merge branch 'PHP-7.1'
* PHP-7.1:
  Fix bug where `yield from` is captured too greedily
2017-03-23 13:40:09 -07:00
Sara Golemon
7835e2ebc5 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix bug where `yield from` is captured too greedily
2017-03-23 13:38:58 -07:00
Sara Golemon
0fb640c717 Fix bug where yield from is captured too greedily
In the following piece of code:

```php
function from1234($x) {
  return $x;
}
function foo($x) {
  yield from1234($x);
}
```

The statement inside foo is taken as `yield from` `1234($x)`
which is neither the intent, nor even legal syntax for an fcall.

Do a lookahead for breaking non-label characters after the
`yield from` and only accept it if they occur.
2017-03-23 13:31:06 -07:00
Rowan Collins
1b565f1393 Change 'undefined constant' from E_NOTICE to E_WARNING and mention deprecation
Implements RFC "Deprecate and Remove Bareword (Unquoted) Strings"
[https://wiki.php.net/rfc/deprecate-bareword-strings]
2017-03-23 18:52:43 +01:00
Nikita Popov
fec708f518 Simplify increment_lineno handling 2017-03-22 22:33:05 +01:00
Nikita Popov
ea36cf2b89 Merge branch 'PHP-7.1' 2017-03-17 20:21:28 +01:00
Nikita Popov
f2c35fdda8 Merge branch 'PHP-7.0' into PHP-7.1 2017-03-17 20:20:43 +01:00
Nikita Popov
2e83082605 Fix bug #74265 2017-03-17 20:19:40 +01:00
Nikita Popov
329d4edff7 Merge branch 'PHP-7.1' 2017-03-17 13:36:03 +01:00
Nikita Popov
893bf7ecdd Merge branch 'PHP-7.0' into PHP-7.1 2017-03-17 13:35:50 +01:00
Nikita Popov
183cd048f1 Fix AST start lineno for list nodes
If the node is initialized with children, check if a child has a
lower start lineno, similar to what we do for fixed-sized nodes
as well.
2017-03-17 13:35:24 +01:00
Nikita Popov
6ad0a6fb04 Merge branch 'PHP-7.1' 2017-03-15 19:50:26 +01:00
Nikita Popov
2bba4a0d7f Fix bug #69676 2017-03-15 19:49:02 +01:00
Nikita Popov
16ae9f82e8 Fix SKIPIF conditions 2017-03-14 12:06:58 +01:00
Nikita Popov
edcabf6d07 Drop unnecessary allocator return value checks 2017-03-13 22:07:15 +01:00
Nikita Popov
b3ca0c2500
zend-test extension to house code that is required for testing internal APIs, but that we would not want to expose for regular builds 2017-03-12 18:58:50 +00:00
Nikita Popov
22e6b5ef22 Merge branch 'PHP-7.1' 2017-03-10 18:21:09 +01:00
Nikita Popov
280e8dafe4 Merge branch 'PHP-7.0' into PHP-7.1 2017-03-10 18:20:58 +01:00
Nikita Popov
29ee3e3c49 Fixed bug #73960 2017-03-10 18:20:32 +01:00
Remi Collet
ec31924cd6 Constify to void build warning for C++ ext. [-Wwrite-strings]
Example (with v8js):

/builddir/build/BUILD/php-pecl-v8js-1.3.4/NTS/v8js_class.cc: In function 'void v8js_execute_script(zval*, v8js_script*, long int, long int, long int, zval**)':
/usr/include/php/Zend/zend.h:204:57: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
 #define zend_bailout()  _zend_bailout(__FILE__, __LINE__)
                                                         ^
/builddir/build/BUILD/php-pecl-v8js-1.3.4/NTS/v8js_class.cc:633:3: note: in expansion of macro 'zend_bailout'
   zend_bailout();
   ^~~~~~~~~~~~
2017-03-10 11:52:26 +01:00
Nikita Popov
8a34b33c59 Merge branch 'PHP-7.1' 2017-03-09 20:48:32 +01:00
Nikita Popov
305f3c2b76 Merge branch 'PHP-7.0' into PHP-7.1 2017-03-09 20:48:24 +01:00
Nikita Popov
177f87cf05 Fixed bug #73370
If len=0 malloc() is allowed to return NULL.
2017-03-09 20:47:06 +01:00
Joe Watkins
89e403982c
Merge branch 'PHP-7.1'
* PHP-7.1:
  Fix bug #74149 static embed SAPI linkage error
2017-03-09 07:44:42 +00:00
Joe Watkins
8599ce4f18
Fix bug #74149 static embed SAPI linkage error 2017-03-09 07:43:58 +00:00
Anatol Belski
fdba33922a move to hash API for interned strings ht management 2017-03-07 19:01:00 +01:00
Nikita Popov
361b7159e7 Merge branch 'PHP-7.1' 2017-03-07 13:18:04 +01:00
Nikita Popov
8a6281455e Merge branch 'PHP-7.0' into PHP-7.1 2017-03-07 13:17:33 +01:00
Nikita Popov
549a30d2cd Fix out of bounds access in gc_find_additional_buffer() 2017-03-07 13:16:06 +01:00
Anatol Belski
c698299550 Interned strings unification for TS/NTS
Hereby, interned strings are supported in thread safe PHP. The patch
implements two types of interned strings

- interning per process, strings are not freed till process end
- interning per request, strings are freed at request end

There is no runtime interning.

With Opcache, all the permanent iterned strings are copied into SHM on
startup, additional copying into SHM might happen on demand.
2017-03-04 10:39:13 +01:00
Anatol Belski
834d13879f Merge branch 'PHP-7.1'
* PHP-7.1:
  improve signal globals consistency check for TS
2017-03-02 20:36:12 +01:00
Anatol Belski
1d4248af42 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  improve signal globals consistency check for TS
2017-03-02 20:34:48 +01:00
Anatol Belski
18f7e26257 improve signal globals consistency check for TS
Seems when we receive TERM, TLS is destroyed completely. In that case,
not only signal globals, but the entire globals array doesn't exist
anymore.
2017-03-02 20:27:27 +01:00
Anatol Belski
5b6ee004ba Merge branch 'PHP-7.1'
* PHP-7.1:
  do not try to handle signals, when globals are inconsistent
2017-03-02 16:43:10 +01:00
Anatol Belski
494fc16184 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  do not try to handle signals, when globals are inconsistent
2017-03-02 16:41:43 +01:00
Anatol Belski
c7b2c698d0 do not try to handle signals, when globals are inconsistent 2017-03-02 16:40:38 +01:00
Sara Golemon
5b52a44860 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fix potential crash when setting invalid declare value
2017-02-28 17:18:08 -08:00
Sara Golemon
c5727a30cf Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix potential crash when setting invalid declare value
2017-02-28 17:17:41 -08:00
Sara Golemon
868930e079 Fix potential crash when setting invalid declare value
Using a non-literal expression in a declare value can cause the
compiler to crash trying to turn that AST node into a usable zval.

There was an existing test for such values using 'encoding',
but that didn't crash because it's handled by the lexer
rather than being compiled.

Trying to use a non-literal with ticks reproduces the crash.
2017-02-28 17:08:23 -08:00
Remi Collet
18293f9a6f Merge branch 'PHP-7.1'
* PHP-7.1:
  make test slower again
2017-02-28 11:36:42 +01:00
Remi Collet
3006d1de5b make test slower again 2017-02-28 11:36:24 +01:00
Xinchen Hui
b806287e43 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed bug #74157 (Segfault with nested generators)
2017-02-26 12:07:03 +08:00
Xinchen Hui
6a584cf318 Fixed bug #74157 (Segfault with nested generators) 2017-02-26 12:05:56 +08:00
Xinchen Hui
fa6144b077 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed bug #74164 (PHP hangs when an invalid value is dynamically passed to typehinted by-ref arg)
  Fixed typo (it should be typo)
2017-02-25 12:00:57 +08:00
Xinchen Hui
36fcc4cb5d Fixed bug #74164 (PHP hangs when an invalid value is dynamically passed to typehinted by-ref arg) 2017-02-25 12:00:42 +08:00
Anatol Belski
b59f3cf167 use the delivered global arg instead of fetching it 2017-02-21 12:12:42 +01:00
Anatol Belski
0c28332b11 Merge branch 'PHP-7.1'
* PHP-7.1:
  initialize valid_symbol_table, important for the main thread
2017-02-18 18:05:55 +01:00
Anatol Belski
ac64eea9e6 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  initialize valid_symbol_table, important for the main thread
2017-02-18 18:03:55 +01:00
Anatol Belski
1623ef10c9 initialize valid_symbol_table, important for the main thread
to prevent php_errormsg population on invalid symlol_table
2017-02-18 17:58:17 +01:00
Xinchen Hui
aa1d92e3e5 Unused var 2017-02-17 12:22:59 +08:00
Nikita Popov
f3d058c1da Merge branch 'PHP-7.1' 2017-02-16 17:36:09 +01:00
Nikita Popov
9ca43b873a Merge branch 'PHP-7.0' into PHP-7.1 2017-02-16 17:36:03 +01:00
Ondřej Surý
61e59db99d Disable RTLD_DEEPBIND when compiling with AddressSanitizer (-fsanitize=address).
The AddressSanitizer doesn't support RTLD_DEEPBIND resulting in
erratic errors when deinitializing phar module and possibly others.

Clang use __has_feature() macro to indicate compilation with
AddressSanitizer while gcc uses __SANITIZE_ADDRESS__ define.

Fixes bug #73677.
2017-02-16 17:35:29 +01:00
Anatol Belski
e35376c1e2 Merge branch 'PHP-7.1'
* PHP-7.1:
  skip test
2017-02-15 16:14:46 +01:00
Anatol Belski
8ad75bec97 skip test
The code path not available on Windows.
2017-02-15 16:12:34 +01:00
Xinchen Hui
b4fd233be0 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed test in travis
2017-02-15 17:31:35 +08:00
Xinchen Hui
f53ea4cd60 Fixed test in travis 2017-02-15 17:31:27 +08:00
Xinchen Hui
41bd2087ea Merge branch 'PHP-7.1'
* PHP-7.1:
  Make it slower
2017-02-15 15:27:33 +08:00
Xinchen Hui
8d94d5d942 Make it slower 2017-02-15 15:27:21 +08:00
Xinchen Hui
49dca87029 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed test
2017-02-15 14:49:09 +08:00
Xinchen Hui
dad5281a89 Fixed test 2017-02-15 14:49:02 +08:00
Xinchen Hui
bf91fc565c Merge branch 'PHP-7.1'
* PHP-7.1:
  Add a test for hard_timeout(bug #74093)
2017-02-15 13:52:08 +08:00
Xinchen Hui
6767ef05a5 Add a test for hard_timeout(bug #74093) 2017-02-15 13:51:45 +08:00
Xinchen Hui
e33afaa299 Merge branch 'PHP-7.1'
* PHP-7.1:
  Workaround to fix bug #74093 (Maximum execution time of n+2 seconds exceed not written in error_log)
2017-02-15 12:30:23 +08:00
Xinchen Hui
1242f53ddb Workaround to fix bug #74093 (Maximum execution time of n+2 seconds exceed not written in error_log)
Use a different exit code for hard_timeout, 124 is used by linux
timeout:http://man7.org/linux/man-pages/man1/timeout.1.html
"If the command times out, and --preserve-status is not set, then exit with status 124"
2017-02-15 12:27:56 +08:00
Xinchen Hui
00e5ea7b76 Merge branch 'PHP-7.1'
* PHP-7.1:
  Update NEWS
  Fixed bug  #73989 (PHP 7.1 Segfaults within Symfony test suite)

Conflicts:
	Zend/zend_gc.c
2017-02-13 19:24:00 +08:00
Xinchen Hui
9df7cc3e68 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug  #73989 (PHP 7.1 Segfaults within Symfony test suite)
2017-02-13 19:17:09 +08:00
Xinchen Hui
3917350531 Fixed bug #73989 (PHP 7.1 Segfaults within Symfony test suite) 2017-02-13 19:16:17 +08:00
Xinchen Hui
963981df58 Merge branch 'PHP-7.1'
* PHP-7.1:
  Update NEWS
  Fixed bug #74084 (Out of bound read - zend_mm_alloc_small)
2017-02-12 20:36:43 +08:00
Xinchen Hui
b56114e8fb Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #74084 (Out of bound read - zend_mm_alloc_small)

Conflicts:
	Zend/zend_operators.c
2017-02-12 20:36:18 +08:00
Xinchen Hui
26fdebc63b Fixed bug #74084 (Out of bound read - zend_mm_alloc_small) 2017-02-12 20:34:08 +08:00
Xinchen Hui
cad92c1243 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed typo
2017-02-11 00:02:07 +08:00
Xinchen Hui
808a11041d Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed typo
2017-02-11 00:01:38 +08:00
Xinchen Hui
db7c0badd4 Fixed typo 2017-02-11 00:01:09 +08:00
Dmitry Stogov
c39147d136 Fixed bug #74053 (Corrupted class entries on shutdown when a destructor spawns another object). (jim at commercebyte dot com)
Merge branch 'master' of github.com:commercebyte/php-src

* 'master' of github.com:commercebyte/php-src:
  Added EG(flags) - executor global flags EG_FLAGS_IN_SHUTDOWN - is set when PHP is in shutdown state
  newly added zend_object_store.no_reuse is redefined as a global zend_object_store_no_reuse, to avoid alignment issues
  Alignment fix, as per @nikic
  The test scripts bug64720.phpt and bug68652.phpt were relying on the buggy behavior, when PHP returns "Undefined static property" error due to class entry corruption. With my fix for bug 74053, both tests return no errors now, I corrected the EXPECTF accordingly
  Bug Fix: Corrupted class entries on shutdown when a destructor spawns another object (C) 2017 CommerceByte Consulting
2017-02-10 10:31:43 +03:00
Jim Zubov
1b1399c95d Added EG(flags) - executor global flags
EG_FLAGS_IN_SHUTDOWN - is set when PHP is in shutdown state
2017-02-09 12:40:33 -05:00
Jim Zubov
f9afc6aabc newly added zend_object_store.no_reuse is redefined as a global zend_object_store_no_reuse,
to avoid alignment issues
2017-02-07 21:13:39 -05:00
Nikita Popov
33adee5391 Merge branch 'PHP-7.1' 2017-02-08 01:00:52 +01:00
Nikita Popov
8417a3be38 Merge branch 'PHP-7.0' into PHP-7.1 2017-02-08 01:00:46 +01:00
dreamsxin
7a0adb4cd2 Add #ifndef restrict 2017-02-08 01:00:35 +01:00
Nikita Popov
1b40313804 Merge branch 'PHP-7.1' 2017-02-08 00:54:27 +01:00
Nikita Popov
bb9adc4c52 Merge branch 'PHP-7.0' into PHP-7.1 2017-02-08 00:53:36 +01:00
Christian Schmidt
714d825b62 Fix detection of isnan and isinf
The isnan() and isinf() are C99 macros not functions.

Also fix is_infinite(-INF) in case isinf is not defined.
2017-02-08 00:53:18 +01:00
Jim Zubov
a6acffe421 Alignment fix, as per @nikic 2017-02-07 10:51:09 -05:00
Jim Zubov
d94b067504 The test scripts bug64720.phpt and bug68652.phpt were relying on the buggy behavior,
when PHP returns "Undefined static property" error due to class entry corruption.
With my fix for bug 74053, both tests return no errors now, I corrected the EXPECTF accordingly

[Anybody please advice if I'm wrong?]

Also created bug74053.phpt, for the code I mentioned in the bug description
2017-02-07 09:19:16 -05:00
Anatol Belski
a7269c09d2 Merge branch 'PHP-7.1'
* PHP-7.1:
  use some dynamically generated NAN as well
2017-02-07 13:19:50 +01:00
Anatol Belski
189ea77101 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  use some dynamically generated NAN as well
2017-02-07 13:18:38 +01:00
Anatol Belski
044dd30440 use some dynamically generated NAN as well 2017-02-07 13:16:30 +01:00
Anatol Belski
7e440f2209 rework fd521a22 to simplify for master, see github #2356 2017-02-07 12:40:10 +01:00
Anatol Belski
623478a2d6 Merge branch 'PHP-7.1'
* PHP-7.1:
  switch to smart str conversion routine to hide exact NAN type
2017-02-07 12:04:25 +01:00
Anatol Belski
265c53dbbf Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  switch to smart str conversion routine to hide exact NAN type
2017-02-07 12:03:21 +01:00
Anatol Belski
fd521a22f7 switch to smart str conversion routine to hide exact NAN type
see https://github.com/php/php-src/pull/2356#issuecomment-277564135
2017-02-07 12:01:14 +01:00
Jim Zubov
9a8a1c9da1 Bug Fix:
Corrupted class entries on shutdown when a destructor spawns another object
(C) 2017 CommerceByte Consulting

When zend_objects_store_call_destructors() is called from the shutdown sequence -
it's calling the dtor's for remaining objects one by one in sequence of object handles.
If the dtor spawns one or more objects, and the new objects happen to reuse the old handles -
their dtor's are not called in this cycle.
The dtor's are called later on, when zend_deactivete() kicks in, and the static property lists in the class entries are freed.
This causes "Undefined static property" errors, and/or SIGSEGV.

Solution:
zend_object_store.no_reuse field is added
Set to 0 on initialization, set to 1 on the shutdown sequence.
zend_objects_store_put(zend_object *) checks the no_reuse flag, and never reuses the old handle slots if set.
This way, the dtor's for newly spawned objects are guaranteed to be called in the zend_objects_store_call_destructors() loop.
2017-02-06 18:05:34 -05:00
Nikita Popov
31332d0941 Merge branch 'PHP-7.1' 2017-02-06 01:47:09 +01:00
Nikita Popov
546af1966e Merge branch 'PHP-7.0' into PHP-7.1 2017-02-06 01:46:01 +01:00
Nikita Popov
8a8aa67844 Revert "Fix detection of isnan and isinf"
This reverts commit 9ea0949f43.
2017-02-06 01:45:53 +01:00
Nikita Popov
b73190d919 Merge branch 'PHP-7.1' 2017-02-05 18:13:24 +01:00
Nikita Popov
70b27b5ad8 Merge branch 'PHP-7.0' into PHP-7.1 2017-02-05 18:10:04 +01:00
Christian Schmidt
9ea0949f43 Fix detection of isnan and isinf
The isnan() and isinf() are C99 macros not functions.

Also fix is_infinite(-INF) in case isinf is not defined.
2017-02-05 18:09:04 +01:00
Andrea Faulds
07d1cd3bc3 Merge branch 'PHP-7.1' 2017-02-05 01:34:15 +00:00
Andrea Faulds
b87e399393 Merge branch 'PHP-7.0' into PHP-7.1 2017-02-05 01:31:42 +00:00
Andrea Faulds
21d7878690 Fix bug #73954 2017-02-05 01:30:20 +00:00
Niklas Keller
2edc3cf8d2 Implement Parameter Type Widening RFC 2017-02-04 23:33:24 +01:00
Nikita Popov
06a0340162 Deprecate each() 2017-02-03 21:02:52 +01:00
Nikita Popov
6ba7206620 Deprecate assert() with string argument 2017-02-03 21:02:52 +01:00
Nikita Popov
c61daf415d Deprecate track_errors / $php_errormsg 2017-02-03 21:02:52 +01:00
Nikita Popov
2df9346e7f Deprecate mb_parse_str() without second argument 2017-02-03 18:52:57 +01:00
Nikita Popov
2634b13e88 Deprecate parse_str() without second argument 2017-02-03 18:52:57 +01:00
Nikita Popov
7a73c5f6bb Deprecate (unset)
Pecularily, there wasn't a single test for the (unset) cast...
2017-02-03 18:52:57 +01:00
Nikita Popov
162aa1a5fc Deprecate __autoload() 2017-02-03 18:52:57 +01:00
Nikita Popov
eaeecc523b Deprecate create_function() 2017-02-03 18:52:57 +01:00
Dmitry Stogov
a082824725 Replace redundand checks with ZEND_ASSERT. We shouldn't get IS_OBJECTs without object_storage. 2017-02-03 18:31:25 +03:00
Dmitry Stogov
d0b15f8371 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Remove unused variable
2017-02-03 17:38:45 +03:00
Dmitry Stogov
7aff166e57 Arguments array can't make cycles 2017-02-03 17:38:03 +03:00
Sara Golemon
1a84ecaca5 Remove unused variable 2017-02-03 06:17:37 -08:00
Nikita Popov
795a4c1bb3 Merge branch 'PHP-7.1' 2017-02-02 18:35:35 +01:00
Nikita Popov
e81f30ad1d Merge branch 'PHP-7.0' into PHP-7.1 2017-02-02 18:33:42 +01:00
Mitch Hagstrand
dd9cf23457 BUG #73998: Numeric properties are not accessible from get_object_vars 2017-02-02 18:33:10 +01:00
Nikita Popov
fb008bf60e Remove obsolete version checks from tests 2017-02-02 00:58:04 +01:00
Joe Watkins
46de334452
Revert "Inheritance checks should not ignore parents if these implement an interface"
This reverts commit b67eb3440b.
2017-02-01 18:34:14 +00:00
Joe Watkins
648238da5c
Revert "Added tests demonstrating the same effect with abstracts"
This reverts commit c11b2b809d.
2017-02-01 18:33:47 +00:00
Dmitry Stogov
0631b9e9ba Merge branch 'PHP-7.1'
* PHP-7.1:
  typo
2017-02-01 17:38:12 +03:00
Dmitry Stogov
ddf41b505c Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  typo
2017-02-01 17:37:40 +03:00
Dmitry Stogov
3f89b630b4 typo 2017-02-01 17:36:55 +03:00
Dmitry Stogov
8456351a4e Merge branch 'PHP-7.1'
* PHP-7.1:
  fixed macro
2017-02-01 16:06:17 +03:00
Dmitry Stogov
8f7f8d3f9b Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fixed macro
2017-02-01 16:05:57 +03:00
Dmitry Stogov
15e9aa1706 fixed macro 2017-02-01 16:05:33 +03:00
Anatol Belski
5b5130c4ff Revert "backport 51e1da6ea1 into 7.0"
This reverts commit 8da8756312.
2017-01-31 14:21:20 +01:00
Nikita Popov
a8d901a80c Remove zend_version() checks from tests 2017-01-30 22:50:25 +01:00
Nikita Popov
df404eccb5 Remove ZEND_CHANGES and README.namespaces 2017-01-30 22:50:25 +01:00