Skip to content

Commit c8d47cf

Browse files
committed
Convert warnings to assetions in OCI PDO driver
Closes GH-6118
1 parent 71de8fe commit c8d47cf

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

ext/pdo_oci/oci_statement.c

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,7 @@ static sb4 oci_bind_input_cb(dvoid *ctx, OCIBind *bindp, ub4 iter, ub4 index, dv
197197
pdo_oci_bound_param *P = (pdo_oci_bound_param*)param->driver_data;
198198
zval *parameter;
199199

200-
if (!param) {
201-
php_error_docref(NULL, E_WARNING, "param is NULL in oci_bind_input_cb; this should not happen");
202-
return OCI_ERROR;
203-
}
200+
ZEND_ASSERT(param);
204201

205202
*indpp = &P->indicator;
206203

@@ -236,10 +233,7 @@ static sb4 oci_bind_output_cb(dvoid *ctx, OCIBind *bindp, ub4 iter, ub4 index, d
236233
pdo_oci_bound_param *P = (pdo_oci_bound_param*)param->driver_data;
237234
zval *parameter;
238235

239-
if (!param) {
240-
php_error_docref(NULL, E_WARNING, "param is NULL in oci_bind_output_cb; this should not happen");
241-
return OCI_ERROR;
242-
}
236+
ZEND_ASSERT(param);
243237

244238
if (Z_ISREF(param->parameter))
245239
parameter = Z_REFVAL(param->parameter);
@@ -509,11 +503,7 @@ static sb4 oci_define_callback(dvoid *octxp, OCIDefine *define, ub4 iter, dvoid
509503
*alenpp = &col->datalen;
510504
*indpp = (dvoid *)&col->indicator;
511505
break;
512-
513-
default:
514-
php_error_docref(NULL, E_WARNING,
515-
"unhandled datatype in oci_define_callback; this should not happen");
516-
return OCI_ERROR;
506+
EMPTY_SWITCH_DEFAULT_CASE();
517507
}
518508

519509
return OCI_CONTINUE;

0 commit comments

Comments
 (0)