Commit Graph

117326 Commits

Author SHA1 Message Date
Nikita Popov
4cdd15d414 Merge branch 'PHP-7.4'
* PHP-7.4:
  Disable parallelism for FPM tests
2020-02-03 09:58:03 +01:00
Nikita Popov
aaf9cbb7eb Disable parallelism for FPM tests
Let's see if this helps with spurious failures on Azure.
2020-02-03 09:57:34 +01:00
Máté Kocsis
2015c7a48e
Fix another batch of indentation in tests 2020-02-02 23:33:40 +01:00
Akim Demaille
4cbffd89d9
Clean up the generation of the parsers
Prefer '%define api.value.type' to '#define YYSTYPE', so that Bison
know the type.

Use '%code requires' to declare what is needed to define the api.value.type
(that code is output in the generated header before the generated
definition of YYSTYPE).

Prefer '%define api.prefix' inside the grammar file to '-p' outside,
as anyway the functions defined in the file actually use this prefix.

Prefer `%param` to both `%parse-param` and `%lex-param`.

Closes GH-5138
2020-02-01 14:21:53 +01:00
Akim Demaille
2127a37b83
Bison: enable all the warnings and fix them
First, fix 5547d36120: the definition of
YFLAGS was not passed into the Makefile: AC_SUBST does not suffice, we
need PHP_SUBST_OLD.  While at it, allow to pass variable and value at
the same time.

Then pass -Wall to bison, rather than only -Wempty-rules.

Use %precedence where associativity is useless.

Remove useless %precedence.
GH-5138
2020-02-01 14:21:21 +01:00
Pieter Hordijk
b97c9dc72a
Added opcache extension to inis
Extensions are not loaded by default (commented out)

Closes GH-5136
2020-02-01 07:15:18 +01:00
Máté Kocsis
19222b8581
Fix var_dump test 2020-01-31 18:36:43 +01:00
Máté Kocsis
8b36be268d
Fix indentation and whitespaces in tests
In preparation for GH-5074
2020-01-31 17:47:14 +01:00
Sebastian Pop
ee87e86d0a inline by hand to avoid uninitialized variable warning
When compiling with "-Wall -Werror" gcc emits two errors:

../src/pcre2_jit_neon_inc.h:211:8: error: ‘cmp1b’ is used uninitialized in this function [-Werror=uninitialized]
  211 | data = fast_forward_char_pair_compare(compare1_type, data, cmp1a, cmp1b);
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/pcre2_jit_neon_inc.h:212:9: error: ‘cmp2b’ is used uninitialized in this function [-Werror=uninitialized]
  212 | data2 = fast_forward_char_pair_compare(compare2_type, data2, cmp2a, cmp2b);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The compiler emits the error message before inlining.
Because the warning is based on an intra-procedural data
flow analysis, the compiler does not see that cmp1b and
cmp2b are not used when they are not initialized.

Here is the code of that function, cmp2 is only used
when ctype is compare_match2 or compare_match1i,
and not when ctype is compare_match1:

static inline vect_t fast_forward_char_pair_compare(compare_type ctype, vect_t dst, vect_t cmp1, vect_t cmp2)
{
if (ctype == compare_match2)
 {
 vect_t tmp = dst;
 dst = VCEQQ(dst, cmp1);
 tmp = VCEQQ(tmp, cmp2);
 dst = VORRQ(dst, tmp);
 return dst;
 }

if (ctype == compare_match1i)
  dst = VORRQ(dst, cmp2);
dst = VCEQQ(dst, cmp1);
return dst;
}

The patch inlines by hand the case of compare_match1 such that the
code avoids referring to cmp1b and cmp2b.

Tested on aarch64-linux with `make check`.
2020-01-31 14:56:51 +01:00
Dmitry Stogov
2b279b428f We don't need "safe" destruction anymore 2020-01-31 16:01:09 +03:00
Dmitry Stogov
6b862e82d9 These EG(current_execute_data) = EX(prev_execute_data) assignments are useless now 2020-01-31 14:50:41 +03:00
Dmitry Stogov
08d2d9257d Export zend_dump_op() and add ZEND_DUMP_NUMERIC_OPLINES flag to print oplines as "dddd" instead of "Ld+" 2020-01-31 13:27:35 +03:00
Nikita Popov
d8a1e3dab0 Fix JIT as well 2020-01-31 10:35:46 +01:00
Nikita Popov
ec0ce49f5c Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix bug #76047
2020-01-31 10:30:09 +01:00
Nikita Popov
d422478f6d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #76047
2020-01-31 10:29:45 +01:00
Nikita Popov
ef1e4891b4 Fix bug #76047
Unlink the current stack frame before freeing CVs or extra args.
This means it will no longer show up in back traces that are
generated during CV destruction.

We already did this prior to destructing the object/closure,
presumably for the same reason.
2020-01-31 10:26:40 +01:00
Akim Demaille
37d0f7d3b3
Use "%empty" in the parsers, instead of comments
The annotation %empty is properly enforced: warnings when it's
missing, and errors when it's inappropriate.  Support for %empty was
introduced in Bison 3.0.

Pass -Wempty-rule to Bison.

Closes GH-5134
2020-01-31 09:52:40 +01:00
Remi Collet
b915d68852 Zip: version is now 1.17.0
change for Windows (which have libzip 1.4 by default)
update NEWS
2020-01-31 09:10:10 +01:00
Remi Collet
3af1cee884 add ZipArchive::registerProgressCallback and ZipArchive::registerCancelCallback methods 2020-01-31 09:06:42 +01:00
Dmitry Stogov
7e7a85e881 Fixed JIT part for bug #79094 2020-01-31 10:39:22 +03:00
Dmitry Stogov
7ebf1d44ed Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #79094 (Crashing when running recursion function)
2020-01-31 10:34:28 +03:00
Dmitry Stogov
db7193f31e Fixed bug #79094 (Crashing when running recursion function) 2020-01-31 10:34:04 +03:00
Benjamin Eberlei
176ec97a16 Add NEWS entry for new ReflectionProperty methods. 2020-01-30 17:48:20 +01:00
Máté Kocsis
5bf6aedae4
Promote mysqli warnings to exceptions
Closes GH-5058
2020-01-30 17:05:07 +01:00
Nikita Popov
453713868f Revert "Make BG(syslog_device) per request"
This reverts commit b0d7b126a2.

This change wasn't quite right: I noticed only now that the
RSHUTDOWN function is #ifdef PHP_WIN32 and I'm not fully convinced
that ifdef can be removed: syslog might also be used by error
logging in FPM for example, in which case we probably shouldn't
be closing the log here.

Generally it's unclear how the openlog() functionality exposed
by PHP is supposed to interact with openlog() uses by SAPIs.

For now I'll just revert this change and let it leak across
requests.
2020-01-30 16:18:02 +01:00
Nikita Popov
981fdd9f51 Merge branch 'PHP-7.4'
* PHP-7.4:
  fix cross compilation failure due to size_t typecast in define
2020-01-30 15:52:22 +01:00
Pascal de Bruijn
f0f5c415a6 fix cross compilation failure due to size_t typecast in define
The following commit introduces a cross-compilation failure:

   93c728b77c
  "Try to control ZEND_MM_ALIGNED_SIZE type"

br-arm-full/build/php-7.4.2/Zend/zend_alloc.h:30:38:
error: missing binary operator before token "8"
                                              ^
br-arm-full/build/php-7.4.2/ext/opcache/ZendAccelerator.c:1380:7:
note: in expansion of macro ‘ZEND_MM_ALIGNMENT’

Closes GH-5128.
2020-01-30 15:51:54 +01:00
Nikita Popov
ca8657a2b5 Initialize SplFixedArray elements to NULL instead of UNDEF
The SplFixedArray API treats all elements as NULL, even if they
have not been explicitly initialized. Rather than initializing
to UNDEF an treating that specially in various circumstances,
directly initialize elements to NULL.

This also fixes an assertion failure in the attached test case.
2020-01-30 15:31:39 +01:00
Nikita Popov
b33697d47e Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #79193
2020-01-30 14:56:31 +01:00
Nikita Popov
f70b552326 Fixed bug #79193 2020-01-30 14:55:58 +01:00
Nikita Popov
38e27625ea Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix live range calculation for FE_FETCH
2020-01-30 14:24:28 +01:00
Nikita Popov
be7eab3202 Fix live range calculation for FE_FETCH
Op2 is def here, not a use, so treat it accordingly.
2020-01-30 14:23:46 +01:00
Nikita Popov
a66e226713 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix DatePeriod property handling with indirect modification
2020-01-30 13:14:29 +01:00
Nikita Popov
01d30f880a Fix DatePeriod property handling with indirect modification
We do need to implement get_property_ptr_ptr to make arrays work
correctly.
2020-01-30 13:09:47 +01:00
Christoph M. Becker
2dc5077159 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #70078: XSL callbacks with nodes as parameter leak memory
2020-01-30 13:07:34 +01:00
Christoph M. Becker
dfbeee034a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #70078: XSL callbacks with nodes as parameter leak memory
2020-01-30 13:06:25 +01:00
Christoph M. Becker
8226e704e4 Fix #70078: XSL callbacks with nodes as parameter leak memory
The fix for bug #49634 solved a double-free by copying the node with
`xmlDocCopyNodeList()`, but the copied node is later freed by calling
`xmlFreeNode()` instead of `xmlFreeNodeList()`, thus leaking memory.
However, there is no need to treat the node as node list, i.e. to copy
also the node's siblings; just creating a recursive copy of the node
with `xmlDocCopyNode()` is sufficient, while that also avoids the leak.
2020-01-30 13:04:57 +01:00
Nikita Popov
0078727866 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix leak in DateTimeImmutable::modify()
2020-01-30 12:17:15 +01:00
Nikita Popov
187f359549 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix leak in DateTimeImmutable::modify()
2020-01-30 12:17:10 +01:00
Nikita Popov
494615fcb8 Fix leak in DateTimeImmutable::modify() 2020-01-30 12:16:56 +01:00
Nikita Popov
24a3d0dbd0 Update test for warning -> fatal error change 2020-01-30 12:12:09 +01:00
Nikita Popov
d5dd46fb09 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix copying of functions in variance obligations
2020-01-30 11:56:36 +01:00
Nikita Popov
68596ed71e Fix copying of functions in variance obligations
Only copy sizeof(zend_internal_function) for internal functions.
2020-01-30 11:55:38 +01:00
Nikita Popov
7c34d73876 Merge branch 'PHP-7.4'
* PHP-7.4:
  Add SKIPIF to test requiring mbregex
2020-01-30 11:21:32 +01:00
Nikita Popov
a73f98eda9 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Add SKIPIF to test requiring mbregex
2020-01-30 11:21:26 +01:00
Nikita Popov
6ccd675776 Add SKIPIF to test requiring mbregex 2020-01-30 11:20:42 +01:00
Nikita Popov
472fc3a2a9 Fix leak in DatePeriod construction with invalid format
Same issue as I fixed in DateInterval construction before.
2020-01-30 11:13:04 +01:00
Nikita Popov
cb7b21009b Merge branch 'PHP-7.4'
* PHP-7.4:
  Reset trampoline on executor startup
  Fix UAF in is_callable() and allocated trampoline
2020-01-30 11:05:56 +01:00
Nikita Popov
98deece6f7 Reset trampoline on executor startup
Make sure the trampoline is usable, even if we had an unclean
shutdown on the last request.
2020-01-30 11:05:04 +01:00
Nikita Popov
429f194f40 Fix UAF in is_callable() and allocated trampoline
By nulling out the function_handler, so it will not get used
below. Reuse the existing helper for this purpose.
2020-01-30 11:04:59 +01:00