Skip to content

Commit d6a6679

Browse files
committed
Test
1 parent 6713507 commit d6a6679

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
From a21ff4bc95ec4a4b40fe6ae61814272caa9ccb65 Mon Sep 17 00:00:00 2001
2+
From: Shivam Mathur <shivam_jpr@hotmail.com>
3+
Date: Sat, 21 Dec 2024 10:37:36 +0000
4+
Subject: [PATCH] ext/pdo_firebird: Fix label follow by declaration
5+
6+
A label should be followed by a statement and not a declaration, else old gcc gives the following error: a label can only be part of a statement and a declaration is not a statement
7+
8+
To fix this we wrap the code in the switch case block in braces.
9+
---
10+
ext/pdo_firebird/firebird_statement.c | 3 ++-
11+
1 file changed, 2 insertions(+), 1 deletion(-)
12+
13+
diff --git a/ext/pdo_firebird/firebird_statement.c b/ext/pdo_firebird/firebird_statement.c
14+
index 910b325112c..11ae4d68503 100644
15+
--- a/ext/pdo_firebird/firebird_statement.c
16+
+++ b/ext/pdo_firebird/firebird_statement.c
17+
@@ -886,7 +886,7 @@ static int pdo_firebird_stmt_set_attribute(pdo_stmt_t *stmt, zend_long attr, zva
18+
switch (attr) {
19+
default:
20+
return 0;
21+
- case PDO_ATTR_CURSOR_NAME:
22+
+ case PDO_ATTR_CURSOR_NAME: {
23+
zend_string *str_val = zval_try_get_string(val);
24+
if (str_val == NULL) {
25+
return 0;
26+
@@ -907,6 +907,7 @@ static int pdo_firebird_stmt_set_attribute(pdo_stmt_t *stmt, zend_long attr, zva
27+
memcpy(S->name, ZSTR_VAL(str_val), ZSTR_LEN(str_val) + 1);
28+
zend_string_release(str_val);
29+
break;
30+
+ }
31+
}
32+
return 1;
33+
}
34+
--
35+
2.47.1
36+

config/patches/8.5/series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,4 @@
4141
0042-Update-gcc-func-attr-macro.patch
4242
0043-scripts-php-.in-Explicitly-define-the-path-to-sed.patch
4343
0044-Remove-timestamps-from-phar.patch
44+
0045-ext-pdo_firebird-Fix-label-follow-by-declaration.patch

0 commit comments

Comments
 (0)