diff options
author | Kevin Ryde <user42@zip.com.au> | 2003-10-18 23:49:50 +0200 |
---|---|---|
committer | Kevin Ryde <user42@zip.com.au> | 2003-10-18 23:49:50 +0200 |
commit | 9fb6efcfea3dfea125d603c4ac8fc50015cdb2f1 (patch) | |
tree | 17fdb6f798c449b7831077b1c80a672b97c4305e /gmpxx.h | |
parent | e23ce787f98034a6d3f99faebde1b71f2fd50a0b (diff) | |
download | gmp-9fb6efcfea3dfea125d603c4ac8fc50015cdb2f1.tar.gz |
* gmpxx.h (gmp_randclass gmp_randinit_lc_2exp_size constructor): Throw
std::length_error if size is too big.
Diffstat (limited to 'gmpxx.h')
-rw-r--r-- | gmpxx.h | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -5505,7 +5505,10 @@ public: // gmp_randinit_lc_2exp_size gmp_randclass(__gmp_randinit_lc_2exp_size_t* f, unsigned long int size) - { f(state, size); } + { + if (f (state, size) == 0) + throw std::length_error ("gmp_randinit_lc_2exp_size"); + } ~gmp_randclass() { gmp_randclear(state); } |