summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Joye <pierre.php@gmail.com>2014-03-10 12:10:57 +0100
committerPierre Joye <pierre.php@gmail.com>2014-03-10 12:10:57 +0100
commitd2e42d53729d065537d7576a2fd2975ff94e6ae6 (patch)
tree4f4f0a771e5e2f060f48746e27bb464c677fbc17
parent1fdca8208f057ba48fc7efdae0056f7978120688 (diff)
parent28fa31d6e5000b1550d8d2b471fc0c2425165180 (diff)
downloadphp-git-d2e42d53729d065537d7576a2fd2975ff94e6ae6.tar.gz
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4: fix #66872, invalid argument crashes gmp_testbit fix #66872, invalid argument crashes gmp_testbit add vc12 (2013) Conflicts: win32/build/confutils.js
-rw-r--r--ext/gmp/gmp.c16
-rw-r--r--win32/build/confutils.js2
2 files changed, 8 insertions, 10 deletions
diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c
index 25e8203030..134cc4819a 100644
--- a/ext/gmp/gmp.c
+++ b/ext/gmp/gmp.c
@@ -1511,25 +1511,23 @@ ZEND_FUNCTION(gmp_clrbit)
Tests if bit is set in a */
ZEND_FUNCTION(gmp_testbit)
{
- zval **a_arg;
+ zval *a_arg;
long index;
- mpz_t *gmpnum_a;
+ mpz_ptr gmpnum_a;
+ gmp_temp_t temp_a;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zl", &a_arg, &index) == FAILURE){
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl", &a_arg, &index) == FAILURE){
return;
}
- ZEND_FETCH_RESOURCE(gmpnum_a, mpz_t *, a_arg, -1, GMP_RESOURCE_NAME, le_gmp);
-
if (index < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Index must be greater than or equal to zero");
RETURN_FALSE;
}
- if (mpz_tstbit(*gmpnum_a, index)) {
- RETURN_TRUE;
- }
- RETURN_FALSE;
+ FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a);
+ RETVAL_BOOL(mpz_tstbit(gmpnum_a, index));
+ FREE_GMP_TEMP(temp_a);
}
/* }}} */
diff --git a/win32/build/confutils.js b/win32/build/confutils.js
index 2575205e5e..e0df4f621b 100644
--- a/win32/build/confutils.js
+++ b/win32/build/confutils.js
@@ -57,7 +57,7 @@ VC_VERSIONS_SHORT[1400] = 'VC8';
VC_VERSIONS_SHORT[1500] = 'VC9';
VC_VERSIONS_SHORT[1600] = 'VC10';
VC_VERSIONS_SHORT[1700] = 'VC11';
-VC_VERSIONS[1800] = 'VC12';
+VC_VERSIONS_SHORT[1800] = 'VC12';
if (PROGRAM_FILES == null) {
PROGRAM_FILES = "C:\\Program Files";