Commit Graph

15468 Commits

Author SHA1 Message Date
Fabien Villepinte
a555cc0b3d Clean DONE tags from tests
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.

Closes GH-4872.
2019-11-07 21:31:47 +01:00
Nikita Popov
e710862f8c Add compile warning for "confusable" types
We have a number of "types" like integer which are not actually
supported as builtin types -- instead they are silently interpreted
as class types.

I've seen this cause confusion a few types already. This change adds
a warning in this case. In the unlikely case that someone legitimately
wants to type against an integer class, the warning can be suppressed
by writing \integer or "use integer", or using Integer (this warning
will only trigger for lowercase spellings).

Closes GH-4815.
2019-11-07 15:05:08 +01:00
Nikita Popov
cb03bbbf60 Merge branch 'PHP-7.4'
* PHP-7.4:
  Disable ifunc resolvers under thread sanitizer as well
2019-11-07 13:11:58 +01:00
Nikita Popov
dacadf5aa3 Disable ifunc resolvers under thread sanitizer as well 2019-11-07 13:08:03 +01:00
Máté Kocsis
14bdb0cfc7 Fix consistency issues with array accesses warnings/exceptions
* 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.
2019-11-06 12:56:47 +01:00
Nikita Popov
0b0d4eb0eb Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #78787
2019-11-06 12:53:29 +01:00
Nikita Popov
a3e454aacc Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #78787
2019-11-06 12:53:21 +01:00
Nikita Popov
6d4965febd Fixed bug #78787
Not the first time inheritance of shadow properties causes an issue,
thankfully this whole concept is gone in PHP 7.4.
2019-11-06 12:52:34 +01:00
Christoph M. Becker
4c9ba3e042 7.3.13 is next 2019-11-05 18:20:56 +01:00
Nikita Popov
c46b2ed677 Remove support for array_key_exists() with objects 2019-11-04 13:10:03 +01:00
Nikita Popov
b509d67554 Merge branch 'PHP-7.4'
* PHP-7.4:
  Revert "Remove configure checks for supported instruction sets"
2019-11-04 11:34:02 +01:00
Nikita Popov
451314111b Revert "Remove configure checks for supported instruction sets"
This reverts commit edccf32f7f.

This was reported to cause issues for as yet unknown reasons in
bug #78769. As this was intended as code cleanup, revert this from
7.4 at least. May reapply it to master later.
2019-11-04 11:32:46 +01:00
Nikita Popov
11ce417215 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #78768
2019-11-01 17:04:59 +01:00
Nikita Popov
944c1cf034 Fixed bug #78768
Remove the typedef from zend_types.h, use explicit struct prefix
instead.
2019-11-01 17:04:15 +01:00
Christoph M. Becker
4008704f62 zend_parse_parameters_throw() is obsolete
Since `zend_parse_parameters()` throws now, there is no reason to
explicitly call `zend_parse_parameters_throw()` anymore, and since both
have actually the same implementation, we redefine the latter as macro.
2019-11-01 16:47:15 +01:00
Máté Kocsis
2204dbde3b Add missing ZPP checks
Closes GH-4878.
2019-11-01 15:26:52 +01:00
Nikita Popov
2f8b766838 Add stubs for WeakReference 2019-10-31 12:17:04 +01:00
Nikita Popov
1517bc4426 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove configure checks for supported instruction sets
2019-10-31 11:34:15 +01:00
Nikita Popov
edccf32f7f Remove configure checks for supported instruction sets
These were checking whether the instruction set is supported by
the host CPU, however they were only used to condition on whether
this instruction set is targeted at all. It would still use dynamic
dispatch (e.g. based on ifunc resolvers) to select the actual
implementation. Whether the target is guaranteed to support the
instruction set without dispatch is determined based on pre-defined
macros like __SSE2__.

This removes the configure-time builtin cpu checks to remove
confusion. Additionally this allows targeting an architecture that
is newer than the host architecture.
2019-10-31 11:27:53 +01:00
Nikita Popov
e0a401335d Make "unterminated comment" into a parse error 2019-10-30 11:00:27 +01:00
Nikita Popov
aef8836110 Don't check $this existence in object opcodes
We are now guaranteed that $this always exists inside methods, as
well as insides closures (if they use $this at all).

This removes checks for $this existence from the individual object
opcodes. Instead ZEND_FETCH_THIS is used in the cases where $this
is not guaranteed to exist, which is mainly the pseudo-main scope.

Closes GH-3822.
2019-10-30 09:30:13 +01:00
Nikita Popov
776f4bc680 Merge branch 'PHP-7.4'
* PHP-7.4:
  Add missing refcount increment
2019-10-30 09:23:23 +01:00
Nikita Popov
7816275244 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Add missing refcount increment
2019-10-30 09:23:06 +01:00
Nikita Popov
d3237b5504 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Add missing refcount increment
2019-10-30 09:22:51 +01:00
Nikita Popov
5f6eaf355c Add missing refcount increment 2019-10-30 09:22:20 +01:00
Nikita Popov
4963701aa4 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #78689
2019-10-29 15:08:03 +01:00
Nikita Popov
4f1d5380e2 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #78689
2019-10-29 15:07:28 +01:00
Nikita Popov
33dd25d21c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #78689
2019-10-29 15:06:52 +01:00
Nikita Popov
f9895b4bf5 Fixed bug #78689 2019-10-29 15:06:16 +01:00
Nikita Popov
6719d3e718 Add Z_PARAM_STRING/ARRAY_OR_NULL convenience macros 2019-10-29 13:29:52 +01:00
Nikita Popov
26327bcd3b Throw "Unsupported operand types" error when using ** on arrays 2019-10-29 13:05:02 +01:00
Nikita Popov
87fefd165a Remove ability to unbind $this of closures if used
This was deprecated in PHP 7.4, removing it for PHP 8.0.
2019-10-28 13:24:07 +01:00
Tyson Andre
9d48bf5152 Fix miscellaneous typos in docs and error messages
Closes GH-4863.
2019-10-28 11:44:08 +01:00
Nikita Popov
742aaaa150 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove redundant variable rv and optimize code
2019-10-28 11:42:57 +01:00
ZiMuyang
99c84cd92a Remove redundant variable rv and optimize code
Closes GH-4864.
2019-10-28 11:42:45 +01:00
Nikita Popov
9f98fddb7b Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix bug #78752
2019-10-28 10:28:24 +01:00
Nikita Popov
1ddda13d84 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #78752
2019-10-28 10:28:14 +01:00
Nikita Popov
b61b60d15b Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #78752
2019-10-28 10:28:04 +01:00
Nikita Popov
16c4910876 Fix bug #78752
NULL out the execute_data before destroying it, otherwise GC may
trigger while the execute_data is partially destroyed, resulting
in double-frees.

The handling of call stack unfreezing is a bit awkward because it's
a ZEND_API function, so we can't change the signature.
2019-10-28 10:27:32 +01:00
Nikita Popov
e63a44dd03 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix bug #78226: Don't call __set() on uninitialized typed properties
2019-10-25 16:32:14 +02:00
Nikita Popov
f1848a4b3f Fix bug #78226: Don't call __set() on uninitialized typed properties
Assigning to an uninitialized typed property will no longer trigger
a call to __set(). However, calls to __set() are still triggered if
the property is explicitly unset().

This gives us both the behavior people generally expect, and still
allows ORMs to do lazy initialization by unsetting properties.

For PHP 8, we should fine a way to forbid unsetting of declared
properties entirely, and provide a different way to achieve lazy
initialization.
2019-10-25 16:31:45 +02:00
Nikita Popov
c858d17f06 Optimize instanceof_function
Split out the simple equality check into an inline function --
this is one of the common cases.

Replace instanceof_function_ex with zend_class_implements_interface.
There are a few more places where it may be used.
2019-10-25 10:51:17 +02:00
Nikita Popov
bd7b1afd6e Check type is set when verifying variadic args
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.
2019-10-25 10:27:45 +02:00
Nikita Popov
296269cfe8 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove recursive check from instanceof_interface
2019-10-25 10:20:19 +02:00
Nikita Popov
184ba0c91c Remove recursive check from instanceof_interface
Parent interfaces are copied into the interface list during
inheritance, so there's no need to perform a recursive check.

Only exception are instanceof checks performed during inheritance
itself. However, we already have unlinked_instanceof for this
purpose, it just needs to be taught to handle this case.

Closes GH-4857.
2019-10-25 10:19:42 +02:00
Nikita Popov
374cbfe568 Merge branch 'PHP-7.4'
* PHP-7.4:
  Optimize instanceof_class/interface
2019-10-24 17:50:53 +02:00
Nikita Popov
c63a0e005a Optimize instanceof_class/interface
instanceof_class does not need to check for a NULL pointer in the
first iteration -- passing NULL to this function is illegal.

instanceof_interface does not need to use instanceof_class(), it
only has to check whether the CEs match exactly. There is no way
for an interface to appear inside "parent", it will always be in
"interfaces" only.
2019-10-24 17:47:35 +02:00
Nikita Popov
19bea48c9a Merge branch 'PHP-7.4'
* PHP-7.4:
  Clean up and clarify instanceof_function_ex()
2019-10-24 17:42:04 +02:00
Nikita Popov
435f269108 Clean up and clarify instanceof_function_ex()
The instanceof_interface_only() function was dead code (always
returned zero).

Clarify that the last parameter indicates whether the passed CE
is interface or class and rewrite the code in terms of assertions.
2019-10-24 17:40:25 +02:00
Nikita Popov
d71a6ee54f Remove unnecessary type checks in verify_missing_return_type
We don't emit VERIFY_RETURN_TYPE for void functions, so there's
no need to check it here. It's always an error.
2019-10-24 15:52:06 +02:00
Nikita Popov
9666d7a753 Don't check ZEND_TYPE_IS_SET() in zend_check_type()
Usually this function is only used if we already know that there is
a type. Add checks to the places where we don't.
2019-10-24 15:41:26 +02:00
Rasmus Lerdorf
af57b6330b Reverting push to wrong repo 2019-10-23 14:34:12 -07:00
Rasmus Lerdorf
5870efbcf5 Update alloc patch 2019-10-23 14:31:27 -07:00
Nikita Popov
13e0c5f4c9 Merge branch 'PHP-7.4'
* PHP-7.4:
  Don't autoload when checking property types
2019-10-23 12:24:01 +02:00
Nikita Popov
f841388781 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.
2019-10-23 12:21:30 +02:00
Nikita Popov
fe6c420b02 JIT: Handle typed refs in assign dim 2019-10-23 11:25:10 +02:00
Dmitry Stogov
626a5837c0 Merge branch 'PHP-7.4'
* PHP-7.4:
  Allow loading FFI bindings through ffi.preload directive
2019-10-22 17:53:24 +03:00
Dmitry Stogov
1417352dda Allow loading FFI bindings through ffi.preload directive 2019-10-22 17:52:56 +03:00
Colin O'Dell
8ccd58baca Add Z_PARAM_LONG_OR_NULL macro 2019-10-22 12:09:04 +02:00
Nikita Popov
530a8a3854 Fix and undeprecate ReflectionType::__toString()
Add deprecated _ZendTestClass::__toString() method to preserve
an existing test.

ReflectionType::__toString() will now return a complete
representation of the type, as it should have originally. Users
that relied on nullability being absent should have been pushed
to ReflectionNamedType::getName() by the deprecation of
ReflectionType::__toString() in PHP 7.1 / PHP 7.4.
2019-10-22 11:26:02 +02:00
Nikita Popov
d927b745d6 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix static prop cleanup for dl'ed internal classes
2019-10-21 12:17:43 +02:00
Nikita Popov
3d55386aa8 Fix static prop cleanup for dl'ed internal classes 2019-10-21 12:17:38 +02:00
Nikita Popov
065d00f241 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix leak with cycle in static prop of internal class
2019-10-21 10:27:35 +02:00
Nikita Popov
ed31e04133 Fix leak with cycle in static prop of internal class
More the cleanup of interned classes before the final GC run,
just like it is done for user classes.
2019-10-21 10:26:10 +02:00
Nikita Popov
e80934d747 Pass cache slot when printing type errors
Instead of using a separate ce.
2019-10-17 17:06:48 +02:00
Nikita Popov
9a634a9c6b Merge branch 'PHP-7.4'
* PHP-7.4:
  Integrate property types with variance system
2019-10-17 13:42:47 +02:00
Nikita Popov
cf85eb2468 Integrate property types with variance system
Property types are invariant, but may still have to load classes in
order to check for class aliases. This class loading should follow
the same rules as all other variance checks, rather than just
loading unconditionally.

This change integrates property type invariance checks into the
variance system as a new obligation type, and prevent early binding
if the type check cannot be performed.
2019-10-17 13:37:04 +02:00
Christoph M. Becker
273731fb76 Add Zend class/interface arginfo stubs
We also change `Generator::throw()` to expect a `Throwable` in the
first place, and we now throw a TypeError instead of returning `false`
from `Exception::getTraceAsString()`.
2019-10-15 16:21:00 +02:00
Nikita Popov
5c24f8042d Promote "Cannot use parent" to fatal error 2019-10-15 11:46:48 +02:00
Nikita Popov
4e563e6c95 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix handling of overflowing invalid octal in tokenizer
2019-10-14 16:37:27 +02:00
Nikita Popov
641f9615cc Fix handling of overflowing invalid octal in tokenizer
If token_get_all() is used, we still need to correctly distinguish
LNUMBER vs DNUMBER here for backwards compatibility.
2019-10-14 16:36:27 +02:00
Nikita Popov
db233501ff Use clean shutdown on uncaught exception 2019-10-11 12:41:15 +02:00
Fabien Villepinte
78c753e8ee
Fix typo in tests 2019-10-10 15:57:57 +02:00
Nikita Popov
93b39f68f5 Merge branch 'PHP-7.4' 2019-10-10 15:17:44 +02:00
Nikita Popov
5a076e670a Return error_zval form get_property_ptr_ptr on exception
This goes in the reverse direction of 4463acb951.
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.
2019-10-10 15:14:04 +02:00
Nikita Popov
2118f6a898 Merge branch 'PHP-7.4' 2019-10-10 14:44:53 +02:00
Nikita Popov
4463acb951 Explicitly check for exceptions in by-ref obj prop assign
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.
2019-10-10 14:41:35 +02:00
Nikita Popov
fea482ee5c Merge branch 'PHP-7.4' 2019-10-10 12:45:38 +02:00
Nikita Popov
12f4e9e020 Fix leak when property AST evaluation fails 2019-10-10 12:44:55 +02:00
Nikita Popov
1ab489e99a Merge branch 'PHP-7.4' 2019-10-10 11:42:05 +02:00
Nikita Popov
b02cf8b66e Merge branch 'PHP-7.3' into PHP-7.4 2019-10-10 11:41:51 +02:00
Nikita Popov
4ba8d78100 Merge branch 'PHP-7.2' into PHP-7.3 2019-10-10 11:41:29 +02:00
Nikita Popov
96c84b7bc1 Fix leak on static method call on non-existent class 2019-10-10 11:40:49 +02:00
Nikita Popov
595e8c6773 Merge branch 'PHP-7.4' 2019-10-10 11:17:55 +02:00
Nikita Popov
6878c583b0 Report error if stream_read is not implemented
We need to return -1 in this case. Slightly restructure the code
to avoid unnecessary conditions.
2019-10-10 11:13:10 +02:00
Nikita Popov
51501dacb1 Merge branch 'PHP-7.4' 2019-10-10 10:08:32 +02:00
Nikita Popov
382f9b28e8 Fix leak on "Cannot assign by reference to overloaded object" error 2019-10-10 10:07:54 +02:00
Nikita Popov
b093abcde3 Fix exception handling for call_user_func_array() with invalid type
Now that this throws an exception, the call frame cleanup will be
handled by exception handling -- remove it here to avoid double
frees.
2019-10-10 09:55:19 +02:00
Nikita Popov
efed9f6b15 Merge branch 'PHP-7.4' 2019-10-09 17:01:02 +02:00
Nikita Popov
91eb632472 Merge branch 'PHP-7.3' into PHP-7.4 2019-10-09 17:00:55 +02:00
Nikita Popov
6fd6ad8f53 Fixed bug #78658 2019-10-09 17:00:27 +02:00
Dmitry Stogov
d37f5da75e typo and cleanup 2019-10-09 17:58:35 +03:00
Nikita Popov
9c9a833f9c Actually remove the YIELD key specialization
I only adjusted the code before, without switching to TMPVAR.
2019-10-09 14:11:07 +02:00
Nikita Popov
165a065a12 Reduce YIELD key specialization
Keeping the value specialization for now, which is more commonly
applicable.
2019-10-09 13:59:07 +02:00
Nikita Popov
da3b245715 Reduce YIELD_FROM specialization
Generator delegation is a complex compound operation, it does not
make a lot of sense to optimize refcounting here to this degree.
2019-10-09 13:53:07 +02:00
Nikita Popov
2aba10be4a Reduce ZEND_THROW specialization
Throwing is very expensive due to the need of gathering the backtrace,
so it makes little sense to optimize refcounting to this degree.
2019-10-09 13:17:25 +02:00
Dmitry Stogov
f6f32f2cf0 SAMRT BRANCH improvement.
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.
2019-10-09 13:48:39 +03:00
Nikita Popov
a32f130f94 Merge branch 'PHP-7.4' 2019-10-08 17:34:25 +02:00
Nikita Popov
bea832cbf6 Don't check type of simple parameter default values
After fixing the int->double coercion case, this is already verified
at compile-time, so there is no need to redo this type check on
every call.

Only perform the type check every time for the case of AST default
values.
2019-10-08 17:29:41 +02:00
Nikita Popov
7c1bc91e52 Merge branch 'PHP-7.4' 2019-10-08 17:19:52 +02:00
Nikita Popov
21148679d1 Handle "non well formed" exception during ZPP
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.
2019-10-08 17:17:49 +02:00
Dmitry Stogov
31c3b0c7cc Fixed Zend/tests/bug70785.phpt on builds wothout global regesters 2019-10-08 17:08:59 +03:00
Nikita Popov
cffa81e438 Merge branch 'PHP-7.4' 2019-10-08 15:52:18 +02:00
Dmitry Stogov
56ae3f6c4a Added "const" qualifier 2019-10-08 16:50:04 +03:00
Nikita Popov
9004102b99 Fixed bug #78648 2019-10-08 15:39:22 +02:00
Dmitry Stogov
eec04f6b56 Encapsulate all SMART BRANCH related logic inside macros. Result of SMART BRANCH may be uninitialized (on exception). 2019-10-08 16:37:21 +03:00
Nikita Popov
d98497615c Merge branch 'PHP-7.4' 2019-10-08 14:33:01 +02:00
Nikita Popov
ad3ddf46f9 Fixed bug #78644
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.
2019-10-08 14:32:49 +02:00
Christoph M. Becker
26f45cb4bb 7.3.12 is next 2019-10-08 12:04:25 +02:00
Nikita Popov
e9f4676b3f Merge branch 'PHP-7.4' 2019-10-07 17:31:12 +02:00
Nikita Popov
2f64844495 Fix leak when include fails in a read operation
Usually it will already fail when opening, but reads can also
fail since PHP 7.4, in which case we still need to place the
file handle in open_files to make sure the destructor will run
on it.
2019-10-07 17:29:33 +02:00
Dmitry Stogov
b02b81299c Comparison cleanup:
- introduce zend_compare() that returns -1,0,1 dirctly (without intermediate zval)
- remove compare_objects() object handler, and keep only compare() handler
2019-10-07 17:57:49 +03:00
Nikita Popov
57670c6769 Check num required args is correct in debug builds
Also replace the assertion failure with an E_CORE_ERROR that
includes the function name, so these are easier to debug.
2019-10-07 16:34:05 +02:00
Nikita Popov
5f80eb7842 Fix required number of arguments in stubs
* get_parent_class() argument is optional
* Mark array_filter() $callback as optional
* The $base of gmp_strval() is optional
* DateTime constructor also accepts zero arguments
* hash_update_file() stream context is optional
* xmlwriter_write_dtd_entity() $isparam argument is optional
2019-10-07 16:33:41 +02:00
Nikita Popov
5050507282 Merge branch 'PHP-7.4' 2019-10-04 22:47:10 +02:00
Nikita Popov
b078ae6c01 Merge branch 'PHP-7.3' into PHP-7.4 2019-10-04 22:46:53 +02:00
Nikita Popov
239e2dda64 Make sure T_ERROR is returned for all lexer exceptions
This originally manifested as a leak in oss-fuzz #18000. The following
is a reduced test case:

    <?php
    [
        5 => 1,
        "foo" > 1,
        "      " => "" == 0
    ];
    <<<BAR
    $x
     BAR;

Because this particular error condition did not return T_ERROR,
EG(exception) was set while performing binary operation constant
evaluation, which checks exceptions for cast failures.

Instead of adding this indirect test case, I'm adding an assertion
that the lexer has to return T_ERROR if EG(exception) is set.
2019-10-04 22:42:14 +02:00
Nikita Popov
fec0ff8cb0 Merge branch 'PHP-7.4' 2019-10-04 12:42:58 +02:00
Nikita Popov
ca652aafa8 Fixed bug #78632
I'm going for a very conservative fix here, where the previous
logic is restored for the case where an object is passed to
method_exists(). We might want to check against EG(scope) instead,
but this seems like a safer choice.

This means that behavior in PHP 7.4 changes only for
method_exists('C', 'privateMethodNotOnC'), which should be sensible.
2019-10-04 12:41:49 +02:00
Nikita Popov
d44cf9b539 Replace "unexpected character" warning with ParseError
Closes GH-4767.
2019-10-04 11:28:58 +02:00
Nikita Popov
11d139625f Merge branch 'PHP-7.4' 2019-10-04 10:39:32 +02:00
Nikita Popov
9659562cb5 Fix use-after-free with delayed interned memoized const operand
We should addref CONST operands during memoization, as they might
be destroyed by later compilation, e.g. through interning.
2019-10-04 10:38:11 +02:00
Nikita Popov
c10cd739a7 Merge branch 'PHP-7.4' 2019-10-04 10:12:16 +02:00
Nikita Popov
f26b60a583 Fix crash when unpacking into array literal with string keys 2019-10-04 10:11:30 +02:00
Christoph M. Becker
0edcd105f3 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #78620: Out of memory error
2019-10-04 09:14:36 +02:00
Christoph M. Becker
6627f782d6 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78620: Out of memory error
2019-10-04 09:11:18 +02:00
Christoph M. Becker
cf183a5e2c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78620: Out of memory error
2019-10-04 09:09:39 +02:00
Christoph M. Becker
abaf9a76dc Fix #78620: Out of memory error
The integer addition in `ZEND_MM_ALIGNED_SIZE_EX` can overflow, what we
have to catch early.
2019-10-04 09:08:01 +02:00
Dmitry Stogov
de3c1eb85e Move obvious optimization patterns from pass1 directly to compiler 2019-10-03 14:57:20 +03:00
Christoph M. Becker
f6c685a750 Merge branch 'PHP-7.4'
* PHP-7.4:
  Revert "Fix #78620: Out of memory error"
2019-10-02 19:03:48 +02:00
Christoph M. Becker
2508131588 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Revert "Fix #78620: Out of memory error"
2019-10-02 19:03:25 +02:00
Christoph M. Becker
d295e1dce2 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Revert "Fix #78620: Out of memory error"
2019-10-02 19:02:28 +02:00
Christoph M. Becker
f2fb37a772 Revert "Fix #78620: Out of memory error"
This reverts commit 8ce04df7e0.

Cf. <https://github.com/php/php-src/pull/4766#discussion_r330658679>.
2019-10-02 19:01:35 +02:00
Christoph M. Becker
d0672fc005 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #78620: Out of memory error
2019-10-02 18:22:11 +02:00
Christoph M. Becker
b262b24beb Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78620: Out of memory error
2019-10-02 18:21:50 +02:00
Christoph M. Becker
752a34fb2c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78620: Out of memory error
2019-10-02 18:20:09 +02:00
Christoph M. Becker
8ce04df7e0 Fix #78620: Out of memory error
If the integer addition in `ZEND_MM_ALIGNED_SIZE_EX` overflows, the
macro evaluates to `0`, what we should catch early.
2019-10-02 18:18:52 +02:00
Nikita Popov
d882795d78 Merge branch 'PHP-7.4' 2019-10-02 12:08:12 +02:00
Nikita Popov
171d6c3ca7 Merge branch 'PHP-7.3' into PHP-7.4 2019-10-02 12:07:33 +02:00
Nikita Popov
3c42471ef8 Merge branch 'PHP-7.2' into PHP-7.3 2019-10-02 12:07:19 +02:00
Nikita Popov
a5d3620d93 Fix segfault with __COMPILER_HALT_OFFSET__ and trailing {}
Fixes OSS-Fuzz #17895.
2019-10-02 12:07:15 +02:00
Nikita Popov
2f92957fd3 Convert some notices to warnings
Part of https://wiki.php.net/rfc/engine_warnings.
2019-10-02 10:34:08 +02:00
Nikita Popov
edace5f5e0 Merge branch 'PHP-7.4' 2019-10-01 13:05:12 +02:00
Nikita Popov
f2e8851245 Remove func copy optimization for private method with static vars
Not NULLing the static_variables pointer for shadow methods during
static var shutdown would be a way to avoid this leak, but unless
there's evidence that inherited private methods with static vars are
actually a common use-case, I don't think we should keep this kind
of fragile edge-case optimization.

Fixes OSS-Fuzz #17875.
2019-10-01 13:04:06 +02:00
Nikita Popov
01fc1a3057 Remove most uses of the ERROR type
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.
2019-09-30 11:35:07 +02:00
Nikita Popov
7e77617533 Merge branch 'PHP-7.4' 2019-09-30 10:42:47 +02:00
Nikita Popov
19e7e4b197 Fixed bug #78604
<?php followed by EOF is valid since PHP 7.4.
2019-09-30 10:41:14 +02:00
Dmitry Stogov
9372b6876d Restore "avoid exception check" optimization and add EG(exception) check only on slow path. 2019-09-30 11:40:25 +03:00
Nikita Popov
33bf1495b2 Don't use asm arithmetic under msan
Clang 9 supports asm goto, so these no longer get automatically
skipped.
2019-09-29 11:38:34 +02:00
Nikita Popov
38387d7cfc Merge branch 'PHP-7.4' 2019-09-28 17:17:36 +02:00
Nikita Popov
1b08ab26f7 Merge branch 'PHP-7.3' into PHP-7.4 2019-09-28 17:17:18 +02:00
Nikita Popov
7df50ef147 Don't throw warnings during heredoc scan-ahead
Otherwise these warnings will turn up twice (or more...)
2019-09-28 17:15:36 +02:00
Nikita Popov
8145da0d82 Remove unused zend_del_literal() function 2019-09-27 23:58:48 +02:00
Nikita Popov
38b19d47e0 Convert "Only arrays and Traversables can be unpacked" into Error 2019-09-27 15:50:34 +02:00
Nikita Popov
e8b0163e0b Promote write "use scalar as array" warning to Error 2019-09-27 15:49:18 +02:00
Nikita Popov
2354aa9676 Add test for illegal unset/isset offset
Weirdly these warnings had zero coverage previously...

Remove an incorrect exception checking optimization: The key
lookup may throw (it could also throw previously, though only
through a custom error handler).
2019-09-27 13:00:07 +02:00
Nikita Popov
0ebf2bdba0 Convert "Illegal offset type" warnings to exceptions 2019-09-27 13:00:07 +02:00
Nikita Popov
f2b09969db Convert "cannot add element" warning to exception 2019-09-27 13:00:07 +02:00
Nikita Popov
34e7c2daf0 Merge branch 'PHP-7.4' 2019-09-27 10:49:25 +02:00
Nikita Popov
a6c9c7c2b8 Handle resources used as array keys consistently
Resources used as array keys are generally handled by throwing a
notice and converting the resource to the resource handle. The only
exception is the [$resource => null] syntax, where this was treated
as an illegal offset type instead. However, this also only happened
for VM evaluations, the AST evaluator did handle resources correctly.
2019-09-27 10:40:41 +02:00
Nikita Popov
a66c60cce3 Throw Error when writing property of non-object
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.
2019-09-27 10:11:47 +02:00
Nikita Popov
8686a3d30b Merge branch 'PHP-7.4' 2019-09-26 13:50:02 +02:00
Nikita Popov
d71f859a56 Merge branch 'PHP-7.3' into PHP-7.4 2019-09-26 13:47:41 +02:00
Nikita Popov
91c4abcfcc Merge branch 'PHP-7.2' into PHP-7.3 2019-09-26 13:47:19 +02:00
Nikita Popov
ab938d7bbc Fix memory leak with ** on array operands 2019-09-26 13:45:45 +02:00
Nikita Popov
adcc07dd44 Merge branch 'PHP-7.4' 2019-09-26 10:26:12 +02:00
Nikita Popov
247d5618aa Merge branch 'PHP-7.3' into PHP-7.4 2019-09-26 10:25:55 +02:00
Nikita Popov
99c67804d5 Merge branch 'PHP-7.2' into PHP-7.3 2019-09-26 10:25:40 +02:00
Nikita Popov
8a9df88597 Fix null-pointer deref in if stmt printing
Fixes OSS-Fuzz #17721.
2019-09-26 10:24:49 +02:00
Dmitry Stogov
470bbb8c70 Avoid code dupliction 2019-09-26 01:40:30 +03:00
Dmitry Stogov
de599aec9f Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed GOTO VM
2019-09-26 01:20:48 +03:00
Dmitry Stogov
23db95e3e5 Fixed GOTO VM 2019-09-26 01:17:54 +03:00
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Christoph M. Becker
0c7124e6be Add check_only parameter to get_closure handler
`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.
2019-09-24 16:08:42 +02:00
Nikita Popov
3b52307c86 Merge branch 'PHP-7.4' 2019-09-24 12:19:14 +02:00
Nikita Popov
73115ef873 Fixed bug #78589
Don't protect GC while destroying zvals. We may need to add GC
roots during this phase.
2019-09-24 12:17:21 +02:00
Dmitry Stogov
6e226c188c Change ZEND_RECV and ZEND_RECV_VARIADIC to use extended_value for cache slot (instead of op2), to be consistent with ZEND_RECV_INIT. 2019-09-23 22:28:56 +03:00
Nikita Popov
2128c634f6 Check that type is set in ZEND_TYPE_IS_MASK()
Allow this macro to be used without an explicit ZEND_TYPE_IS_SET()
check.
2019-09-23 19:43:27 +02:00
Nikita Popov
6276dd826b Use ZEND_TYPE_IS_SET() when checking for property types
Instead of a simple if or 0 comparison. This would no longer work
if zend_type is a struct.
2019-09-23 16:53:54 +02:00
Nikita Popov
3012d006ff Don't set nullability flag for parameters without type
Use value 0 instead. To compensate we check in ReflectionParameter
allowsNull() whether the type is set at all: If it isn't, it always
allows null.

This removes a discrepancy between internal&userland functions:
For userland functions allowsNull() on untyped parameters returned
true, but for internal functions it returned false.
2019-09-23 16:39:52 +02:00
Nikita Popov
5dcbc65a53 Canonicalize typed prop/param default value errors
Use shared logic to determine what values are valid, and a single
error message format.
2019-09-23 16:20:26 +02:00
Nikita Popov
b7745d6eeb Check for nullable void type earlier 2019-09-23 15:59:47 +02:00
Nikita Popov
d7ae123648 Canonicalize typed properties error message
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.
2019-09-23 15:48:49 +02:00
Nikita Popov
9e8ba7891e Change representation of zend_type from type code to MAY_BE_* mask
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.
2019-09-23 15:31:35 +02:00
Nikita Popov
cdd4e591a4 Don't make argument nullable based on AST null initializer
Closes GH-4720.
2019-09-19 11:27:00 +02:00
Christoph M. Becker
d6ef63db53 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #78543: is_callable() on FFI\CData throws Exception
2019-09-19 09:17:53 +02:00
Christoph M. Becker
9dfbcd7248 Fix #78543: is_callable() on FFI\CData throws Exception
If `Z_OBJ_HANDLER_P(callable, get_closure)` throws, we must not let the
exeception pass to userland, if called through `is_callable()`.
2019-09-19 09:13:22 +02:00
Nikita Popov
2cafaab885 Merge branch 'PHP-7.4' 2019-09-17 13:15:01 +02:00
Nikita Popov
d266ba4f2d Check for exception after calling count_values()
To avoid a duplicate error if count_values() throws.
2019-09-17 13:13:44 +02:00
Nikita Popov
31c6c861a2 Merge branch 'PHP-7.4' 2019-09-17 12:55:18 +02:00
David Carlier
ce25fa0d24 Monitoring anonymous pages on mac via vmmap tag 2019-09-17 12:54:46 +02:00
Nikita Popov
d26eb10f08 Merge branch 'PHP-7.4' 2019-09-16 15:01:22 +02:00
Nikita Popov
8c0c06da86 Merge branch 'PHP-7.3' into PHP-7.4 2019-09-16 15:01:14 +02:00
Nikita Popov
8a11f1284e Merge branch 'PHP-7.2' into PHP-7.3 2019-09-16 15:01:05 +02:00
Nikita Popov
2f6efd835d Fixed bug #78545
By using an explicit (double) cast.
2019-09-16 15:00:20 +02:00
Nikita Popov
bbfe298fb6 Merge branch 'PHP-7.4' 2019-09-16 12:00:26 +02:00
Nikita Popov
c8359fcea2 Fix test after unserialize change 2019-09-16 11:59:43 +02:00
Nikita Popov
3372a24b99 Merge branch 'PHP-7.4' 2019-09-14 12:10:15 +02:00
Nikita Popov
3f76f9416f Fix double-free on invalid large octal with separators
To clean up the mess here a bit, check for invalid octal digits
with an explicit loop instead of mixing this into the string to
number conversion.

Also clean up some type usage.
2019-09-14 12:10:06 +02:00
Nikita Popov
a86e04876b Merge branch 'PHP-7.4' 2019-09-14 00:25:39 +02:00
Nikita Popov
ee0bf4b24d Define OBJ_PROP_TO_OFFSET() using XtOffsetOf()
This avoids null pointer arithmetic UB.
2019-09-14 00:24:54 +02:00
Nikita Popov
ec30a3b171 Include stddef.h in zend_portability.h for offsetof() macro
This makes sure that we use compiler builtins when they are
available and thus avoid ubsan warnings in clang.

And also reindent the fallback implementation.
2019-09-14 00:24:47 +02:00
Nikita Popov
b6d138fba1 Merge branch 'PHP-7.4' 2019-09-13 18:23:47 +02:00
Nikita Popov
4226c8247f Fix use-after-free in assign-ref compilation
zend_emit_op_data may reallocate the op_array, so the assignment
of the RETURNS_FUNCTION flag may happen on an outdated opline.

Restructure the code a bit to set the flag before calling
zend_emit_op_data().
2019-09-13 18:22:14 +02:00
Dmitry Stogov
8a673e9380 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed incorrect usage of QM_ASSIGN instruction
2019-09-13 12:13:25 +03:00
Dmitry Stogov
e45a757bc2 Fixed incorrect usage of QM_ASSIGN instruction 2019-09-13 12:08:59 +03:00
Dmitry Stogov
cf4c4ee900 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #78531 (Crash when using undefined variable as object
2019-09-13 01:43:40 +03:00
Dmitry Stogov
51d9f32dbe Fixed bug #78531 (Crash when using undefined variable as object 2019-09-13 01:42:02 +03:00
Dmitry Stogov
86a56f89a3 Use zval_try_get_tmp_string() instead of zval_get_tmp_string() for cheaper EG(exception) check 2019-09-13 00:20:06 +03:00
Dmitry Stogov
0a7233f2aa Avoid reloading 2019-09-12 20:13:31 +03:00
Dmitry Stogov
358a6b4c31 Reorder conditions 2019-09-12 19:43:45 +03:00
Dmitry Stogov
8b10fcd3e7 Merge branch 'PHP-7.4'
* PHP-7.4:
  Load string once
2019-09-12 18:53:26 +03:00
Dmitry Stogov
5a616191f3 Load string once 2019-09-12 18:46:13 +03:00
Dmitry Stogov
13fd8c533c Merge branch 'PHP-7.4'
* PHP-7.4:
  Eliminate checks using ZEND_CONST_COND() macro
2019-09-12 18:29:58 +03:00
Dmitry Stogov
697266a84e Eliminate checks using ZEND_CONST_COND() macro 2019-09-12 18:29:19 +03:00
Nikita Popov
f61f122b9a Merge branch 'PHP-7.4' 2019-09-12 16:41:45 +02:00
Nikita Popov
4b9ebd837b Allow throwing exception while loading parent class
This is a fix for symfony/symfony#32995.

The behavior is:

* Throwing exception when loading parent/interface is allowed
  (and we will also throw one if the class is simply not found).
* If this happens, the bucket key for the class is reset, so
  it's possibly to try registering the same class again.
* However, if the class has already been used due to a variance
  obligation, the exception is upgraded to a fatal error, as we
  cannot safely unregister the class stub anymore.
2019-09-12 16:41:18 +02:00
Nikita Popov
a09da43888 Merge branch 'PHP-7.4' 2019-09-11 17:05:07 +02:00
Nikita Popov
d88b212ea6 Improve "already declared" error message
If this error is missing because the rtd_key was renamed to lcname,
fetch the class based on lcname and use the class type and cased
name from there.
2019-09-11 17:04:13 +02:00
Nikita Popov
a97645eb0a Merge branch 'PHP-7.4' 2019-09-11 16:51:30 +02:00
Nikita Popov
fbe287a677 Fix typo in unlinked_instanceof assertion 2019-09-11 16:50:16 +02:00
Nikita Popov
403396e42c Merge branch 'PHP-7.4' 2019-09-11 16:30:59 +02:00
Nikita Popov
270e5e3c5b Only allow "nearly linked" classes for parent/interface
The requirements for parent/interface are difference than for the
variance checks in type declarations. The latter can work on fully
unlinked classes, but the former need inheritance to be essentially
finished, only variance checks may still be outstanding.

Adding a new flag for this because we have lots of space, but we
could also represent these "inheritance states" more compactly in
the future.
2019-09-11 16:27:28 +02:00
Christoph M. Becker
cf31210f29 PHP 7.3.10RC1 has been tagged 2019-09-10 15:11:54 +02:00
Dmitry Stogov
02c83b809a ceanup 2019-09-10 15:12:42 +03:00
Florian Weimer
aeaab8ee3e Port various autoconf bits to C99 compilers
C99 no longer has implicit function declarations and implicit ints.
Current GCC versions enable them as an extension, but this will
change in a future GCC version.
2019-09-10 12:32:14 +02:00
Peter Cowburn
bc61997571 add ValueError
ValueError is intended to be thrown when a function or method receives
an argument that has the right type (incorrect type should throw a
TypeError) but an inappropriate value.
2019-09-09 21:06:00 +01:00
Christoph M. Becker
8aff6627b4 Merge branch 'PHP-7.4'
* PHP-7.4:
  new_variable '{' expr '}' is deprecated as well
2019-09-09 19:06:43 +02:00
Christoph M. Becker
bcf9d1e995 new_variable '{' expr '}' is deprecated as well
Curly brace syntax for accessing array elements and string offsets is
deprecated [1]; this should also be the case for respective `new`
expressions.

This issue has been reported by brzuchal@php.net.

[1] <https://wiki.php.net/rfc/deprecate_curly_braces_array_access>
2019-09-09 19:05:23 +02:00
Ivan Enderlin
dce8d19fc1 Mention that arg_info[-1] holds the return info
I lost some time trying to know how to find the returned type.
It's not that obvious it is stored in the _argument_ information array.

For the sake of Internet, here is the full code checking that a function _has_ a returned type:

```c
zend_function *function = /* e.g. fci_cache->function_handler */;

if (!(function->op_array.fn_flags & ZEND_ACC_HAS_RETURN_TYPE)) {
    php_printf("no return type\n");
} else {
    php_printf("has a return type\n");
    php_printf("return type = %s\n", zend_get_type_by_const(ZEND_TYPE_CODE(function->common.arg_info[-1].type)));
}
```
2019-09-09 17:42:26 +02:00
Nikita Popov
ee4b11c668 Detect calls to abstract methods in get_method() already
Instead of checking for this during DO_FCALL, already detect this
case during get_method()/get_static_method(), similar to visibility
checks.

This causes a minor difference in behavior, in that arguments will
no longer be evaluated. I think this is correct though (and consistent
with visibility errors).
2019-09-06 15:05:24 +02:00
Nikita Popov
e530a89c00 Merge branch 'PHP-7.4' 2019-09-06 11:33:36 +02:00
Nikita Popov
e81751ceac Fixed bug #78502
We need to make sure that the function is fully compiled before we
calculate the stack size. There already was a check for directly
recursive calls, but the same issue exists with indirectly recursive
calls.

I'm using DONE_PASS_TWO as the indication that the function is
fully compiled.
2019-09-06 11:33:28 +02:00
Dmitry Stogov
9513b20738 Merge branch 'PHP-7.4'
* PHP-7.4:
  Revert "Microoptimization (avoid code duplication)"
2019-09-05 15:35:42 +03:00
Dmitry Stogov
4ecdff2da8 Revert "Microoptimization (avoid code duplication)"
This reverts commit 25d97f5eee.
2019-09-05 15:35:19 +03:00
Dmitry Stogov
1b5d41751f Merge branch 'PHP-7.4'
* PHP-7.4:
  Microoptimization (avoid code duplication)
2019-09-05 13:45:25 +03:00
Dmitry Stogov
25d97f5eee Microoptimization (avoid code duplication) 2019-09-05 13:44:46 +03:00
Dmitry Stogov
0f8bb9e37d Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove HOT attribute from some VM handlers. Comparisons almost always followed by JMPZ/JMPNZ; JMPZNZ is rare used.
  Remove --with-zlib-dir option from mysqlnd config
2019-09-05 11:43:13 +03:00
Dmitry Stogov
7237da27fe Remove HOT attribute from some VM handlers. Comparisons almost always followed by JMPZ/JMPNZ; JMPZNZ is rare used. 2019-09-05 11:40:15 +03:00
Nikita Popov
395e87d497 Merge branch 'PHP-7.4' 2019-09-04 15:33:16 +02:00
Nikita Popov
b6f76aca54 Improve exception handling for abstract/deprecated calls
Reuse existing arg freeing loop instead of duplicating it.

Additionally also handle deprecated in DO_FCALL_BY_NAME.
2019-09-04 15:19:21 +02:00
Nikita Popov
b02f425b6c Merge branch 'PHP-7.4' 2019-09-04 12:47:21 +02:00
Nikita Popov
4bb7282742 Fix handling of abstract/deprecated exception
The exception mechanism assumes that exceptions from DO_FCALL are
already happening after the function call. This means that we are
currently leaking the passed arguments, and I think we can also
corrupt the VM stack due to incorrect frame linking in some cases
(there are assertion failures if the VM stack page size is reduced).

Instead handle the stack frame freeing manually for this special
case.
2019-09-04 12:46:00 +02:00
Nikita Popov
cc4af3513d Merge branch 'PHP-7.4' 2019-09-03 13:59:59 +02:00
Nikita Popov
6255308624 Report false for inherited private methods in method_exists()
These shadow methods only exist as internal implementation markers.
This mirrors the behavior of property_exists().
2019-09-03 13:59:25 +02:00
Nikita Popov
52d31bf139 Don't perform coercions in internal func return type assertion
The returned value must match the specified type exactly, as we
can't perform any coercions in non-debug builds.

Fix incorrect stub for easter_date() that slipped through the
assertion for this reason...
2019-09-03 12:16:04 +02:00
Nikita Popov
603b9c43cb Add arg type assertions to DO_ICALL
Now that DO_ICALL is also used for functions with type hints, we
should include the arginfo sanity check assertions in there as
well.
2019-09-02 14:30:51 +02:00
Dmitry Stogov
33e10fe1cb Merge branch 'PHP-7.4'
* PHP-7.4:
  Free two bits in fn_flags by merging ZEND_ACC_HEAP_RT_CACHE/ZEND_ACC_USER_ARG_INFO and ZEND_ACC_DONE_PASS_TWO/ZEND_ACC_ARENA_ALLOCATED that may be used only for user/internal functions
2019-09-02 14:20:01 +03:00
Dmitry Stogov
c739023a50 Free two bits in fn_flags by merging ZEND_ACC_HEAP_RT_CACHE/ZEND_ACC_USER_ARG_INFO and ZEND_ACC_DONE_PASS_TWO/ZEND_ACC_ARENA_ALLOCATED that may be used only for user/internal functions 2019-09-02 14:05:28 +03:00
Dmitry Stogov
633c5886bc Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed information about unused flags
2019-09-02 12:50:40 +03:00