From 0ff18f4db54142c035aaa5964b3df6def25b9bce Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Thu, 19 Apr 2007 09:36:34 +0000 Subject: [PATCH] fix gmp_gcdext() in Unicode mode --- ext/gmp/gmp.c | 6 +++--- ext/gmp/tests/022.phpt | 47 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 3 deletions(-) diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index 7f386e6997..dca90ac1a4 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -1271,11 +1271,11 @@ ZEND_FUNCTION(gmp_gcdext) array_init(return_value); ZEND_REGISTER_RESOURCE(&r, gmpnum_g, le_gmp); - add_assoc_resource(return_value, "g", Z_LVAL(r)); + add_ascii_assoc_resource(return_value, "g", Z_LVAL(r)); ZEND_REGISTER_RESOURCE(&r, gmpnum_s, le_gmp); - add_assoc_resource(return_value, "s", Z_LVAL(r)); + add_ascii_assoc_resource(return_value, "s", Z_LVAL(r)); ZEND_REGISTER_RESOURCE(&r, gmpnum_t, le_gmp); - add_assoc_resource(return_value, "t", Z_LVAL(r)); + add_ascii_assoc_resource(return_value, "t", Z_LVAL(r)); } /* }}} */ diff --git a/ext/gmp/tests/022.phpt b/ext/gmp/tests/022.phpt index 0df874dc7d..6b1f9f5292 100644 --- a/ext/gmp/tests/022.phpt +++ b/ext/gmp/tests/022.phpt @@ -81,3 +81,50 @@ NULL Warning: Wrong parameter count for gmp_gcdext() in %s on line %d NULL Done +--UEXPECTF-- +unicode(1) "3" +unicode(2) "-4" +unicode(2) "11" +unicode(1) "1" +unicode(4) "-805" +unicode(3) "359" +unicode(1) "3" +unicode(2) "32" +unicode(5) "-2257" +unicode(4) "3003" +unicode(3) "-10" +unicode(2) "19" +unicode(1) "2" +unicode(2) "67" +unicode(2) "-3" +unicode(2) "15" +unicode(7) "-601519" +unicode(1) "6" +unicode(3) "345" +unicode(1) "1" +unicode(1) "0" +unicode(1) "1" +unicode(5) "84319" +unicode(9) "-84241831" +unicode(1) "1" +unicode(13) "-156252240050" +unicode(14) "16689072773537" +unicode(3) "195" +unicode(11) "46994884483" +unicode(9) "-68772552" + +Warning: gmp_gcdext(): Unable to convert variable to GMP - wrong type in %s on line %d +bool(false) + +Warning: gmp_gcdext(): Unable to convert variable to GMP - wrong type in %s on line %d +bool(false) + +Warning: Wrong parameter count for gmp_gcdext() in %s on line %d +NULL + +Warning: Wrong parameter count for gmp_gcdext() in %s on line %d +NULL + +Warning: Wrong parameter count for gmp_gcdext() in %s on line %d +NULL +Done -- 2.50.1