| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Be more specific for the individual cases and provide relevant
type information.
|
|
|
|
|
|
|
|
| |
Convert the empty string assignment to an Error as per RFC [1]
Add a warning that only the first byte will be assigned to the offset if provided
a needle that is longer than one byte.
[1] https://wiki.php.net/rfc/engine_warnings
|
|\
| |
| |
| |
| | |
* PHP-7.4:
Properly propagate url_stat exceptions during include
|
| |
| |
| |
| |
| | |
Make sure we abort operations early, and that we don't emit
additional warnings or errors if an exception has been thrown.
|
|\ \
| |/
| |
| |
| | |
* PHP-7.4:
Avoid signed integer overflow in string offset check
|
| |
| |
| |
| | |
Cast to size_t before performing operations instead of afterwards.
|
|\ \
| |/
| |
| |
| | |
* PHP-7.4:
Fix leak in assign_ref with function
|
| |
| |
| |
| |
| | |
As far as I can see, the retval copying is already done in all
callers of this function, so it should not be duplicated here.
|
|\ \
| |/
| |
| |
| | |
* PHP-7.4:
Fix const/cv freeing on failed reference assignment
|
| | |
|
| | |
|
|\ \
| |/
| |
| |
| | |
* PHP-7.4:
Export zend_init_func_run_time_cache()
|
| | |
|
| | |
|
| |
| |
| |
| | |
Split off the fast-path case and avoid redundant checks.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
According to RFC: https://wiki.php.net/rfc/union_types_v2
The type representation now makes use of both the pointer payload
and the type mask at the same time. Additionall, zend_type_list is
introduced as a new kind of pointer payload, which is used to store
multiple class types. Each of the class types is a tagged pointer,
which may be either a class name or class entry. The latter is only
used for typed properties, while arguments/returns will instead use
cache slots. A type list can contain a mix of both names and CEs at
the same time, as not all classes may be resolvable.
One thing this is missing is support for union types in arginfo
and stubs, which I want to handle separately.
I've also dropped the special object code from the JIT implementation
for now -- I plan to add this back in a different form at a later time.
For now I did not want to include non-trivial JIT changes together
with large functional changes.
Another possible piece of follow-up work is to implement "iterable"
as an internal alias for "array|Traversable". I believe this will
eliminate quite a few special-cases that had to be implemented.
Closes GH-4838.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We now store the pointer payload and the type mask separately. This
is in preparation for union types, where we will be using both at
the same time.
To avoid increasing the size of arginfo structures, the
pass_by_reference and is_variadic fields are now stored as part of
the type_mask (8-bit are reserved for custom use).
Different types of pointer payloads are distinguished based on bits
in the type_mask.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Change a number of "resource used as offset" notices to warnings,
which were previously missed.
* Throw the "resource used as offset" warning for isset() as well.
* Make array_key_exists() behavior with regard to different key
types consistent with isset() and normal array accesses. All key
types now use the usual coercions and array/object keys throw
TypeError.
Closes GH-4887.
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Weird that there was no test for this...
This code is somewhat inefficient, because it will be performed
for every arg, rather than only once.
|
| |
| |
| |
| |
| | |
We don't emit VERIFY_RETURN_TYPE for void functions, so there's
no need to check it here. It's always an error.
|
| |
| |
| |
| |
| | |
Usually this function is only used if we already know that there is
a type. Add checks to the places where we don't.
|
|\ \
| |/
| |
| |
| | |
* PHP-7.4:
Don't autoload when checking property types
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Noticed while working on union types: We do not load argument and
return types during type checks, but we do load property types.
I'm normalizing the behavior towards the existing status quo (not
loading), though we may consider loading everywhere (all types,
and instanceof) in order to properly support class aliases.
|
| | |
|
| |
| |
| |
| | |
Instead of using a separate ce.
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This goes in the reverse direction of 4463acb9513dfb62206760c49b3da1fe4d92f40a.
After looking around a bit, it seems that we already check for
Z_ISERROR_P() on the get_property_ptr_ptr return value in other places.
So do this in zend_fetch_property_address() as well, and also make
sure that EG(error_zval) is indeed returned on exception in
get_property_ptr_ptr.
In particular, this fixes the duplicate exceptions that we used to
get because first get_property_ptr_ptr threw one and then
read_property throws the same exception again.
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Relying on setting ERROR if an exception happened during the
property address fetch is both a bit fragile and may pessimize
other codepaths that will check for exceptions in the VM. Adding
an extra exception check instead, which should also allow us to
drop the use of ERROR in this area in master.
|
|\ \
| |/ |
|
| | |
|
| |
| |
| |
| |
| | |
Avoid need of insertion NOP opcoes between unrelated SMART BRANCH instruction and following JMPZ/JMPNZ.
Now instead of checking the opcode of following instruction, the same information is encoded into SMART BRANH result_type.
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously if the "non well formed" notice was converted into an
exception we'd still end up executing the function.
Also drop the now unnecessary EG(exception) checks in the engine.
Additionally remote a bogus exception in zend_is_callable: It
should only be writing to error, but not directly throwing.
|
| | |
|
| |
| |
| |
| | |
BRANCH may be uninitialized (on exception).
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| | |
Make sure the initialize the result of FETCH_OBJ_UNSET operations.
I'm using a NULL value rather than ERROR here, because the latter
no longer exists in master.
|
| |
| |
| |
| |
| | |
Also replace the assertion failure with an E_CORE_ERROR that
includes the function name, so these are easier to debug.
|
| |
| |
| |
| | |
Part of https://wiki.php.net/rfc/engine_warnings.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It is now only used to signal exceptions for property reads. ERROR
zvals are never returned back to the VM anymore, so there's no
need to check for them when receiving a VAR.
Also return MAY_BE_ERROR, as ERROR is now no longer relevant for
inference.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This removes object auto-vivification support.
This also means that we can remove the corresponding special
handling for typed properites: We no longer need to check that a
property is convertible to stdClass if such a conversion might
take place indirectly due to a nested property write.
Additionally OBJ_W style operations now no longer modify the
object operand, and as such we no longer need to treat op1 as a
def in SSA form.
The next step would be to actually compile the whole LHS of OBJ_W
operations in R rather than W mode, but that causes issues with
SimpleXML, whose object handlers depend on the current compilation
structure.
Part of https://wiki.php.net/rfc/engine_warnings.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
`get_closure` handlers are called to check whether an object is
callable, and to actually get the closure, respectively. The behavior
of the handler might differ for these two cases, particularly the
handler may throw in the latter case, but should not in the former.
Therefore we add a `check_only` parameter, to be able to distinguish
the desired purpose.
|
| |
| |
| |
| |
| | |
Instead of a simple if or 0 comparison. This would no longer work
if zend_type is a struct.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We have lots of other typed properties related error messages of
the form "assign X to typed property Y::$z of type A", so use th
same format for the primary message as well. Special-casing things
like classes and nullability is not going to scale with future
type-system extensions, and I don't think it really adds clarity
either.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This switches zend_type from storing a single IS_* type code to
storing a MAY_BE_* type mask. Right now most code still assumes
that there is only a single type in the mask (or two together
with MAY_BE_NULL). But this will make it a lot simpler to introduce
union types.
An additional advantage (and why I'm doing this separately), is
that a number of special cases no longer need to be handled
separately: We can do a single mask & (1 << type) check to handle
all simple types, booleans (true|false) and null.
|