Merge branch 'PHP-8.4'

* PHP-8.4:
  Update Lexbor patches for non-string attribute
This commit is contained in:
Niels Dossche 2025-05-28 23:35:23 +02:00
commit a63d0a49b0
No known key found for this signature in database
GPG key ID: B8A8AD166DF0E2E5
2 changed files with 31 additions and 8 deletions

View file

@ -15,11 +15,21 @@ extern "C" {
#include "lexbor/core/base.h" #include "lexbor/core/base.h"
#ifdef __has_attribute
# if __has_attribute(nonstring) && defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 15
# define LXB_NONSTRING __attribute__((nonstring))
# else
# define LXB_NONSTRING
# endif
#else
# define LXB_NONSTRING
#endif
typedef struct { typedef struct {
lxb_char_t key; lxb_char_t key;
lxb_char_t value[6]; lxb_char_t value[6] LXB_NONSTRING;
unsigned char value_len; unsigned char value_len;
unsigned short left; unsigned short left;

View file

@ -5,24 +5,37 @@ Subject: [PATCH 5/6] Shrink size of static binary search tree
This also makes it more efficient on the data cache. This also makes it more efficient on the data cache.
--- ---
source/lexbor/core/sbst.h | 10 +++++----- source/lexbor/core/sbst.h | 19 ++++++++++++++-----
source/lexbor/html/tokenizer/state.c | 2 +- source/lexbor/html/tokenizer/state.c | 2 +-
utils/lexbor/html/tmp/tokenizer_res.h | 2 +- utils/lexbor/html/tmp/tokenizer_res.h | 2 +-
utils/lexbor/html/tokenizer_entities_bst.py | 10 +++++----- utils/lexbor/html/tokenizer_entities_bst.py | 10 +++++-----
utils/lexbor/lexbor/LXB.py | 2 +- utils/lexbor/lexbor/LXB.py | 2 +-
5 files changed, 13 insertions(+), 13 deletions(-) 5 files changed, 21 insertions(+), 12 deletions(-)
diff --git a/source/lexbor/core/sbst.h b/source/lexbor/core/sbst.h diff --git a/source/lexbor/core/sbst.h b/source/lexbor/core/sbst.h
index b0fbc54..40e0e91 100644 index b0fbc54..15a1d40 100644
--- a/source/lexbor/core/sbst.h --- a/source/lexbor/core/sbst.h
+++ b/source/lexbor/core/sbst.h +++ b/source/lexbor/core/sbst.h
@@ -19,12 +19,12 @@ extern "C" { @@ -15,16 +15,25 @@ extern "C" {
#include "lexbor/core/base.h"
+#ifdef __has_attribute
+# if __has_attribute(nonstring) && defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 15
+# define LXB_NONSTRING __attribute__((nonstring))
+# else
+# define LXB_NONSTRING
+# endif
+#else
+# define LXB_NONSTRING
+#endif
typedef struct { typedef struct {
lxb_char_t key; lxb_char_t key;
- void *value; - void *value;
- size_t value_len; - size_t value_len;
+ lxb_char_t value[6]; + lxb_char_t value[6] LXB_NONSTRING;
+ unsigned char value_len; + unsigned char value_len;
- size_t left; - size_t left;
@ -61,7 +74,7 @@ index b3701d5..73ab66e 100644
* Do not change this file! * Do not change this file!
*/ */
diff --git a/utils/lexbor/html/tokenizer_entities_bst.py b/utils/lexbor/html/tokenizer_entities_bst.py diff --git a/utils/lexbor/html/tokenizer_entities_bst.py b/utils/lexbor/html/tokenizer_entities_bst.py
index 4fa0999..7cd1335 100755 index 4fa0999..8bd83b2 100755
--- a/utils/lexbor/html/tokenizer_entities_bst.py --- a/utils/lexbor/html/tokenizer_entities_bst.py
+++ b/utils/lexbor/html/tokenizer_entities_bst.py +++ b/utils/lexbor/html/tokenizer_entities_bst.py
@@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
@ -107,7 +120,7 @@ index 4fa0999..7cd1335 100755
+ "../../../source/lexbor/html/tokenizer/res.h", + "../../../source/lexbor/html/tokenizer/res.h",
"data/entities.json"); "data/entities.json");
diff --git a/utils/lexbor/lexbor/LXB.py b/utils/lexbor/lexbor/LXB.py diff --git a/utils/lexbor/lexbor/LXB.py b/utils/lexbor/lexbor/LXB.py
index 2370c66..c41e645 100755 index 3e75812..b068ea3 100755
--- a/utils/lexbor/lexbor/LXB.py --- a/utils/lexbor/lexbor/LXB.py
+++ b/utils/lexbor/lexbor/LXB.py +++ b/utils/lexbor/lexbor/LXB.py
@@ -27,7 +27,7 @@ class Temp: @@ -27,7 +27,7 @@ class Temp: