Commit graph

2227 commits

Author SHA1 Message Date
Derick Rethans
9529b8919f Merge branch 'PHP-8.1' into PHP-8.2 2022-12-23 16:36:40 +00:00
Derick Rethans
233ffccc35 Fix GH-10072: PHP crashes when execute_ex is overridden and a __call trampoline is used from internal code 2022-12-23 16:34:57 +00:00
Dmitry Stogov
05b63b1593 Don't check "fake" closures (fix assertion)
Fixes oss-fuzz #53078
2022-11-07 12:19:54 +03:00
Arnaud Le Blanc
cfd5fb98e4 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [ci skip] NEWS
  [ci skip] NEWS
  Fix compilation warning
  Fix crash when memory limit is exceeded during generator initialization
2022-10-22 10:44:55 +02:00
Arnaud Le Blanc
ebe58459aa Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  [ci skip] NEWS
  Fix compilation warning
  Fix crash when memory limit is exceeded during generator initialization
2022-10-22 10:44:06 +02:00
Arnaud Le Blanc
26c7c82d32 Fix crash when memory limit is exceeded during generator initialization 2022-10-22 10:40:28 +02:00
Dmitry Stogov
c083efb779 Fix memory leak
Fixes oss-fuzz #51622
2022-09-26 12:02:03 +03:00
Dmitry Stogov
5ad8b3bcfa Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix memory leak
2022-09-26 11:47:32 +03:00
Dmitry Stogov
b20568d4fa Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix memory leak
2022-09-26 11:44:38 +03:00
Dmitry Stogov
8258b7731b Fix memory leak
Fixes oss-fuzz #51622
2022-09-26 11:43:38 +03:00
George Peter Banyard
6a7935351b Merge branch 'PHP-8.1' 2022-08-19 12:55:12 +01:00
George Peter Banyard
c36a1ea1ae Merge branch 'PHP-8.0' into PHP-8.1 2022-08-19 12:52:58 +01:00
Tim Starling
ba029fce68 Fix GH-9323: crash when the VM enters userspace code via the GC
Closes GH-9323
2022-08-19 12:50:02 +01:00
twosee
7eba683e2c
Fix unexpected deprecated dynamic property warning (#9324)
Occurred when exit() with uncaught exception in finally block.
2022-08-15 20:54:39 +08:00
Ilija Tovilo
0f29436a2f
Remove useless UNEXPECTED around RETURN_VALUE_USED in specialized RETVAL handler (#9329)
This can lead to funny code like UNEXPECTED(1) which is non-sensical.
2022-08-15 14:21:02 +02:00
sji
3b62d66098
Implement constants in traits (#8888)
RFC: https://wiki.php.net/rfc/constants_in_traits
2022-08-04 20:08:40 +01:00
Bob Weinand
625f164963 Include internal functions in the observer API
There are two main motivations to this:
a) The logic for handling internal and userland observation can be unified.
b) Unwinding of observed functions on a bailout does notably not include observers. Even if users of observers were to ensure such handling themselves, it would be impossible to retain the relative ordering - either the user has to unwind all internal observed frames before the automatic unwinding (zend_observer_fcall_end_all) or afterwards, but not properly interleaved.

Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
2022-07-30 19:20:55 +02:00
Aaron Piotrowski
2bc6025c2c
Prevent fiber switching in tick function and signal handlers (#9028) 2022-07-16 13:05:16 -05:00
Derick Rethans
5bfc160817 Don't shortcut empty oparray executions if zend_execute_ex has been overridden 2022-06-22 12:28:36 +01:00
Ilija Tovilo
ddc0b490f7
Allow arbitrary const expressions in backed enums
Closes GH-7821
Closes GH-8190
Closes GH-8418
2022-06-12 22:56:05 +02:00
Ilija Tovilo
5a855ee8d6
Fix GH-8661: Nullsafe in coalesce triggers undefined variable warning
Closes GH-8690
2022-06-12 21:52:14 +02:00
Levi Morrison
280fd680c8
Make vm_interrupt and timed_out atomic (#8327)
This is done by adding a new zend_atomic_bool type. The type
definition is only available for compiler alignment and size info; it
should be treated as opaque and only the zend_atomic_bool_* family of
functions should be used.

Note that directly using atomic_bool is complicated. All C++ compilers
stdlibs that I checked typedef atomic_bool to std::atomic<bool>, which
can't be used in an extern "C" section, and there's at least one usage
of this in core, and probably more outside of it.

So, instead use platform specific functions, preferring compiler
intrinsics.
2022-06-01 09:43:25 -06:00
Dmitry Stogov
df0c8aaee9 JIT: Fix array clobbering by user error handler
Fixes oss-fuzz #46336
2022-04-04 16:47:47 +03:00
Dmitry Stogov
4f18dbeb97 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fix array clobbering by user error handler
2022-04-04 16:37:17 +03:00
Dmitry Stogov
c489e360a6 JIT: Fix array clobbering by user error handler
Fixes oss-fuzz #46336
2022-04-04 16:36:25 +03:00
Dmitry Stogov
233b659223 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix memory leak
2022-02-01 16:26:29 +03:00
Dmitry Stogov
8e2406c59b Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix memory leak
2022-02-01 16:25:03 +03:00
Dmitry Stogov
a60a9b4a89 Fix memory leak
Fixes oss-fuzz #44222
2022-02-01 16:24:22 +03:00
Nikita Popov
4543cd32ae Remove JMPZNZ opcode
While JMPZNZ can avoid execution of a separate JMP opcode in some
cases, it also prevents smart branch optimization, so creating
JMPZNZ may actually have a negative effect. It also adds additional
complexity for optimizations.

Drop JMPZNZ in favor of JMPZ+JMP or JMPNZ+JMP.

Closes GH-7857.
2022-01-10 22:07:10 +01:00
Dmitry Stogov
aab52968a3 micro-optimization 2021-12-23 18:31:45 +03:00
Dmitry Stogov
5d6bc25063 Reset Bucket->key of deleted HastTable elemets to NULL.
This allows elimination of some Z_ISUNDEF(Bucket->val) checks.
2021-12-22 12:54:32 +03:00
Dmitry Stogov
192ea91deb Avoid useless symbol table reattaching on retutn from an included op_array 2021-12-16 21:44:43 +03:00
Dmitry Stogov
67bb79259b Don't execute INCLUDE for empty op_arrays. 2021-12-16 19:42:29 +03:00
Dmitry Stogov
79fac32d6b Don't call zend_attach/detach_symbol_table() for op_arrays without local variables 2021-12-16 17:37:01 +03:00
Dmitry Stogov
faa143ca1b Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix array clobbering by user error handler
2021-12-15 12:21:36 +03:00
Dmitry Stogov
75b2973974 Fix array clobbering by user error handler
Fixes oss-fuzz #42363
2021-12-15 12:20:37 +03:00
Dmitry Stogov
623b3fc83f Merge branch 'PHP-8.1'
* PHP-8.1:
  Move common code into helper
2021-12-14 15:32:20 +03:00
Dmitry Stogov
b16fc350a4 Move common code into helper 2021-12-14 15:31:53 +03:00
Dmitry Stogov
1959bbfc1b Merge branch 'PHP-8.1'
* PHP-8.1:
  Combine ADDREF/DELREF
2021-12-13 22:54:57 +03:00
Dmitry Stogov
1e56b64759 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Combine ADDREF/DELREF
2021-12-13 22:54:45 +03:00
Dmitry Stogov
c787f42ceb Combine ADDREF/DELREF 2021-12-13 22:38:23 +03:00
Dmitry Stogov
d9926a109d Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix array clobering by user error handler
2021-12-13 15:20:24 +03:00
Dmitry Stogov
76075823e7 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix array clobering by user error handler
2021-12-13 15:20:16 +03:00
Dmitry Stogov
cbc0b1afeb Fix array clobering by user error handler
Fixes oss-fuzz #42234
2021-12-13 14:59:30 +03:00
George Peter Banyard
da684582d7
ZEND_INIT_FCALL is only produced when function exists at compile time (#7728) 2021-12-09 17:15:59 +00:00
Dmitry Stogov
90e5eed9db Merge branch 'PHP-8.1'
* PHP-8.1:
  Separate "cold" code
2021-12-07 11:47:01 +03:00
Dmitry Stogov
08f1d470fb Separate "cold" code 2021-12-07 11:46:32 +03:00
Dmitry Stogov
fe1f613b75 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix use after free because of data clobbering by user error handler
2021-12-06 13:09:26 +03:00
Dmitry Stogov
5459ed4c2f Fix use after free because of data clobbering by user error handler
Fixes oss-fuzz #41692
2021-12-06 13:08:27 +03:00
Dmitry Stogov
1195ab8969 Merge branch 'PHP-8.1'
* PHP-8.1:
  Add test
  ws
  Fix array object clobbering by user error handler
2021-12-03 13:41:12 +03:00