Files
php/php-8.1.34-sury-9-re2c-generated.patch
T
chrisandClaude Opus 5.5 9ca1942a50 mod_php_install.sh: fix PHP 8.1.34 build after applying security patches.
The patches change sources of generated files (Zend/zend_vm_def.h,
*.re) together with the generated files. Patching left the sources
newer, so make re-ran zend_vm_gen.php with the host's php binary,
producing a broken Zend/zend_vm_opcodes.h ("operator '==' has no left
operand"). Touch the generated files after patching so they are taken
as up to date.

sury-9 changes pdo_sql_parser.re and url_scanner_ex.re without the
generated *.c files, so these fixes needed re2c to be built. Add
php-8.1.34-sury-9-re2c-generated.patch, which applies the same changes
to the generated *.c files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 13:00:40 +01:00

46 lines
1.8 KiB
Diff

# Generated-file counterpart of the ext/pdo/pdo_sql_parser.re and
# ext/standard/url_scanner_ex.re hunks of php-8.1.34-sury-9.patch
# (so the fixes are built without re2c). Apply with -p1 after sury-9.
diff -ru a/ext/pdo/pdo_sql_parser.c b/ext/pdo/pdo_sql_parser.c
--- a/ext/pdo/pdo_sql_parser.c 2026-11-20 12:59:33.025497677 +0100
+++ b/ext/pdo/pdo_sql_parser.c 2026-11-20 12:59:33.065925906 +0100
@@ -392,7 +392,7 @@
if (t == PDO_PARSER_BIND) {
ptrdiff_t len = s.cur - s.tok;
- if ((ZSTR_VAL(inquery) < (s.cur - len)) && isalnum(*(s.cur - len - 1))) {
+ if ((ZSTR_VAL(inquery) < (s.cur - len)) && isalnum((unsigned char)s.cur[-len - 1])) {
continue;
}
query_type |= PDO_PLACEHOLDER_NAMED;
diff -ru a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c
--- a/ext/standard/url_scanner_ex.c 2026-11-20 12:59:33.044057656 +0100
+++ b/ext/standard/url_scanner_ex.c 2026-11-20 12:59:33.067960258 +0100
@@ -86,7 +86,7 @@
*val++ = '\0';
for (q = key; *q; q++) {
- *q = tolower(*q);
+ *q = tolower((unsigned char)*q);
}
keylen = q - key;
str = zend_string_init(key, keylen, 1);
@@ -135,7 +135,7 @@
char *q;
for (q = key; *q; q++) {
- *q = tolower(*q);
+ *q = tolower((unsigned char)*q);
}
keylen = q - key;
if (keylen > 0) {
@@ -449,7 +449,7 @@
}
smart_str_appendl(&ctx->tag, start, YYCURSOR - start);
for (i = 0; i < ZSTR_LEN(ctx->tag.s); i++)
- ZSTR_VAL(ctx->tag.s)[i] = tolower((int)(unsigned char)ZSTR_VAL(ctx->tag.s)[i]);
+ ZSTR_VAL(ctx->tag.s)[i] = tolower((unsigned char)ZSTR_VAL(ctx->tag.s)[i]);
/* intentionally using str_find here, in case the hash value is set, but the string val is changed later */
if ((ctx->lookup_data = zend_hash_str_find_ptr(ctx->tags, ZSTR_VAL(ctx->tag.s), ZSTR_LEN(ctx->tag.s))) != NULL) {
ok = 1;