Commit Graph

2304 Commits

Author SHA1 Message Date
Peter Kokot
9911ab7142
Remove unused ZEND_STACK_GROWS_DOWNWARDS constant (#11762) 2023-07-22 19:39:42 +02:00
Arnaud Le Blanc
d0731934b7
Expose time spent collecting cycles in gc_status() (#11523) 2023-07-16 12:34:28 +02:00
Niels Dossche
0b2e6bc2b0 Cache d_type in directory entry 2023-07-07 18:02:32 +02:00
Max Kellermann
413844d626
Zend/zend_types.h: deprecate zend_bool, zend_intptr_t, zend_uintptr_t (#10597)
These types are standard C99.

For compatibility with out-of-tree extensions, keep the typedefs
in main/php.h.
2023-02-18 19:31:28 +00:00
Jakub Zelenka
d5ce616bb3
Merge branch 'PHP-8.2' 2023-02-17 16:40:14 +00:00
Jakub Zelenka
a7d57e242e
Merge branch 'PHP-8.1' into PHP-8.2 2023-02-17 16:38:53 +00:00
Daniel Black
2b3fa5edac
zend win32 RE2C header files to Make targets and generated_files
like zend_ini_parser.h, list zend_ini_scanner_defs.h and
zend_language_scanner_defs.h.

Add all these files to generated_files so they don't get missed.
2023-02-17 16:37:14 +00:00
Arnaud Le Blanc
a11c8a3039
Limit stack size (#9104) 2022-12-16 17:44:26 +01:00
Jorg Adam Sowa
77ee92a50c
Remove unnecessary usage of CONST_CS
Closes GH-9685.
2022-11-28 17:12:07 +01:00
Christoph M. Becker
dbf211de40
Merge branch 'PHP-8.2'
* PHP-8.2:
  Avoid undefined behavior in Windows ftok(3) emulation
2022-11-18 14:38:03 +01:00
Christoph M. Becker
5e307d0cab
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Avoid undefined behavior in Windows ftok(3) emulation
2022-11-18 14:37:45 +01:00
Christoph M. Becker
2d94ee5f20
Avoid undefined behavior in Windows ftok(3) emulation
`.nFileIndexHigh` is a unsigned 32bit number.  Casting that to `__int64`
and shifting left by 32bits triggers undefined behavior if the most
significant bit of `.nFileIndexHigh` is set.  We could avoid that by
casting to `(__uint64)`, but in that case the whole clause doesn't have
an effect anymore, so we drop it altogether.

Closes GH-9958.
2022-11-18 14:37:00 +01:00
Christoph M. Becker
5a5037f223
Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-9890: OpenSSL legacy providers not available on Windows
2022-11-14 12:43:29 +01:00
Christoph M. Becker
9aa86e619d
Fix GH-9890: OpenSSL legacy providers not available on Windows
We need to copy the provider DLLs from the dependency package to the
PHP distribution.

Closes GH-9894.
2022-11-14 12:42:37 +01:00
Pierrick Charron
327c95237c
Prepare for PHP 8.3 2022-08-30 11:17:15 -04:00
Christoph M. Becker
c643cbf388
Support test-ini also for phpize builds
Automatically generating and using test INI files is supported for
in-tree build (`buildconf`) for a long time, and this can make sense
for phpize builds too, especially when the build extension is a zend
extension, so it can be properly loaded.

Thus we make `--enable-test-ini` and `--with-test-ini-ext-exclude`
available for phpize, but default to false for full BC.

Closes GH-8787.
2022-08-26 14:25:10 +02:00
dixyes
279a297172
Windows arm64 build system support
Closes GH-9116.
2022-08-09 16:22:14 +02:00
dixyes
02881a76a8
Port win32/codepage.c codes for windows arm64
Closes GH-7702.
2022-07-21 14:02:25 +02:00
David Carlier
bfe6f9e66a Introduction of timing attack safe bcmp implementation.
Nothing new but to refactor usage b/w hash and password
extensions but using volatile pointers to be a bit safer,
allowing to expand its usage eventually.
2022-06-20 16:30:30 +01:00
Christoph M. Becker
8aa7e203ed
Escape problematic characters in CREDITS files
On Windows, the contents of the CREDITS files are passed to rc.exe via
the command line.  To avoid undesired behavior, we need to escape some
characters, most notably `<` (which is sometimes used in CREDITS to
enclose mail addresses), which otherwise is interpreted as redirection
operator, resulting in the hard to understand "The system cannot find
the file specified."

Even more dangerous is not properly escaping percent signs, which makes
it possible for a malicious CREDITS file to inject the values of
environment variables of the build system into the generated binaries.
This is particularly bad, because as of Windows Vista, the comments can
no longer be inspected via explorer.exe, although the binaries still
contain these comments.

We also cater to double-quotes, which need to be escaped as `\"\"` in
this context.

Closes GH-8767.
2022-06-20 16:02:49 +02:00
Christoph M. Becker
7d6821a98a
Remove superfluous snapshot_build_exclusions
These configuration options have been removed, so there is no need to
still cater to them.

Closes GH-8792.
2022-06-18 14:26:51 +02:00
Christoph M. Becker
9e9141f712
Use HTTPS URLs in resource files
Although it is unlikely that anybody ever sees these URLs, since they
are not shown in the file property sheet, it's overdue to switch to
HTTPS.
2022-06-15 17:56:14 +02:00
Levi Morrison
280fd680c8
Make vm_interrupt and timed_out atomic (#8327)
This is done by adding a new zend_atomic_bool type. The type
definition is only available for compiler alignment and size info; it
should be treated as opaque and only the zend_atomic_bool_* family of
functions should be used.

Note that directly using atomic_bool is complicated. All C++ compilers
stdlibs that I checked typedef atomic_bool to std::atomic<bool>, which
can't be used in an extern "C" section, and there's at least one usage
of this in core, and probably more outside of it.

So, instead use platform specific functions, preferring compiler
intrinsics.
2022-06-01 09:43:25 -06:00
Calvin Buckley
2920a26636
Quote when adding to connection string in (PDO_)ODBC
Because the UID= and PWD= values are appended to the SQLDriverConnect
case when credentials are passed, we have to append them to the string
in case users are relying on this behaviour. However, they must be
quoted, or the arguments will be invalid (or possibly more injected).
This means users had to quote arguments or append credentials to the raw
connection string themselves.

It seems that ODBC quoting rules are consistent enough (and that
Microsoft trusts them enough to encode into the .NET BCL) that we can
actually check if the string is already quoted (in case a user is
already quoting because of this not being fixed), and if not, apply the
appropriate ODBC quoting rules.

This is because the code exists in main/, and are shared between
both ODBC extensions, so it doesn't make sense for it to only exist
in one or the other. There may be a better spot for it.

Closes GH-8307.
2022-05-27 16:56:44 +02:00
George Peter Banyard
9f06bb3bb6
Drop remaining usage of u_char in favour of standard C99 uint8_t (#8611)
Plus minor drive-by fixes
2022-05-23 21:57:31 +01:00
George Peter Banyard
de41d6b0ce
I shall never touch anything Windows related 2022-05-22 16:46:33 +01:00
George Peter Banyard
892927eb14
Use proper function prototypes in win32/glob.c
This just confused the hell out of me
2022-05-22 16:34:26 +01:00
George Peter Banyard
265c88b9e7
Don't initialise pointers to zend_stat_t 2022-05-22 16:13:44 +01:00
George Peter Banyard
2ecd46f48f
Initialise zend_stat_t to fix MSAN build 2022-05-22 16:06:27 +01:00
Christoph M. Becker
81d1a1b47b
Update bug tracker links
The new php-src bugtracker is on Github.

Closes GH-8277.
2022-05-12 14:55:11 +02:00
Max Kellermann
d87ba95acd
sapi/*: move duplicate "--define" code to library 2022-04-18 16:52:08 +02:00
George Peter Banyard
2c2ecba063
Determine value of ZEND_MM_* during config and fix sign conversion (#6981)
Also add a new ZEND_MM_NEED_EIGHT_BYTE_REALIGNMENT definition.

This fixes many [-Wsign-conversion] warnings.

Co-authored-by: Guillaume Charifi <guillaume.charifi@sfr.fr>
Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
2022-04-01 15:43:42 +01:00
Christoph M. Becker
9e80947e34
VS 17 == MSVC v143 == Visual Studio 2022 == cl 19.3x 2022-01-08 20:02:28 +01:00
Christoph M. Becker
71b55d7dd8
[ci skip] supportedOs Id for Windows 10 and 11 are the same
Cf. <https://docs.microsoft.com/en-us/windows/win32/sysinfo/targeting-your-application-at-windows-8-1>.
2021-12-27 15:18:47 +01:00
Dmitry Stogov
cddb65b54e Merge branch 'PHP-8.1'
* PHP-8.1:
  Fixed bug #81634 (ZEND_ENABLE_STATIC_TSRMLS_CACHE produces extensionswith the STATIC_TLS flag)
2021-11-24 20:45:09 +03:00
Dmitry Stogov
72f8dbb312 Fixed bug #81634 (ZEND_ENABLE_STATIC_TSRMLS_CACHE produces extensionswith the STATIC_TLS flag) 2021-11-24 20:43:30 +03:00
DmitryMaksimov
2b32cafd88
Use neutral language instead of default on Windows
Most notably, this affects some Windows specific error messages, which
are no longer in the default language of the system, to better match
error messages provided by PHP which are not localized anyway.

This also affects the com_dotnet extension, where it could fix some
DCOM related issues.  Furthermore, the constant `LOCALE_NEUTRAL` is
added, which can be used for `variant_cmp()`.

Closes GH-7613.
2021-11-03 19:39:20 +01:00
Dmitry Stogov
90b7bde615 Use more compact representation for packed arrays.
- for packed arrays we store just an array of zvals without keys.
- the elements of packed array are accessible throuf as ht->arPacked[i]
  instead of ht->arData[i]
- in addition to general ZEND_HASH_FOREACH_* macros, we introduced similar
  familied for packed (ZEND_HASH_PACKED_FORECH_*) and real hashes
  (ZEND_HASH_MAP_FOREACH_*)
- introduced an additional family of macros to access elements of array
  (packed or real hashes) ZEND_ARRAY_ELEMET_SIZE, ZEND_ARRAY_ELEMET_EX,
  ZEND_ARRAY_ELEMET, ZEND_ARRAY_NEXT_ELEMENT, ZEND_ARRAY_PREV_ELEMENT
- zend_hash_minmax() prototype was changed to compare only values

Because of smaller data set, this patch may show performance improvement
on some apps and benchmarks that use packed arrays. (~1% on PHP-Parser)

TODO:
    - sapi/phpdbg needs special support for packed arrays (WATCH_ON_BUCKET).
    - zend_hash_sort_ex() may require converting packed arrays to hash.
2021-11-03 15:18:26 +03:00
Patrick Allaert
a93e12f8a6
Prepare for PHP 8.2 (bis) 2021-09-01 11:09:30 +02:00
Joe Watkins
00c668a15d
Drop TsHashTable (#7351) 2021-08-08 10:45:44 +02:00
Patrick Allaert
aff365871a Fixed some spaces used instead of tabs 2021-06-29 11:30:26 +02:00
Patrick Allaert
ceb6fa6dc0 Convert some recently introduced zend_bool to bool
As well as `scripts/dev/check_parameters.php` utility.

Cfr. 3e01f5afb1
2021-06-18 15:21:39 +01:00
Christoph M. Becker
16feae57a1
Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #81120: PGO data for main PHP DLL are not used
2021-06-10 22:58:18 +02:00
Christoph M. Becker
21f2ff79de
Fix #81120: PGO data for main PHP DLL are not used
We need to look for the right file.  To avoid total confusion, we also
rename the variables; however, the right solution would have been to
drop the version suffixes, since they don't help (major + minor maybe,
but not major only).
2021-06-10 22:57:09 +02:00
Nikita Popov
7db146eea7
Remove "inline" defines on Windows (#7071)
Newer MSVC versions support the `inline` keyword, so we do not need to explicitly define it. We also shouldn't define `inline` to `__forceinline`, as we already have `zend_always_inline` to indicate this requirement.
2021-05-31 10:05:18 +02:00
twosee
9066d695e9
Remove all *_EXTERN_C() in C source files (#7054) 2021-05-27 15:52:54 +08:00
KsaR
01b3fc03c3
Update http->https in license (#6945)
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
Aaron Piotrowski
c276c16b66
Implement Fibers
RFC: https://wiki.php.net/rfc/fibers

Closes GH-6875.
2021-04-26 11:07:06 -05:00
Josh Soref
462da6e09c Fix spelling and grammar mistakes
This PR corrects misspellings identified by the check-spelling action.

The misspellings have been reported at jsoref@b6ba3e2#commitcomment-48946465

The action reports that the changes in this PR would make it happy: jsoref@602417c

Closes GH-6822.
2021-04-13 12:09:37 +02:00
George Peter Banyard
09efad615b
Use zend_string_equals_(literal_)ci() API more often
Also drive-by usage of zend_ini_parse_bool()

Closes GH-6844
2021-04-09 02:34:50 +01:00