8000 Merge branch 'PHP-8.4' · php/php-src@a63d0a4 · GitHub
[go: up one dir, main page]

Skip to content

Commit a63d0a4

Browse files
committed
Merge branch 'PHP-8.4'
* PHP-8.4: Update Lexbor patches for non-string attribute
2 parents 8e46d9a + 9e9db0b commit a63d0a4

File tree

2 files changed

+31
-8
lines changed

2 files changed

+31
-8
lines changed

ext/lexbor/lexbor/core/sbst.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,21 @@ extern "C" {
1515

1616
#include "lexbor/core/base.h"
1717

18+
#ifdef __has_attribute
19+
# if __has_attribute(nonstring) && defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 15
20+
# define LXB_NONSTRING __attribute__((nonstring))
21+
# else
22+
# define LXB_NONSTRING
23+
# endif
24+
#else
25+
# define LXB_NONSTRING
26+
#endif
27+
1828

1929
typedef struct {
2030
lxb_char_t key;
2131

22-
lxb_char_t value[6];
32+
lxb_char_t value[6] LXB_NONSTRING;
2333
unsigned char value_len;
2434

2535
unsigned short left;

ext/lexbor/patches/0005-Shrink-size-of-static-binary-search-tree.patch

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,37 @@ Subject: [PATCH 5/6] Shrink size of static binary search tree
55

66
This also makes it more efficient on the data cache.
77
---
8-
source/lexbor/core/sbst.h | 10 +++++-----
8+
source/lexbor/core/sbst.h | 19 ++++++++++++++-----
99
source/lexbor/html/tokenizer/state.c | 2 +-
1010
utils/lexbor/html/tmp/tokenizer_res.h | 2 +-
1111
utils/lexbor/html/tokenizer_entities_bst.py | 10 +++++-----
1212
utils/lexbor/lexbor/LXB.py | 2 +-
13-
5 files changed, 13 insertions(+), 13 deletions(-)
13+
5 files changed, 21 insertions(+), 12 deletions(-)
1414

1515
diff --git a/source/lexbor/core/sbst.h b/source/lexbor/core/sbst.h
16-
index b0fbc54..40e0e91 100644
16+
index b0fbc54..15a1d40 100644
1717
--- a/source/lexbor/core/sbst.h
1818
+++ b/source/lexbor/core/sbst.h
19-
@@ -19,12 +19,12 @@ extern "C" {
19+
@@ -15,16 +15,25 @@ extern "C" {
20+
21+
#include "lexbor/core/base.h"
22+
23+
+#ifdef __has_attribute
24+
+# if __has_attribute(nonstring) && defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 15
25+
+# define LXB_NONSTRING __attribute__((nonstring))
26+
+# else
27+
+# define LXB_NONSTRING
28+
+# endif
29+
+#else
30+
+# define LXB_NONSTRING
31+
+#endif
32+
2033
typedef struct {
2134
lxb_char_t key;
2235

2336
- void *value;
2437
- size_t value_len;
25-
+ lxb_char_t value[6];
38+
+ lxb_char_t value[6] LXB_NONSTRING;
2639
+ unsigned char value_len;
2740

2841
- size_t left;
@@ -61,7 +74,7 @@ index b3701d5..73ab66e 100644
6174
* Do not change this file!
6275
*/
6376
diff --git a/utils/lexbor/html/tokenizer_entities_bst.py b/utils/lexbor/html/tokenizer_entities_bst.py
64-
index 4fa0999..7cd1335 100755
77+
index 4fa0999..8bd83b2 100755
6578
--- a/utils/lexbor/html/tokenizer_entities_bst.py
6679
+++ b/utils/lexbor/html/tokenizer_entities_bst.py
6780
@@ -1,6 +1,6 @@
@@ -107,7 +120,7 @@ index 4fa0999..7cd1335 100755
107120
+ "../../../source/lexbor/html/tokenizer/res.h",
108121
"data/entities.json");
109122
diff --git a/utils/lexbor/lexbor/LXB.py b/utils/lexbor/lexbor/LXB.py
110-
index 2370c66..c41e645 100755
123+
index 3e75812..b068ea3 100755
111124
--- a/utils/lexbor/lexbor/LXB.py
112125
+++ b/utils/lexbor/lexbor/LXB.py
113126
@@ -27,7 +27,7 @@ class Temp:

0 commit comments

Comments
 (0)
0