1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 09:28:21 +02:00
Commit Graph

173 Commits

Author SHA1 Message Date
Leigh adf8f0f284 Address issues raised by @nikic
- Thread safety on rand init function.
 - Ret false on validation failure
 - Add _dep of temp_a to temp_b
 - Special case int sized min values
 - More tests!
2014-09-24 22:01:09 +01:00
Leigh 3e9a31748d Make sure min < max 2014-09-24 07:56:46 +01:00
Leigh acd7fcf55f Mersenne Twister was added in GMP 4.2 2014-09-23 23:16:26 +01:00
Leigh 31e27fc89a Add test files 2014-09-23 22:54:40 +01:00
Leigh 831bb9260c Add gmp_random_bits(bits) and gmp_random_range(min, max) 2014-09-23 22:12:23 +01:00
Leigh 3d6d863ccb Change GMPs default PRNG to Mersenne Twister
Since we don't allow users to seed the RNG, there is no BC issue with changing the generator.
2014-09-23 19:51:56 +01:00
Nikita Popov 03797a73b2 Split GMP tests testing multiple functions
Also drop dummy test
2014-09-04 21:18:37 +02:00
Nikita Popov 9586b15229 Give proper names to GMP test files 2014-09-04 21:10:41 +02:00
Nikita Popov 15c139b99a Throw warnings when using zero modulus in gmp_powm
Also fixes a leak in this case.
2014-09-04 20:55:09 +02:00
Nikita Popov f10d194c8c Add GMP tests for some uncovered branches 2014-09-04 20:03:29 +02:00
Nikita Popov 834daa455b Fixed bug #50175
0x and 0b prefix is now only handled if either no base is given
or if the base is 16 (0x) or 2 (0b). Always handling it is incorrect
because 0x and 0b are perfectly valid numbers in other bases.
2014-09-02 19:04:55 +02:00
Nikita Popov 7533243f0c Fix C89 build and small cleanup 2014-09-02 18:52:13 +02:00
Leigh 47d630e7f0 Implement gmp_import() and gmp_export() 2014-09-02 14:19:18 +02:00
Nikita Popov fc5f931663 Fix bug #67917 (gmp compound assignment operator leak) 2014-08-27 22:16:20 +02:00
Stanislav Malyshev c18ae51aeb Fix crashes in GMP serialize/unserialize 2014-04-28 01:22:02 -07:00
Nikita Popov 5e93a213f6 Add SKIPIF in GMP test 2014-03-12 14:17:08 +01:00
Nikita Popov a117e6b937 Add tests for bug #66872 and gmp_[rem]root 2014-03-11 14:06:12 +01:00
Pierre Joye eef2978afc Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  update NEWS
  fix #66872, invalid argument crashes gmp_testbit
  fix #66872, invalid argument crashes gmp_testbit
  add vc12 (2013)

Conflicts:
	ext/gmp/gmp.c
2014-03-10 12:18:57 +01:00
Pierre Joye d2e42d5372 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
2014-03-10 12:10:57 +01:00
Pierre Joye af41914e15 fix #66872, invalid argument crashes gmp_testbit 2014-03-10 12:06:40 +01:00
datibbaw aff56f3c45 add T_POW (**) operator
Fixed recognition of the operator

Added opcode, still doing multiply instead of pow()

opcode now always returns int(42)

The right answer, but always a float

Yanked code from pow() implementation.

Should not handle negative long as exponent ourselves

Added test cases from pow()

Moved precedence higher than '~'

Added GMP operator overloading

Added ZEND_ASSIGN_POW (**=) operator.

Added pow() as a language construct.

Adjusted test cases for changed precedence.

Reduced pow() to shell function around ZEND_API pow_function()

Reduced test case to only contain edge cases
Added overloading test case

Moved unary minus above T_POW

Revert "Added pow() as a language construct."

Bad bad bad idea.

This reverts commit f60b98cf7a8371233d800a6faa286ddba4432d02.

Reverted unary minus behaviour due to previous revert.
Convert arrays to int(0)
Exponent with array as a base becomes int(0)

Rebase against master

Fixed tokenizer test case
2014-02-06 14:41:21 +01:00
Xinchen Hui c081ce628f Bump year 2014-01-03 11:08:10 +08:00
Xinchen Hui 47c9027772 Bump year 2014-01-03 11:06:16 +08:00
Xinchen Hui c0d060f5c0 Bump year 2014-01-03 11:04:26 +08:00
Nikita Popov 5408f1e5a6 Throw warning when converting invalid string to GMP 2013-12-30 14:38:09 +01:00
Nikita Popov 00c74ccf69 Support gmp_remroot() on GMP 4.1 2013-12-02 20:11:06 +01:00
Nikita Popov f54f308f71 Clean up GMP arginfos
Removed duplicate arginfos, specified number of required args
everywhere and removed weird pass-by-ref arguments.
2013-11-29 00:05:28 +01:00
Nikita Popov 6d38090c8d Add gmp_root() and gmp_rootrem() functions 2013-11-29 00:01:59 +01:00
Nikita Popov 1c8cbe4b4e Use class handlers for GMP serialization
A bit faster and less boilerplate
2013-11-29 00:01:59 +01:00
Nikita Popov 8860758a74 Remove duplicate / commented code in GMP 2013-11-29 00:01:59 +01:00
Nikita Popov 4218e89f8d Fix bug #65997 by switching to Serializable for GMP
Rather than using get_properties and __wakeup for serialization
the code now uses Serializable::serialize() and
Serializable::unserialize(). The get_properties handler is switched
to a get_debug_info handler. Thus get_gc will now return only
the normal properties and not do any modifications, thus fixing
the leak. This also avoids a $num property from being publicly
visible after the object was dumped or serialized, so that's an
extra plus.
2013-10-29 20:58:30 +01:00
Nikita Popov 647e0be64b Fix compile warning in GMP 2013-10-29 20:07:34 +01:00
Christopher Jones 3c166c4758 Merge branch 'PHP-5.5'
* PHP-5.5:
  Reduce (some) compile noise of 'unused variable' and 'may be used uninitialized' warnings.

Conflicts:
	ext/gmp/gmp.c
2013-08-14 20:47:00 -07:00
Christopher Jones 39612afc72 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Reduce (some) compile noise of 'unused variable' and 'may be used uninitialized' warnings.

Conflicts:
	ext/dba/libinifile/inifile.c
2013-08-14 20:43:25 -07:00
Christopher Jones 9ad97cd489 Reduce (some) compile noise of 'unused variable' and 'may be used uninitialized' warnings. 2013-08-14 20:36:50 -07:00
Christopher Jones 4c3c9d1fe5 Merge branch 'PHP-5.5'
* PHP-5.5:
  Fix long-standing visual pain point: the misalignment of './configure help' text. Whitespace changes and a couple of grammar fixes.
2013-08-06 11:09:12 -07:00
Christopher Jones c6d977dd39 Fix long-standing visual pain point: the misalignment of './configure help' text.
Whitespace changes and a couple of grammar fixes.
2013-08-06 11:06:09 -07:00
Felipe Pena 281936b295 - Fixed bug #65227 (Memory leak in gmp_cmp second parameter) 2013-07-12 20:23:00 -03:00
Nikita Popov 7713b8c2ac GMP improvements
As per RFC https://wiki.php.net/rfc/operator_overloading_gmp
2013-06-17 17:59:12 +02:00
Xinchen Hui a666285bc2 Happy New Year 2013-01-01 16:37:09 +08:00
Xinchen Hui 0a7395e009 Happy New Year 2013-01-01 16:28:54 +08:00
Anatoliy Belsky 9a72b52a1f fixing test for upcoming mpir upgrade
- mpir is going to be upgraded up to 2.5.1 on windows
2012-08-23 17:09:45 +02:00
Anatoliy Belsky 77e70b391c Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed bug #62068 Test bug - gmp_nextprime and 022
  Fix: 62067 Moved comments to FILE section
  - BFN

Conflicts:
	NEWS
2012-05-21 12:37:59 +02:00
Matt Ficken 645d65f3e3 Fixed bug #62068 Test bug - gmp_nextprime and 022 2012-05-21 12:31:16 +02:00
Felipe Pena e4ca0ed09f - Year++ 2012-01-01 13:15:04 +00:00
Felipe Pena 4e19825281 - Year++ 2012-01-01 13:15:04 +00:00
Felipe Pena 23e438594d - Make usage of new PHP_FE_END macro 2011-07-25 11:42:53 +00:00
Felipe Pena 4b30846b50 - Make usage of new PHP_FE_END macro 2011-07-25 11:35:02 +00:00
Felipe Pena 927bf09c29 - Year++ 2011-01-01 02:19:59 +00:00
Felipe Pena 0203cc3d44 - Year++ 2011-01-01 02:17:06 +00:00