Skip to content

Commit ed107b4

Browse files
committed
Update Lexbor patches for non-string attribute
This should fix the final sub-issue of phpGH-17687.
1 parent b8e734a commit ed107b4

File tree

2 files changed

+26
-11
lines changed

2 files changed

+26
-11
lines changed

ext/dom/lexbor/lexbor/core/sbst.h

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

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

18+
#if __has_attribute(nonstring) && defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 15
19+
# define LXB_NONSTRING __attribute__((nonstring))
20+
#else
21+
# define LXB_NONSTRING
22+
#endif
23+
1824

1925
typedef struct {
2026
lxb_char_t key;
2127

22-
lxb_char_t value[6];
28+
lxb_char_t value[6] LXB_NONSTRING;
2329
unsigned char value_len;
2430

2531
unsigned short left;

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

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,33 @@ 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 | 15 ++++++++++-----
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 | 8 ++++----
1212
utils/lexbor/lexbor/LXB.py | 2 +-
13-
5 files changed, 12 insertions(+), 12 deletions(-)
13+
5 files changed, 17 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..6a57835 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,21 @@ extern "C" {
20+
21+
#include "lexbor/core/base.h"
22+
23+
+#if __has_attribute(nonstring) && defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 15
24+
+# define LXB_NONSTRING __attribute__((nonstring))
25+
+#else
26+
+# define LXB_NONSTRING
27+
+#endif
28+
2029
typedef struct {
2130
lxb_char_t key;
2231

2332
- void *value;
2433
- size_t value_len;
25-
+ lxb_char_t value[6];
34+
+ lxb_char_t value[6] LXB_NONSTRING;
2635
+ unsigned char value_len;
2736

2837
- size_t left;
@@ -35,10 +44,10 @@ index b0fbc54..40e0e91 100644
3544
lexbor_sbst_entry_static_t;
3645

3746
diff --git a/source/lexbor/html/tokenizer/state.c b/source/lexbor/html/tokenizer/state.c
38-
index 70ca391..2f3414f 100644
47+
index 158aade..207b909 100644
3948
--- a/source/lexbor/html/tokenizer/state.c
4049
+++ b/source/lexbor/html/tokenizer/state.c
41-
@@ -1815,7 +1815,7 @@ lxb_html_tokenizer_state_char_ref_named(lxb_html_tokenizer_t *tkz,
50+
@@ -1820,7 +1820,7 @@ lxb_html_tokenizer_state_char_ref_named(lxb_html_tokenizer_t *tkz,
4251
goto done;
4352
}
4453

@@ -61,7 +70,7 @@ index b3701d5..73ab66e 100644
6170
* Do not change this file!
6271
*/
6372
diff --git a/utils/lexbor/html/tokenizer_entities_bst.py b/utils/lexbor/html/tokenizer_entities_bst.py
64-
index ee7dcb4..7cd1335 100755
73+
index 4fa0999..8bd83b2 100755
6574
--- a/utils/lexbor/html/tokenizer_entities_bst.py
6675
+++ b/utils/lexbor/html/tokenizer_entities_bst.py
6776
@@ -1,6 +1,6 @@
@@ -98,7 +107,7 @@ index ee7dcb4..7cd1335 100755
98107
+ "../../../source/lexbor/html/tokenizer/res.h",
99108
"data/entities.json");
100109
diff --git a/utils/lexbor/lexbor/LXB.py b/utils/lexbor/lexbor/LXB.py
101-
index 2370c66..c41e645 100755
110+
index 3e75812..b068ea3 100755
102111
--- a/utils/lexbor/lexbor/LXB.py
103112
+++ b/utils/lexbor/lexbor/LXB.py
104113
@@ -27,7 +27,7 @@ class Temp:
@@ -111,5 +120,5 @@ index 2370c66..c41e645 100755
111120
fh.close()
112121

113122
--
114-
2.44.0
123+
2.49.0
115124

0 commit comments

Comments
 (0)