]> granicus.if.org Git - php/commit
Fix bug #65997 by switching to Serializable for GMP
authorNikita Popov <nikic@php.net>
Tue, 29 Oct 2013 19:58:30 +0000 (20:58 +0100)
committerNikita Popov <nikic@php.net>
Tue, 29 Oct 2013 19:58:30 +0000 (20:58 +0100)
commit4218e89f8df4ca3897e3aad595e0c2c9cf4c3aca
tree5270d5aad9a57485cd2d15f7483e65b5b5235439
parent647e0be64b4cdcc5c94aa245d4d876d193709287
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.
ext/gmp/gmp.c
ext/gmp/tests/bug659967.phpt [new file with mode: 0644]
ext/gmp/tests/serialize.phpt