Commit Graph

2501 Commits

Author SHA1 Message Date
Nikita Popov
a2d0899e74 Merge branch 'PHP-7.4' 2019-06-20 10:35:38 +02:00
Nikita Popov
e162a1c02e Fix maybe uninit warning 2019-06-20 10:35:22 +02:00
Remi Collet
477f4fec6d Merge branch 'PHP-7.4'
* PHP-7.4:
  add test for #78185
2019-06-20 10:28:46 +02:00
Remi Collet
fa70aedf03 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  add test for #78185
2019-06-20 10:28:26 +02:00
Remi Collet
a197dc72c3 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  add test for #78185
2019-06-20 10:28:00 +02:00
Remi Collet
63f2d88088 add test for #78185 2019-06-20 10:27:33 +02:00
Nikita Popov
681136212f Merge branch 'PHP-7.4' 2019-06-20 10:16:31 +02:00
Nikita Popov
117c7b3f65 Avoid overflow in mul range calculation
By using ZEND_SIGNED_MULTIPLY_LONG, which already implemented
efficient overflow checking logic.
2019-06-20 09:57:55 +02:00
Nikita Popov
3a97b8b4f9 Backport "Avoid UB in overflow checks"
Cherry-pick of bb940d9969 without
the JIT parts.
2019-06-20 09:51:05 +02:00
Nikita Popov
ccfe6c862a Avoid memset/memcpy null ub in block pass
The arena allocator has no problem with zero-size allocations (and
will just return the same pointer for each in this case), so just
do that to avoid null pointers.
2019-06-20 09:49:07 +02:00
Dmitry Stogov
e177791df1 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #78185 (File cache no longer works)
2019-06-20 09:08:09 +03:00
Dmitry Stogov
05c8f1ff2e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #78185 (File cache no longer works)
2019-06-20 09:07:39 +03:00
Dmitry Stogov
35acda856a Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #78185 (File cache no longer works)
2019-06-20 09:05:50 +03:00
Dmitry Stogov
cd6a6e4cf2 Fixed bug #78185 (File cache no longer works) 2019-06-20 09:04:14 +03:00
Nikita Popov
bb940d9969 Avoid UB in overflow checks
Some of the overflow checks in zend_may_overflow were optimized
away by clang, causing JIT failures on release macos.
2019-06-19 12:02:42 +02:00
Dmitry Stogov
c8d27777d6 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #78175 (Preloading segfaults at preload time and at runtime)
2019-06-18 17:19:19 +03:00
Dmitry Stogov
148eb20226 Fixed bug #78175 (Preloading segfaults at preload time and at runtime) 2019-06-18 17:18:49 +03:00
Dmitry Stogov
22b2d9d088 Fixed JIT failure, on ZTS build without global register vatriables 2019-06-18 13:52:52 +03:00
Joe Watkins
41067a22e9
Merge branch 'PHP-7.4'
* PHP-7.4:
  Turn system_id into a true global
2019-06-18 10:27:50 +02:00
Christoph M. Becker
04a6aac59b
Turn system_id into a true global
The system_id is identical for all threads and can be computed during
module startup, so there is no need to calculate and store it for each
thread.
2019-06-18 10:27:35 +02:00
Dmitry Stogov
7a236b6761 Attempt to fix JIT on Mac OSX ZTS build 2019-06-17 17:08:58 +03:00
Tyson Andre
38c0f6056b zend_func_info: Remove null from methods with non-null return type
Detected by parsing the strings in zend_func_info.c, looping over them
and checking for inconsistencies with Reflection.

(new ReflectionFunction('str_shuffle')->getReturnType()) would be
a non-null 'string', for example.
- e.g. that change was made in 7393777da9
  for php 8.0

Closes GH-4269.
2019-06-17 12:36:30 +02:00
Nikita Popov
4d90848d68 Don't verify arginfo types for internal functions
To avoid duplicate type checks. In debug builds arginfo is still
checked and will generate an assertions if the function doesn't
subsequently throw an exception.

Some test results change due to differences in zpp and arginfo
error messages.
2019-06-17 11:46:28 +02:00
Tyson Andre
74589cf676 Make opcache zend_func_info consistent with Reflection for ctype
This follows up with php 8.0 adding a real return type
(non-null bool) in 1409a3b153
2019-06-16 11:28:18 +02:00
Dmitry Stogov
96a6f7f7f5 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Backport 96a12578c1
2019-06-14 13:29:30 +03:00
Dmitry Stogov
28808ca96d Backport 96a12578c1 2019-06-14 13:29:13 +03:00
Dmitry Stogov
a5b39abd86 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Backport 91a6cdbff5
2019-06-14 13:25:06 +03:00
Dmitry Stogov
40f463b560 Backport 91a6cdbff5 2019-06-14 13:24:47 +03:00
Dmitry Stogov
29902e0e46 Merge branch 'PHP-7.4'
* PHP-7.4:
  More edge case fixes that may cause bug #78106
2019-06-14 13:10:39 +03:00
Dmitry Stogov
96a12578c1 More edge case fixes that may cause bug #78106 2019-06-14 13:10:02 +03:00
Dmitry Stogov
ca486893ba Merge branch 'PHP-7.4'
* PHP-7.4:
  Attempt to fix edge conditions that may cause bug #78106
2019-06-14 12:48:00 +03:00
Dmitry Stogov
91a6cdbff5 Attempt to fix edge conditions that may cause bug #78106 2019-06-14 12:47:22 +03:00
Dmitry Stogov
5883dbcb18 Fixed incorect register allocation in ZTS build 2019-06-14 00:29:22 +03:00
Nikita Popov
026023bd71 Merge branch 'PHP-7.4' 2019-06-13 12:54:17 +02:00
Nikita Popov
e5be58f57c Merge branch 'PHP-7.3' into PHP-7.4 2019-06-13 12:54:10 +02:00
Nikita Popov
bada2049ca Merge branch 'PHP-7.2' into PHP-7.3 2019-06-13 12:52:32 +02:00
Nikita Popov
f1a8138055 Fixed bug #78106
When disabling opcache during the request via opcache.enable ini
setting, make sure we also disable ZCG(accelerator_enabled).
2019-06-13 12:51:35 +02:00
Nikita Popov
b2b9c4785f Merge branch 'PHP-7.4' 2019-06-13 12:41:14 +02:00
Nikita Popov
da275e6214 Merge branch 'PHP-7.3' into PHP-7.4 2019-06-13 12:41:01 +02:00
Nikita Popov
ee137a7033 Merge branch 'PHP-7.2' into PHP-7.3 2019-06-13 12:38:57 +02:00
Nikita Popov
f8a68fd935 Add test for bug #78106
Also add PHP_TEST_EXTRA_ARGS environment variable, which allows
to pass on -c, -d etc flags provided by run-tests.php. Otherwise
we won't get the built-in server to run with opcache.
2019-06-13 12:35:29 +02:00
Nikita Popov
3b27689d46 Fix helper call on 32-bit
This is using the fast-call calling convention. Use FCARG1a and
same code for 32-bit and 64-bit.
2019-06-13 12:11:23 +02:00
Nikita Popov
792e38d863 Fix bug #78154 with JIT 2019-06-13 11:53:31 +02:00
Nikita Popov
51d82da6b0 Suppress -Wtautological-compare in dasc file 2019-06-13 09:59:42 +02:00
Nikita Popov
39034dbc67 Determine thread ID on macos
Also initialize the variable to 0 -- I don't think we really care
if this is not determine on some platform, but it should at least
not be uninitialized.
2019-06-13 09:59:42 +02:00
Nikita Popov
ff8002fc7c Mark label as potentially unused 2019-06-12 16:47:48 +02:00
Nikita Popov
180b29a493 Merge branch 'PHP-7.4' 2019-06-11 15:41:13 +02:00
Nikita Popov
83e0bfb50c Merge branch 'PHP-7.3' into PHP-7.4 2019-06-11 15:41:05 +02:00
Tyson Andre
5d3e3a62a2 Be more precise about possible types for mysqli methods
mysqli has an uncommon approach to 64-bit compatibility:
it will convert numbers that can't be represented on 32-bit
platforms to a string.
This is documented at
https://www.php.net/manual/en/mysqli-stmt.affected-rows.php#refsect1-mysqli-stmt.affected-rows-returnvalues

So if there's a query to a remote mysqli server that affects
more than 2.2 billion rows, then the opcache inference might be
incorrect.

(It's possible to add a MAY_BE_STRING_ON_32_BIT_PLATFORM bitflag macro to
account for this, but I don't think there's a need or want to?)

Patches 3162285b86

This is based on the list of php 7.4 functions using
MYSQLI_RETURN_LONG_INT in mysqli_api.c
2019-06-11 15:40:33 +02:00
Tyson Andre
07c63c6fdf Fix opcache signatures for mysqli_stat
See mysqli_api.c and https://www.php.net/manual/en/mysqli.stat.php
2019-06-11 15:39:59 +02:00
Tyson Andre
7350e808c5 Fix bug in opcache flags for mysqli_get_charset
https://www.php.net/manual/en/mysqli.get-charset.php
tests/mysqli_field_seek.phpt has a test of this returning an object.

Looking at the source in ext/mysqli/mysqli_nonapi.c,
this should be object|null, not array|null

This might actually cause bugs in opcache's inferences,
(no proof of this)
so it might make sense to pull this patch into an earlier minor version.
2019-06-11 15:39:59 +02:00
Nikita Popov
e4fae9c061 Merge branch 'PHP-7.4' 2019-06-11 13:16:38 +02:00
Nikita Popov
89b2d88659 Register class before fetching parent
We want the class declaration to be available while compiling the
parent class.
2019-06-11 13:09:33 +02:00
Nikita Popov
7d98dd9c1c Merge branch 'PHP-7.4' 2019-06-11 10:29:20 +02:00
Nikita Popov
eecd8961d9 Add get_mangled_object_vars() function 2019-06-11 10:28:29 +02:00
Tyson Andre
cdc82f19d8
Fix php 8.0's opcache flags for pathinfo()
See https://php.net/pathinfo

This fixes a bug introduced in the cleanup for commit
0d79c70cf3

`pathinfo($str, PATHINFO_EXTENSION)` will always return a string
(if there is no extension, the function returns the empty string)
2019-06-11 09:09:50 +02:00
Joe Watkins
678e3eb0b7
Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix typo in opcache function flag info (mage->image)
2019-06-11 09:08:31 +02:00
Tyson Andre
5c8b702e77
Fix typo in opcache function flag info (mage->image)
ext/gd/gd.c seems to return null for wrong parameter count, false for
error, and long otherwise. See https://php.net/imagecolorallocate

In php 8.0, the MAY_BE_NULL can probably be removed.
2019-06-11 09:08:23 +02:00
Tyson Andre
cbaf37ff75
Delete opcache flags for php 8.0's removed mbereg*() aliases
See UPGRADING for Mbstring.
All of these are aliases of corresponding `mb_*`
functions that existed in php 7 but were removed in php 8.

Other functions such as gzgetss were already removed.
2019-06-11 09:07:42 +02:00
Joe Watkins
6c195fb846
Merge branch 'PHP-7.4'
* PHP-7.4:
  Clean up opcache func flags for set_socket_blocking
2019-06-11 09:06:48 +02:00
Tyson Andre
b921564a35
Clean up opcache func flags for set_socket_blocking
It was removed in php 7.0. See https://php.net/set_socket_blocking
2019-06-11 09:05:57 +02:00
Joe Watkins
0542eb5bd5
Rest of c3e78efecf 2019-06-11 09:05:07 +02:00
Tyson Andre
98b487e244
Fix a typo in opcache func info for "get_parrent_class"
This should only have one r.
http://php.net/get_parent_class mentions that it returns string|false

Also, I'm not 100% sure if this is right - should this include
MAY_BE_NULL to handle the case of too many parameters?
(then again, get_called_class() also returns null in the global scope)

```
php > var_export(get_parent_class(2,3));
Warning: get_parent_class() expects at most 1 parameter, 2 given in php
shell code on line 1
NULL
```
2019-06-11 08:59:12 +02:00
Dmitry Stogov
09a24d0b7c Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed possible misalignment in 32-bit build.
2019-06-10 12:53:34 +03:00
Dmitry Stogov
46df9a858c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed possible misalignment in 32-bit build.
2019-06-10 12:53:04 +03:00
Dmitry Stogov
a0749fe483 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed possible misalignment in 32-bit build.
2019-06-10 12:52:50 +03:00
Dmitry Stogov
199eb2b110 Fixed possible misalignment in 32-bit build. 2019-06-10 12:51:59 +03:00
Nikita Popov
8b2741c1c3 Fix accidentially dropped type
I only meant to drop the MAY_BE_FALSE here, not the MAY_BE_ARRAY...
2019-06-06 10:07:59 +02:00
Nikita Popov
252216b2de Remove possible false return value from get_object_vars()
I'm not sure this one ever happens in practice (and we might want
to forbid NULL return from get_properties), but if it does, return
an empty array instead of false.
2019-06-06 09:49:25 +02:00
Nikita Popov
001d434449 Finish func_info updates for ext/standard 2019-06-03 11:26:25 +02:00
Nikita Popov
fd911a7124 Expect string argument in hexdec, octdec, bindec
Instead of accepting zval and converting to string. Also rewrite the
functions to make it obvious that they cannot return false.
2019-06-03 11:26:25 +02:00
Nikita Popov
321fe88935 Add Z_PARAM_NUMBER and use it for some functions 2019-06-03 10:14:05 +02:00
Nikita Popov
673c70a4ba A few more func info updates 2019-05-31 11:24:47 +02:00
Dmitry Stogov
b4a3b49eab Merge branch 'PHP-7.4'
* PHP-7.4:
  Better hot/cold code splitting
2019-05-31 12:22:08 +03:00
Dmitry Stogov
1df9f238fe Better hot/cold code splitting 2019-05-31 12:20:21 +03:00
Nikita Popov
0ba34824f5 Use TypeError instead of warning in implode()
These are again manual argument type checks.
2019-05-31 11:04:13 +02:00
Nikita Popov
45a0656e95 Remove get() object handler
Now that set() is gone, there is little point in keeping get(), as
it is essentially just a different way of writing cast_object()
now.

Closes GH-4202.
2019-05-29 17:15:19 +02:00
Nikita Popov
07fae1fd6e escapeshellarg/escapeshellcmd: Throw TypeError instead of E_ERROR 2019-05-29 16:57:53 +02:00
Nikita Popov
0d239523a7 Merge branch 'PHP-7.4' 2019-05-29 16:48:37 +02:00
Nikita Popov
029b735a6e Merge branch 'PHP-7.3' into PHP-7.4 2019-05-29 16:48:28 +02:00
Nikita Popov
61a38bb274 SCCP: Fix leak when determining TYPE_CHECK from type info
As TYPE_CHECK is the only opcode where we do something like this,
I'm adding this hack.
2019-05-29 16:47:19 +02:00
Nikita Popov
a1a8d14485 Update more func info information for ext/standard 2019-05-29 15:30:06 +02:00
Nikita Popov
b7a6430a52 Don't JIT functions with many blocks
Avoids a stack overflow in Zend/tests/runtime_compile_time_binary_operands.php
that happens in recursive RPO calculation. We could make that code
non-recursive, but I don't think it makes sense to JIT this kind of
function in the first place.
2019-05-29 11:49:44 +02:00
Nikita Popov
4d1d5babde Respect optimization_level when running JIT inference
Don't enable unsafe type inference by default -- we'll segfault on
some FFI tests.
2019-05-28 17:29:28 +02:00
Nikita Popov
e1c903230e Merge branch 'PHP-7.4' 2019-05-28 16:41:30 +02:00
Nikita Popov
071b389bc6 Merge branch 'PHP-7.3' into PHP-7.4 2019-05-28 16:41:17 +02:00
Nikita Popov
817b50826e Merge branch 'PHP-7.2' into PHP-7.3 2019-05-28 16:41:08 +02:00
Nikita Popov
59dfaa3f99 Fix type inference of SEND_UNPACK with empty array
An empty array will not be turned into an array of references.
This violated the invariant than an array has values iff it has
keys.
2019-05-28 16:40:56 +02:00
Nikita Popov
0d744f78e6 Merge branch 'PHP-7.4' 2019-05-28 16:15:54 +02:00
Nikita Popov
f19dd674e0 SCCP: Fix handling of ASSIGN_OBJ_REF
The generic BOT handling is not away of OP_DATA, so need to handle
this opcode before we get to that.
2019-05-28 16:15:37 +02:00
Nikita Popov
8b3a71f904 Merge branch 'PHP-7.4' 2019-05-28 15:46:15 +02:00
Nikita Popov
6893f1f98e SCCP: Don't perform partial object propagation for typed props 2019-05-28 15:46:03 +02:00
Nikita Popov
0bd1fc225d JIT: Fix SWITCH_LONG/STRING codegen with exact type
We were not loading the operand if the type was known exactly.
2019-05-28 15:25:19 +02:00
Nikita Popov
7791784bc9 Revert accidental changes
These MAY_BE_FALSE should not have been dropped...
2019-05-28 13:14:58 +02:00
Nikita Popov
4da316d189 hebrev/hebrevc: Don't return false for empty string
There is nothing special about the empty string in this context,
we should pass it through unchanged.
2019-05-28 13:12:38 +02:00
Nikita Popov
0d79c70cf3 Update MAY_BE_NULL info for more ext/standard functions 2019-05-28 13:12:38 +02:00
Nikita Popov
d95c15e371 Update MAY_BE_NULL for parts of ext/standard
Also update proto comments to be more accurate.
2019-05-28 12:11:32 +02:00
Nikita Popov
1493c73582 Update MAY_BE_NULL func_info for Zend functions
These cannot return NULL anymore in PHP 8.
2019-05-28 11:43:23 +02:00
Dmitry Stogov
38c75f8fd3 Fixed register allocation 2019-05-28 12:39:13 +03:00
Nikita Popov
8126658444 Remove FUNC_MAY_WARN
We are no longer constructing the local symbol table when calling
error handlers since 2f1f34952e,
which was the original motivation for having this information and
was used in an earlier version of the JIT.
2019-05-28 11:23:02 +02:00
Nikita Popov
bd4c9bce68 zend_func_info: Remove unnecessary type callbacks
In PHP 8 these functions will throw on invalid arguments, so there
is no need to distinguish the error cases.
2019-05-28 10:42:12 +02:00
Nikita Popov
a1284b4241 Remove special handling of zero-arg funcs in func_info
In PHP 8 we always throw on zpp failure, so we can always return the
type for the valid argument case only. We'll want to also adjust the
return type listings based on that (and drop MAY_BE_NULL/MAY_BE_FALSE
where possible).
2019-05-27 17:16:56 +02:00
Nikita Popov
45c663a9d3 Merge branch 'PHP-7.4' 2019-05-27 17:13:00 +02:00
Nikita Popov
fd23f9104a BIND_STATIC of implicit binding may be undef
Even though we don't need it at runtime, add the BIND_IMPLICIT
flag to BIND_STATIC as well, so we can distinguish this case in
type inference.

This fixes a JIT miscompile in arrow_functions/002.phpt.
2019-05-27 17:12:20 +02:00
Nikita Popov
31ce1cbbb9 Func info: Fix calls to zero-arg varargs
The num_args does not include variadics, so a "zero-arg" function
may accept additional arguments through that. No functions seem
to be affected right now, but they will be after #4175.
2019-05-27 16:14:51 +02:00
Nikita Popov
9d4c35e250 Merge branch 'PHP-7.4' 2019-05-27 16:14:25 +02:00
Nikita Popov
7cc17c4aac Merge branch 'PHP-7.3' into PHP-7.4 2019-05-27 16:14:16 +02:00
Nikita Popov
62f339c8d5 Func info: Fix calls to zero-arg varargs
The num_args does not include variadics, so a "zero-arg" function
may accept additional arguments through that. No functions seem
to be affected right now, but they will be after #4175.
2019-05-27 16:12:42 +02:00
Dmitry Stogov
b22cd2284d Merge branch 'PHP-7.4'
* PHP-7.4:
  Align .text segment for better huge pages usage
2019-05-27 13:38:07 +03:00
Dmitry Stogov
62ded6efbc Align .text segment for better huge pages usage 2019-05-27 13:37:19 +03:00
Jakub Zelenka
6166e2578e Merge branch 'PHP-7.4' 2019-05-26 18:51:39 +01:00
Jakub Zelenka
cd6b7ebb68 Merge branch 'PHP-7.3' into PHP-7.4 2019-05-26 18:51:10 +01:00
Jakub Zelenka
209b12e064 Merge branch 'PHP-7.2' into PHP-7.3 2019-05-26 18:49:52 +01:00
Jakub Zelenka
8baf3ffde6 Add fpmi to the opcache supported sapis 2019-05-26 18:47:22 +01:00
Nikita Popov
e06ec226bc Merge branch 'PHP-7.4' 2019-05-24 09:33:58 +02:00
Nikita Popov
49a3b03e9f Implement basic variance support
This is a minimal variance implementation: It does not support any
cyclic type dependencies. Additionally the preloading requirements
are much more restrictive than necessary. Hopefully we can relax
these in the future.
2019-05-24 09:30:37 +02:00
Dmitry Stogov
b63cb67421 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed double mutex unlock
2019-05-23 11:21:15 +03:00
Dmitry Stogov
fdb7fc6153 Fixed double mutex unlock 2019-05-23 11:20:46 +03:00
Nikita Popov
200f5b407e Merge branch 'PHP-7.4' 2019-05-23 10:01:46 +02:00
Nikita Popov
dcccdc471d Don't require NO_ESCAPE for partial arrays in SCCP 2019-05-23 09:59:25 +02:00
Dmitry Stogov
89a7e94f05 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed race condition in opcache restart
2019-05-23 00:21:26 +03:00
Dmitry Stogov
5de750f41c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed race condition in opcache restart
2019-05-23 00:21:15 +03:00
Dmitry Stogov
d4867e099e Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed race condition in opcache restart
2019-05-23 00:21:04 +03:00
Dmitry Stogov
fa6a4483e6 Fixed race condition in opcache restart 2019-05-23 00:20:35 +03:00
Dmitry Stogov
26c348b3a5 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed dump of constant flags
2019-05-22 23:02:18 +03:00
Dmitry Stogov
fe1db0c3d7 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed dump of constant flags
2019-05-22 23:00:26 +03:00
Dmitry Stogov
aa9c76d027 Fixed dump of constant flags 2019-05-22 22:59:40 +03:00
Dmitry Stogov
3a76ef3d5d Merge branch 'PHP-7.4'
* PHP-7.4:
  .text segment may be not the first one
2019-05-22 12:21:07 +03:00
Dmitry Stogov
7c99589be2 .text segment may be not the first one 2019-05-22 12:20:34 +03:00
Nikita Popov
c06f07f55b Merge branch 'PHP-7.4' 2019-05-22 09:35:49 +02:00
Nikita Popov
ff4b0ce0e8 Fix bug #78034
Don't def non-cv variables in assign_obj_ref data operand.
2019-05-22 09:35:38 +02:00
Nikita Popov
69517d037b Merge branch 'PHP-7.4' 2019-05-21 17:35:33 +02:00
Nikita Popov
f260c0918f Merge branch 'PHP-7.3' into PHP-7.4 2019-05-21 17:35:28 +02:00
Nikita Popov
97ba6b0d8b Don't evaluate functions with partial array arguments 2019-05-21 17:35:03 +02:00
Nikita Popov
dda0ae3e59 Merge branch 'PHP-7.4' 2019-05-21 17:18:01 +02:00
Nikita Popov
436a47428b Merge branch 'PHP-7.3' into PHP-7.4 2019-05-21 17:17:45 +02:00
Nikita Popov
30f1b17262 Fix null check in sccp add_array_elem chain handling
We need to check result_use rather than result_def for a null zval.
Previously we were later assuming that the null zval is really a
partial array, which does not go well.
2019-05-21 17:15:07 +02:00
Nikita Popov
4c5f83f644 Merge branch 'PHP-7.4' 2019-05-21 17:04:17 +02:00
Nikita Popov
a87448bb55 Merge branch 'PHP-7.3' into PHP-7.4 2019-05-21 17:03:52 +02:00
Nikita Popov
fc4836b193 Fix partial array handling in FE_RESET edge feasibility 2019-05-21 16:59:27 +02:00
Nikita Popov
cd188d0398 Handle partial arrays in zend_is_true() checks 2019-05-21 16:53:34 +02:00
Nikita Popov
bdce5849b7 Extract ct_eval_binary_op()
And use it in more places, though some of them are currently not
reachable by partial arrays to the best of my knowledge.
2019-05-21 16:43:41 +02:00
Nikita Popov
367788cbc3 Improve SCCP debug code
In particular properly dump partial arrays when tracing execution.
2019-05-21 16:42:13 +02:00
Christoph M. Becker
68e6c1542e Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix ASLR related invalid opline handler issues
2019-05-21 14:34:55 +02:00
Christoph M. Becker
8ba10b8fbc Fix ASLR related invalid opline handler issues
Opcache stores `opline->handler`s in shared memory.  These pointers are
invalid, if the main PHP DLL is loaded at another base address due to
ASLR.  We therefore store the address of `execute_ex` in the mmap base
file, and check on startup whether it matches its current address.  If
not, we fall back on the file cache if enabled, and bail out otherwise.

This still does not address cases where the opline handler is located
inside of another DLL (e.g. for some profilers, debuggers), but there
seems to be no general solution for now.
2019-05-21 14:33:33 +02:00
Christoph M. Becker
5e0bcd24f4 Merge branch 'PHP-7.4'
* PHP-7.4:
  Prevent test case failure
2019-05-21 11:19:35 +02:00
Christoph M. Becker
ee9908683b Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Prevent test case failure
2019-05-21 11:19:05 +02:00
Christoph M. Becker
d23bc33dc1 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Prevent test case failure
2019-05-21 11:18:32 +02:00
Christoph M. Becker
e6a191de1b Prevent test case failure
If opcache.log_verbosity_level is greater than 1, opcache will raise
warnings, which will be written to stderr in the default case.  These
warnings are actually to be expected, but would break the test, so we
make sure that the log_verbosity_level is 1 when running this test.
2019-05-21 11:17:51 +02:00
Christoph M. Becker
77f02cda53 Merge branch 'PHP-7.4'
* PHP-7.4:
  use {TMP} placeholder in phpt tests
2019-05-21 09:03:51 +02:00