Skip to content

Commit 1c5d420

Browse files
committed
Fix ZEND_BEGIN_ARG_INFO_EX for ibase_rollback_ret
When running a debug build of PHP, the engine verifies that the info supplied in the `ZEND_BEGIN_ARG_INFO_EX` macro is correct. The last parameter of the `ZEND_BEGIN_ARG_INFO_EX` macro is the number of required arguments. If we try to invoke `ibase_rollback_ret` with zero arguments, we get the following error message: ``` Fatal error: Arginfo / zpp mismatch during call of ibase_rollback_ret() in test.php on line 123 ``` This patch corrects this by setting the value to zero to match how the method is implemented.
1 parent 7e53f32 commit 1c5d420

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

interbase.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ibase_commit_ret, 0, 0, 1)
103103
ZEND_ARG_INFO(0, link_identifier)
104104
ZEND_END_ARG_INFO()
105105

106-
ZEND_BEGIN_ARG_INFO_EX(arginfo_ibase_rollback_ret, 0, 0, 1)
106+
ZEND_BEGIN_ARG_INFO_EX(arginfo_ibase_rollback_ret, 0, 0, 0)
107107
ZEND_ARG_INFO(0, link_identifier)
108108
ZEND_END_ARG_INFO()
109109

tests/ibase_rollback_ret_001.phpt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--TEST--
2+
ibase_rollback_ret(): Make sure the method can be invoked with zero arguments
3+
--SKIPIF--
4+
<?php include("skipif.inc"); ?>
5+
--FILE--
6+
<?php
7+
8+
require("interbase.inc");
9+
10+
ibase_connect($test_base);
11+
12+
ibase_query('INSERT INTO test1 VALUES (100, 2)');
13+
14+
var_dump(ibase_rollback_ret());
15+
16+
?>
17+
--EXPECTF--
18+
bool(true)

0 commit comments

Comments
 (0)