summaryrefslogtreecommitdiff
path: root/ext/mysqli/mysqli_exception.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mysqli/mysqli_exception.c')
-rw-r--r--ext/mysqli/mysqli_exception.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/ext/mysqli/mysqli_exception.c b/ext/mysqli/mysqli_exception.c
index dafc3098c7..ec86b9d740 100644
--- a/ext/mysqli/mysqli_exception.c
+++ b/ext/mysqli/mysqli_exception.c
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2013 The PHP Group |
+ | Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -38,7 +38,7 @@ const zend_function_entry mysqli_exception_methods[] = {
void php_mysqli_throw_sql_exception(char *sqlstate, int errorno TSRMLS_DC, char *format, ...)
{
- zval *sql_ex;
+ zval sql_ex;
va_list arg;
char *message;
@@ -52,26 +52,25 @@ void php_mysqli_throw_sql_exception(char *sqlstate, int errorno TSRMLS_DC, char
return;
}
- MAKE_STD_ZVAL(sql_ex);
- object_init_ex(sql_ex, mysqli_exception_class_entry);
+ object_init_ex(&sql_ex, mysqli_exception_class_entry);
if (message) {
- zend_update_property_string(mysqli_exception_class_entry, sql_ex, "message", sizeof("message") - 1,
+ zend_update_property_string(mysqli_exception_class_entry, &sql_ex, "message", sizeof("message") - 1,
message TSRMLS_CC);
}
if (sqlstate) {
- zend_update_property_string(mysqli_exception_class_entry, sql_ex, "sqlstate", sizeof("sqlstate") - 1,
+ zend_update_property_string(mysqli_exception_class_entry, &sql_ex, "sqlstate", sizeof("sqlstate") - 1,
sqlstate TSRMLS_CC);
} else {
- zend_update_property_string(mysqli_exception_class_entry, sql_ex, "sqlstate", sizeof("sqlstate") - 1,
+ zend_update_property_string(mysqli_exception_class_entry, &sql_ex, "sqlstate", sizeof("sqlstate") - 1,
"00000" TSRMLS_CC);
}
efree(message);
- zend_update_property_long(mysqli_exception_class_entry, sql_ex, "code", sizeof("code") - 1, errorno TSRMLS_CC);
+ zend_update_property_long(mysqli_exception_class_entry, &sql_ex, "code", sizeof("code") - 1, errorno TSRMLS_CC);
- zend_throw_exception_object(sql_ex TSRMLS_CC);
+ zend_throw_exception_object(&sql_ex TSRMLS_CC);
}
/*