1
0
mirror of https://github.com/php/php-src.git synced 2026-04-24 16:38:25 +02:00
Commit Graph

3023 Commits

Author SHA1 Message Date
Nikita Popov 79a36ff7f3 Fixed bug #79477
Make sure to deindirect properties when creating array.
2020-04-15 11:21:05 +02:00
Nikita Popov cf68bc413b Fixed bug #79434 2020-04-02 16:34:03 +02:00
Christoph M. Becker 2462f2dab1 Fix #79364: When copy empty array, next key is unspecified
We must not forget to keep the `nNextFreeElement` when duplicating
empty arrays.
2020-03-11 08:54:05 +01:00
Mark Plomer 8c6a7c3326 Fix #63206: Fully support error/exception_handler stacking, even with null or inside the handler
Always push the current user_error/exception_handler to the stack,
even when it is empty, so restore_error_handler() always works as
expected.

The user_error_handler is especially temporarily empty when we are inside
the error handler, which caused inconsistent behaviour before.
2020-02-25 12:43:42 +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
Dmitry Stogov eb846939b1 Fixed bug #78999 (Cycle leak when using function result as temporary) 2019-12-19 23:11:08 +03:00
Nikita Popov 897d99c7a4 Rethrow generator exception even without active stack frame
Finally blocks in generators may be invoked during shutdown, in
which case we don't have a stack frame. Similar to what
zend_call_function does, we still need to rethrow these exceptions,
otherwise they will be hidden (and leak).
2019-12-18 11:04:15 +01:00
Nikita Popov 189f625e2b Fix freeing of dynamic call name
We need to free op2 if the call construction fails.

Also remove a redundant check for !call.
2019-12-18 10:11:09 +01:00
Nikita Popov 621598eaa8 Fixed bug #78921
By resetting fake_scope during autoloading. We already do the same
when executing destructors.
2019-12-13 16:37:20 +01:00
Nikita Popov 249e49092d Fix constant evaluation of && and ||
The "return" in the for loop should have been a break on the switch,
otherwise the result is just ignored... but because it prevents
evaluation of the other operand, it also violates the invariant that
everything has been constant evaluated, resulting in an assertion
failure.

The for loop isn't correct in any case though, because it's not legal
to determine the result based on just the second operand, as the
first one may have a side-effect that cannot be optimized away.
2019-12-06 11:07:57 +01:00
Nikita Popov fac43d6515 Fix AST printing of nullable builtin types
Fixes oss-fuzz #19109.
2019-12-04 11:20:52 +01:00
Dmitry Stogov bb30fe9e2b Fixed bug #78868 (Calling __autoload() with incorrect EG(fake_scope) value) 2019-11-25 14:05:43 +03: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
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 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 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 6fd6ad8f53 Fixed bug #78658 2019-10-09 17:00:27 +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 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 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 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
Nikita Popov 34edd4aa2a Merge branch 'PHP-7.2' into PHP-7.3 2019-08-29 12:33:04 +02:00
Nikita Popov ed749edd47 Fix use-after-free of immediately invoked closure with extra args 2019-08-29 12:32:03 +02:00
Nikita Popov 461db52400 Merge branch 'PHP-7.2' into PHP-7.3 2019-08-26 17:52:37 +02:00
Nikita Popov 589542f50c Remove properties HT from nested GC data
The properties HT may be a GC root itself, so we need to remove it.
I'm not sure this issue actually applies to PHP 7.2, but committing
it there to be safe. As seen from the test case, the handling here
is rather buggy on 7.2.
2019-08-26 17:49:37 +02:00
Christoph M. Becker 310708845f Fix #78441: Parse error due to heredoc identifier followed by digit
Since digits are allowed for identifiers, we have to cater to them as
well.
2019-08-21 22:51:51 +02:00
Nikita Popov be7e819068 Fixed bug #77922
In PHP 7.3 shadow properties are no longer duplicated. Make sure we
only release them if the property was defined on the parent class,
which means that it changed from private->shadow, which is where
duplication does happen.
2019-08-17 10:58:54 +02:00
Dmitry Stogov 722a44d515 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed handling of references in nested data of objects with destructor
2019-08-09 17:47:06 +03:00
Dmitry Stogov 9b43e29d9b Fixed handling of references in nested data of objects with destructor 2019-08-09 17:43:50 +03:00
Dmitry Stogov 22d23e08c9 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed second part of the bug #78379 (Cast to object confuses GC, causes crash)
2019-08-09 15:58:16 +03:00
Dmitry Stogov 6b1cc1252e Fixed second part of the bug #78379 (Cast to object confuses GC, causes crash) 2019-08-09 15:42:39 +03:00
Dmitry Stogov bff2743caf Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #78379 (Cast to object confuses GC, causes crash)
2019-08-08 10:05:59 +03:00
Dmitry Stogov 358379be22 Fixed bug #78379 (Cast to object confuses GC, causes crash) 2019-08-08 10:00:39 +03:00
Nikita Popov d89157cd67 Add test for bug #78363 2019-08-02 10:37:44 +02:00
George Peter Banyard e7e66d5275 Convert short tag to standard tag in Zend test file
Closes GH-4389.

(cherry picked from commit e6c2b28865)
2019-07-16 15:27:50 +02:00
Nikita Popov 193f28c7d5 Fixed bug #78010
Prevent the gc_info from becoming all zero for a registered root
by setting the top bit to one for compressed root addresses.
2019-07-15 12:00:30 +02:00
Nikita Popov e7a83ec8df Fix bug #78271
When cleaning nops in the dfa pass, we were always keeping the
smart branch inhibiting nop that occurs directly before the jump
instruction. However, as we skip unreachable blocks entirely, it
may happen that we need to keep a nop that occurs further back,
prior to the unreachable blocks. Account for that case now.

We should really do something about the smart branch situation,
this is very fragile...
2019-07-10 17:25:40 +02:00
Nikita Popov 825f47564a Merge branch 'PHP-7.2' into PHP-7.3 2019-07-09 11:05:18 +02:00
Nikita Popov 22ed362810 Revert "Fixed bug #76980"
This reverts commit 35353dc49a.

This changes causes issues for Symfony, see
https://github.com/symfony/symfony/issues/32395. I'm reverting it
from PHP 7.2 and PHP 7.3 and only leaving it in PHP 7.4.
2019-07-09 11:04:16 +02:00
Nikita Popov 19d0a51533 Merge branch 'PHP-7.2' into PHP-7.3 2019-06-28 16:09:09 +02:00
sunnyeo f7327b6244 Fix bugs in AST printer
Closes GH-4324.
2019-06-28 16:08:44 +02:00
Nikita Popov 5846119e50 Merge branch 'PHP-7.2' into PHP-7.3 2019-05-15 12:48:35 +02:00
Nikita Popov 35353dc49a Fixed bug #76980
If we perform a class fetch that is not marked as exception safe,
convert exceptions thrown by autoloaders into a fatal error.

Ideally fetching the interfaces would be exception safe, but as it
isn't right now, we must abort at this point.
2019-05-15 12:46:23 +02:00
Christoph M. Becker 1a98878bfe Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix test case
2019-05-14 10:25:02 +02:00