1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fix compilation error on old GCC versions

In older versions of GCC (<=4.5) designated initializers would not accept member
names nested inside anonymous structures. Instead, we need to use a positional
member wrapped in {}.

Fixes GH-11063
Closes GH-11212
This commit is contained in:
Amedeo Baragiola
2023-05-09 19:09:42 +01:00
committed by Ilija Tovilo
parent 6ba0b06819
commit 175ff603c3
2 changed files with 2 additions and 1 deletions

1
NEWS
View File

@@ -7,6 +7,7 @@ PHP NEWS
value(s)). (nielsdos)
. Fixed bug GH-11189 (Exceeding memory limit in zend_hash_do_resize leaves
the array in an invalid state). (Bob)
. Fixed bug GH-11063 (Compilation error on old GCC versions). (ingamedeo)
- Hash:
. Fixed bug GH-11180 (hash_file() appears to be restricted to 3 arguments).

View File

@@ -240,7 +240,7 @@ ZEND_API const HashTable zend_empty_array = {
.gc.u.type_info = IS_ARRAY | (GC_IMMUTABLE << GC_FLAGS_SHIFT),
.u.flags = HASH_FLAG_UNINITIALIZED,
.nTableMask = HT_MIN_MASK,
.arData = (Bucket*)&uninitialized_bucket[2],
{.arData = (Bucket*)&uninitialized_bucket[2]},
.nNumUsed = 0,
.nNumOfElements = 0,
.nTableSize = HT_MIN_SIZE,