1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 03:03:26 +02:00
This commit is contained in:
Antony Dovgal
2007-04-18 20:36:54 +00:00
parent b2785c3d4c
commit efcb227198
+10
View File
@@ -1484,6 +1484,11 @@ ZEND_FUNCTION(gmp_setbit)
break;
}
if (index < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Index must be greater than or equal to zero");
return;
}
if (set) {
mpz_setbit(*gmpnum_a, index);
} else {
@@ -1508,6 +1513,11 @@ ZEND_FUNCTION(gmp_clrbit)
convert_to_long_ex(ind_arg);
index = Z_LVAL_PP(ind_arg);
if (index < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Index must be greater than or equal to zero");
return;
}
mpz_clrbit(*gmpnum_a, index);
}