Máté Kocsis
3bcf2c3755
Allow readonly properties to be reinitialized once during cloning ( #10389 )
...
RFC: https://wiki.php.net/rfc/readonly_amendments
2023-02-28 22:54:38 +01:00
Max Kellermann
0270a1e54c
Zend/zend_types.h: move IS_*
to zend_type_code.h
...
More decoupling of circular header dependencies.
2023-02-26 14:16:53 +00:00
Max Kellermann
d5c649b36b
zend_compiler, ...: use uint8_t
instead of zend_uchar
( #10621 )
...
`zend_uchar` suggests that the value is an ASCII character, but here,
it's about very small integers. This is misleading, so let's use a
C99 integer instead.
On all architectures currently supported by PHP, `zend_uchar` and
`uint8_t` are identical. This change is only about code readability.
2023-02-23 14:56:54 +00:00
Ilija Tovilo
a3e44bbb9d
Merge branch 'PHP-8.2'
...
* PHP-8.2:
Revert "Fix GH-10168: heap-buffer-overflow at zval_undefined_cv"
2023-02-16 14:18:24 +01:00
Ilija Tovilo
efb9181a98
Merge branch 'PHP-8.1' into PHP-8.2
...
* PHP-8.1:
Revert "Fix GH-10168: heap-buffer-overflow at zval_undefined_cv"
2023-02-16 14:13:17 +01:00
Ilija Tovilo
7b68ff46da
Revert "Fix GH-10168: heap-buffer-overflow at zval_undefined_cv"
...
This reverts commit 71ddede565
.
2023-02-16 14:07:17 +01:00
Bob Weinand
e8d16fda13
Merge branch 'PHP-8.2'
2023-02-13 13:10:44 +01:00
Bob Weinand
0e31e03bc5
Merge branch 'PHP-8.1' into PHP-8.2
2023-02-13 13:10:08 +01:00
Arnaud Le Blanc
d721dcc2ef
Fix colletion of unfinished function call in fibers
...
Fixes GH-10496.
Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
2023-02-13 13:09:04 +01:00
Ilija Tovilo
e3179a0955
Merge branch 'PHP-8.2'
...
* PHP-8.2:
Fix GH-10168: heap-buffer-overflow at zval_undefined_cv
2023-02-08 01:21:28 +01:00
Ilija Tovilo
972a5a02bd
Merge branch 'PHP-8.1' into PHP-8.2
...
* PHP-8.1:
Fix GH-10168: heap-buffer-overflow at zval_undefined_cv
2023-02-08 01:12:03 +01:00
Niels Dossche
71ddede565
Fix GH-10168: heap-buffer-overflow at zval_undefined_cv
...
The problem is that we're using the variable_ptr in the opcode handler
*after* it has already been destroyed. The solution is to create a
specialised version of zend_assign_to_variable which takes in two
destination zval pointers.
Closes GH-10524
2023-02-08 01:06:50 +01:00
Ilija Tovilo
47ed1904ef
Fix use-after-free in write_property when object is released
...
Fixes GH-10169
Closes GH-10179
2023-02-02 20:03:50 +01:00
Ilija Tovilo
35a36b13e5
Fix comp-time and constant evaluation of dynamic class constant fetch
...
Fixes GH-10486
Fixes oss-fuzz #55436
Fixes oss-fuzz #55472
Closes GH-10487
2023-02-02 19:18:17 +01:00
Christoph M. Becker
c8955c078a
Revert GH-10220
...
Cf. <https://github.com/php/php-src/pull/10220#issuecomment-1383739816 >.
This reverts commit ecc880f491
.
This reverts commit 588a07f737
.
This reverts commit f377e15751
.
This reverts commit b4ba16fe18
.
This reverts commit 694ec1deea
.
This reverts commit 6b34de8eba
.
This reverts commit aa1cd02a43
.
This reverts commit 308fd311ea
.
This reverts commit 16203b53e1
.
This reverts commit 738fb5ca54
.
This reverts commit 9fdbefacd3
.
This reverts commit cd4a7c1d90
.
This reverts commit 928685eba2
.
This reverts commit 01e5ffc85c
.
2023-01-16 12:27:33 +01:00
Christoph M. Becker
bf1cfc0753
Revert GH-10300
...
Cf. <https://github.com/php/php-src/pull/10220#issuecomment-1383739816 >.
This reverts commit 68ada76f9a
.
his reverts commit 45384c6e20
.
This reverts commit ef7fbfd710
.
This reverts commit 9b9ea0d7c6
.
This reverts commit f15747c26b
.
This reverts commit e883ba93c4
.
This reverts commit 7e87551c37
.
This reverts commit 921274d2b8
.
This reverts commit fc1f528e5e
.
This reverts commit 0961715cda
.
This reverts commit a93f264526
.
This reverts commit 72dd94e1c6
.
This reverts commit 29b2dc8964
.
This reverts commit 05c7653bba
.
This reverts commit 5190e5c260
.
This reverts commit 6b55bf228c
.
This reverts commit 184b4a12d3
.
This reverts commit 4c31b7888a
.
This reverts commit d44e9680f0
.
This reverts commit 4069a5c43f
.
2023-01-16 12:22:54 +01:00
Max Kellermann
4069a5c43f
Zend/zend_execute: always include zend_globals.h
...
Commit ecc880f491
was incomplete; EG() is used in inline functions
outside of ZEND_DEBUG.
2023-01-15 15:07:58 +00:00
Arnaud Le Blanc
ba091ab3c7
Merge branch 'PHP-8.2'
...
* PHP-8.2:
[ci skip] NEWS
Reduce HT_MAX_SIZE to account for the max load factor of 0.5 (#10242 )
GC fiber unfinished executions (#9810 )
2023-01-13 12:31:12 +01:00
Arnaud Le Blanc
d89408075f
Merge branch 'PHP-8.1' into PHP-8.2
...
* PHP-8.1:
Reduce HT_MAX_SIZE to account for the max load factor of 0.5 (#10242 )
GC fiber unfinished executions (#9810 )
2023-01-13 12:28:21 +01:00
Arnaud Le Blanc
4fb149390a
GC fiber unfinished executions ( #9810 )
2023-01-13 12:04:28 +01:00
Max Kellermann
ecc880f491
Zend/zend_execute: include cleanup
2023-01-10 14:19:03 +00:00
Max Kellermann
0caef56ed6
Zend/zend_execute: make several pointers const
2023-01-04 12:59:16 +00:00
Ilija Tovilo
8731fb2d09
Fix caching of default params with side-effects
...
Fixes GH-9965
Closes GH-9935
2022-11-17 11:52:12 +01:00
Arnaud Le Blanc
02ed12240e
Merge branch 'PHP-8.2'
...
* PHP-8.2:
[ci skip] NEWS
[ci skip] NEWS
[ci skip] NEWS
Fix generator memory leaks when interrupted during argument evaluation (#9756 )
2022-11-04 16:06:42 +01:00
Arnaud Le Blanc
34a85fbea0
Merge branch 'PHP-8.1' into PHP-8.2
...
* PHP-8.1:
[ci skip] NEWS
[ci skip] NEWS
Fix generator memory leaks when interrupted during argument evaluation (#9756 )
2022-11-04 16:02:04 +01:00
Arnaud Le Blanc
4011657719
Merge branch 'PHP-8.0' into PHP-8.1
...
* PHP-8.0:
[ci skip] NEWS
Fix generator memory leaks when interrupted during argument evaluation (#9756 )
2022-11-04 15:59:14 +01:00
Arnaud Le Blanc
5d1f3e047c
Fix generator memory leaks when interrupted during argument evaluation ( #9756 )
2022-11-04 15:55:55 +01:00
Ilija Tovilo
4842edeae4
Improve magic __get and property type inconsistency error message
...
Fixes GH-9388
Closes GH-9436
2022-09-08 11:07:29 +02:00
Bob Weinand
dc5475c191
Save previous observer on the VM stack
...
This avoids a possible significant performance penalty, when some leaf function was observed, deep in the stack.
As a side effect, we are not iterating over prev_execute_data anymore and thus, non-observed fake frames, possibly on stack, cannot have any impact on the observer anymore (especially within zend_observer_fcall_end_all).
Saving the previous observer happens now directly on the VM stack. If there is any observer, function frames are allocated an extra zval (the last temporary), which will, on observed frames, contain the previous observed frame address.
2022-08-04 17:16:27 +02:00
George Peter Banyard
6b160e78a7
Change fetch_type from int to uint32_t ( #9152 )
...
This is because it is derived from the opcode num which is an uint32_t
2022-07-28 21:03:09 +01:00
Ilija Tovilo
40908b10fc
Merge branch 'PHP-8.1'
...
* PHP-8.1:
Disallow assigning reference to unset readonly property
2022-07-01 12:20:32 +02:00
Ilija Tovilo
110573726b
Disallow assigning reference to unset readonly property
...
Closes GH-7942
Closes GH-8188
2022-07-01 12:16:32 +02:00
Joe Rowell
89688b115d
Add function exposing HAVE_GCC_GLOBAL_REGS ( #8359 )
2022-06-08 12:32:30 +01:00
Cameron Porter
812df2bd8a
Fix bug #81611
...
Add zend_fetch_class_with_scope() which accepts a scope to use for
self/parent, and use that during constant expression evaluation.
Closes GH-7649.
2021-11-16 14:40:06 +01:00
Nikita Popov
a4fa00ead3
Reuse wrong string offset logic in jit
...
JIT contains a copy of this function that effectively only differs
by fetching current_execute_data from EG. We can do that in the VM
version as well, as this is just used to throw an error.
Export the VM function and reuse it in JIT.
2021-10-05 16:33:31 +02:00
Nikita Popov
5b2ddf5a17
Export zend_use_resource_as_offset()
...
Use a common implementation to generate this error message, as
we do so in quite a few places dealing with array keys.
2021-08-31 10:58:01 +02:00
Nikita Popov
cecea72a10
Reuse parts of normal executor shutdown for preloading
...
preloading currently reimplements parts of shutdown_executor(),
so it's easy for that code to go out of sync.
Extract this into an zend_shutdown_executor_values() API function
and use it as part of the preloading pre-shutdown.
2021-08-16 16:20:03 +02:00
Joe Watkins
05ef6334cd
Fix bug #81303 improve match errors
2021-08-02 17:31:26 +02:00
Nikita Popov
8befb6d84f
Assert that call to method always has called scope or object
2021-07-23 11:26:39 +02:00
Nikita Popov
6780aaa532
Implement readonly properties
...
Add support for readonly properties, for which only a single
initializing assignment from the declaring scope is allowed.
RFC: https://wiki.php.net/rfc/readonly_properties_v2
Closes GH-7089.
2021-07-20 12:05:46 +02:00
Kamil Tekiela
052af90b86
Deprecate autovivification on false
...
Deprecate automatically converting "false" into an empty array
on write operands. Autovivification continues to be supported
for "null" values, as well as undefined/uninitialized values.
RFC: https://wiki.php.net/rfc/autovivification_false
Closes GH-7131.
Co-authored-by: Tyson Andre <tysonandre775@hotmail.com>
Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2021-07-19 14:49:37 +02:00
Nikita Popov
ee65e92070
Check internal function type consistency in zend_call_function
...
We do this for calls in the engine, but not those going through
zend_call_function().
2021-07-13 11:50:07 +02:00
George Peter Banyard
069a9fa5e4
Pure Intersection types ( #6799 )
...
Implement pure intersection types RFC
RFC: https://wiki.php.net/rfc/pure-intersection-types
Co-authored-by: Nikita Popov <nikic@php.net>
Co-authored-by: Ilija Tovilo <ilutov@php.net>
2021-07-05 14:11:03 +02:00
Dmitry Stogov
973ae8d3e2
Move the whole "cold" path into the "cold" function.
2021-06-23 14:55:58 +03:00
Dmitry Stogov
3a78259525
JIT: Avoid too aggressive loop unrolling
...
This fixes tests/func/010.phpt failure with tracing JIT on ARM64.
2021-06-16 16:44:27 +03:00
Joe Watkins
cb3964aae4
move zend_vm_stack_new_page into header for sharing with fibers
2021-06-10 15:20:29 +02:00
Matt Brown
6cd0b48cac
Implement never return type
...
The never type can be used to indicate that a function never
returns, for example because it always unwinds.
RFC: https://wiki.php.net/rfc/noreturn_type
Closes GH-6761.
2021-04-19 11:27:29 +02:00
Josh Soref
462da6e09c
Fix spelling and grammar mistakes
...
This PR corrects misspellings identified by the check-spelling action.
The misspellings have been reported at jsoref@b6ba3e2#commitcomment-48946465
The action reports that the changes in this PR would make it happy: jsoref@602417c
Closes GH-6822.
2021-04-13 12:09:37 +02:00
George Peter Banyard
56c18c4038
Drop unneessary if branch and adjust arg_num type
...
This if branch seems to be a remain of when certain type errors where E_WARNINGs, something which isn't the case since PHP 8.0.
2021-03-25 02:12:06 +00:00
Nikita Popov
3e01f5afb1
Replace zend_bool uses with bool
...
We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.
Of course, zend_bool is retained as an alias.
2021-01-15 12:33:06 +01:00