1
0
mirror of https://github.com/php/php-src.git synced 2026-04-02 21:52:36 +02:00
Commit Graph

442 Commits

Author SHA1 Message Date
Tyson Andre
54febdbc7d Fix other typos in param name/code comments
Closes GH-5502
2020-05-01 12:23:16 +02:00
Alex Dowad
8ddaf13ed3 Code tweaks: Remove unneeded semicolons 2020-04-29 23:17:40 +02:00
Christoph M. Becker
bd7a52c9b2 Merge branch 'PHP-7.4'
* PHP-7.4:
  Move test to its folder
2020-04-16 11:57:54 +02:00
Gabriel Caruso
e88e9afe95 Move test to its folder 2020-04-16 11:56:21 +02:00
George Peter Banyard
af63050071 Remove XFAIL section of a passing COM test
Closes GH-5297
2020-04-14 17:31:06 +02:00
Máté Kocsis
3fe49d81f8 Generate method entries from stubs for a couple of extensions
Closes GH-5368
2020-04-11 13:28:53 +02:00
Christoph M. Becker
175e5ed4bf Fix typo (UNKOWN -> UNKNOWN) 2020-04-09 14:06:11 +02:00
Máté Kocsis
3709e74b5e Store default parameter values of internal functions in arg info
Closes GH-5353. From now on, PHP will have reflection information
about default values of parameters of internal functions.

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2020-04-08 18:37:51 +02:00
Christoph M. Becker
9cb32640af Clean up constructor handling in com_dotnet
We substitute the construction magic with standard constructors, move
the ZPP checks to the beginning of the ctors, and also let the function
entries be generated from the stubs.
2020-04-06 10:53:45 +02:00
Nikita Popov
2bcc4ab8f4 Verify that all stubs have a return type 2020-04-03 17:59:30 +02:00
Christoph M. Becker
b0b593504d Merge branch 'PHP-7.4'
* PHP-7.4:
  Add missing 'skip' to bug79332.phpt skip message
2020-03-26 23:17:37 +01:00
Christoph M. Becker
cc0c5b9343 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Add missing 'skip' to bug79332.phpt skip message
2020-03-26 23:15:55 +01:00
Lukas Berger
7f9b534e3a Add missing 'skip' to bug79332.phpt skip message
The skip message must start with the word 'skip', otherwise the test will not be skipped.

*Before:*
Running selected tests.
TEST 1/1 [ext/com_dotnet/tests/bug79332.phpt]
========DIFF========
001+ Fatal error: Uncaught Error: Class 'COMPersistHelper' not found in /srv/php/ext/com_dotnet/tests/bug79332.php:2
001- A com_exception has been thrown
002+ Stack trace:
003+ #0 {main}
004+   thrown in /srv/php/ext/com_dotnet/tests/bug79332.php on line 2
========DONE========
FAIL Bug #79332 (php_istreams are never freed) [ext/com_dotnet/tests/bug79332.phpt]

*After:*
Running selected tests.
SKIP Bug #79332 (php_istreams are never freed) [ext/com_dotnet/tests/bug79332.phpt] reason: com_dotnet extension not available
2020-03-26 23:14:10 +01:00
Christoph M. Becker
c987e538ac Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79333: com_print_typeinfo() leaks memory
2020-03-02 11:38:50 +01:00
Christoph M. Becker
318757551a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79333: com_print_typeinfo() leaks memory
2020-03-02 11:38:03 +01:00
Christoph M. Becker
53140e5c56 Fix #79333: com_print_typeinfo() leaks memory
We have to free the `ansiname`s, regardless of whether they have been
put into the hashtable or not.

Since bug79299.phpt already shows the leak when run with a leak
checker, there is no need for another regression test.
2020-03-02 11:36:30 +01:00
Christoph M. Becker
b05c7fae33 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79332: php_istreams are never freed
2020-03-02 10:48:14 +01:00
Christoph M. Becker
b9843c9418 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79332: php_istreams are never freed
2020-03-02 10:46:46 +01:00
Christoph M. Becker
2adf1c4d23 Fix #79332: php_istreams are never freed
Releasing the `com_dotnet_istream_wrapper` in `istream_destructor()` is
pointless, since `istream_destructor()` is only called when the
resource is going to be released.  This recursion is not a real issue,
though, since the resource is never exposed to userland, and has at
most refcount 1, so due to well defined unsigned integer underflow, it
never is released twice.  However, returning early in this case causes
a memory leak which needs to be fixed.
2020-03-02 10:45:37 +01:00
Nikita Popov
8d30d5f269 Add stubs for COMPersistHelper 2020-02-26 10:00:08 +01:00
Christoph M. Becker
6c7306f45d Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79299: com_print_typeinfo prints duplicate variables
2020-02-23 23:35:33 +01:00
Christoph M. Becker
09e7c86779 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79299: com_print_typeinfo prints duplicate variables
2020-02-23 23:34:15 +01:00
Christoph M. Becker
9e6358af36 Fix #79299: com_print_typeinfo prints duplicate variables
`lastid` has to retain its value during the traversal, so we move it to
an outer scope.

Patch contributed by Litiano Moura.
2020-02-23 23:31:36 +01:00
Máté Kocsis
4f89211810 Remove the deprecated reflection export methods
Closes GH-5188
2020-02-19 13:19:37 +01:00
Christoph M. Becker
42e7de1518 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79248: Traversing empty VT_ARRAY throws com_exception
2020-02-08 17:07:49 +01:00
Christoph M. Becker
01eab11cee Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79248: Traversing empty VT_ARRAY throws com_exception
2020-02-08 17:07:02 +01:00
Christoph M. Becker
f649adedfe Fix #79248: Traversing empty VT_ARRAY throws com_exception
If the `VT_ARRAY` is empty, i.e. its upperbound is less than its lower
bound, we must not call `php_com_safearray_get_elem()`, because that
function throws in this case.
2020-02-08 17:05:29 +01:00
Christoph M. Becker
377ac2a903 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79247: Garbage collecting variant objects segfaults
2020-02-08 11:06:45 +01:00
Christoph M. Becker
b4f61d99cf Fix #79247: Garbage collecting variant objects segfaults
variant objects have no (declared) properties, so the `get_properties`
handlers returns a pointer to constant storage for efficiency reasons.
This pointer must not be returned from the `get_gc` handler, though;
instead we set up an own `get_gc` handler and return NULL from it, to
signal that there are no properties to collect.
2020-02-08 11:03:52 +01:00
Christoph M. Becker
78b71e1e8f Merge branch 'PHP-7.4'
* PHP-7.4:
  Skip test case on x86 where it otherwise fails [ci skip]
2020-02-07 21:11:32 +01:00
Christoph M. Becker
bcfb7b2be9 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Skip test case on x86 where it otherwise fails [ci skip]
2020-02-07 21:10:44 +01:00
Christoph M. Becker
674d44ad7c Skip test case on x86 where it otherwise fails [ci skip]
`-2200000000` can't be converted to integer on x86, so the constructor
call would fail.
2020-02-07 21:09:35 +01:00
Christoph M. Becker
1d9e80a53d Simplify COM_ERR_CONST definition for x64
This is also a wee bit faster.
2020-02-07 18:25:24 +01:00
Christoph M. Becker
4bdc4da1c7 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79242: COM error constants don't match com_exception codes
2020-02-07 18:11:41 +01:00
Christoph M. Becker
7f86f9972e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79242: COM error constants don't match com_exception codes
2020-02-07 18:05:10 +01:00
Christoph M. Becker
b9738f5802 Fix #79242: COM error constants don't match com_exception codes
Because a `HRESULT` is a `LONG`[1], no special treatment is required on
x86 platforms to get appropriate values.  On x64 platforms we prefer
positive values, what we could accomplish by casting the `HRESULT`
value to `ULONG` and then to `zend_long`, but since the current
behavior is correct and the performance improvement is negligible, we
defer that to master.

[1] <https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types#hresult>
2020-02-07 18:04:14 +01:00
Christoph M. Becker
e1a46de938 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #66322: COMPersistHelper::SaveToFile can save to wrong location
2020-02-06 15:02:12 +01:00
Christoph M. Becker
0d49cf4ed2 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #66322: COMPersistHelper::SaveToFile can save to wrong location
2020-02-06 15:01:12 +01:00
Christoph M. Becker
5e2ea00b15 Fix #66322: COMPersistHelper::SaveToFile can save to wrong location
Saving under the given `filename` may also work, but since
`::LoadFromFile` uses the `fullpath` we follow suit.
2020-02-06 14:59:55 +01:00
Nikita Popov
f8d795820e Reindent phpt files 2020-02-03 22:52:20 +01:00
Máté Kocsis
d1764ca330 Make error messages more consistent by fixing capitalization
Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
2020-01-17 14:52:46 +01:00
Christoph M. Becker
5d3be966f9 Use proper printf() specifiers 2020-01-15 18:18:36 +01:00
Máté Kocsis
aadd3aaed9 Use RETURN_THROWS() in various places 2020-01-03 21:10:24 +01:00
Máté Kocsis
76c45f35f5 Use RETURN_THROWS() during ZPP in bz2, calendar, com_dotnet extensions 2019-12-31 00:21:37 +01:00
Máté Kocsis
27e83d0fb8 Add union return types for function stubs 2019-11-11 14:54:55 +01:00
Nikita Popov
ac4e0f0852 Make zend_type a 2-field struct
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.
2019-11-08 15:15:48 +01:00
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
Máté Kocsis
9493893412 Cleanup return values when parameter parsing is unsuccessful 2019-10-30 16:05:20 +01:00
Christoph M. Becker
b00cc3378c Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #78694: Appending to a variant array causes segfault
2019-10-19 11:52:38 +02:00
Christoph M. Becker
ee6a71ca73 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78694: Appending to a variant array causes segfault
2019-10-19 11:51:05 +02:00