From b11b2b498c741e08e11e8e51cf5c86dea00ff103 Mon Sep 17 00:00:00 2001 From: mame Date: Thu, 18 Sep 2008 10:44:09 +0000 Subject: [PATCH] * st.c (new_size): raise RuntimeError when st_table is too big. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ st.c | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9d73e817f4..560a00ea72 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Sep 18 19:43:04 2008 Yusuke Endoh + + * st.c (new_size): raise RuntimeError when st_table is too big. + Thu Sep 18 18:23:23 2008 Tanaka Akira * transcode.c (enc_arg): must take pointer argument to avoid GC diff --git a/st.c b/st.c index a51d7cf8c8..54e10721b0 100644 --- a/st.c +++ b/st.c @@ -6,9 +6,7 @@ #include "regint.h" #include "st.h" #else -#include "ruby/config.h" -#include "ruby/defines.h" -#include "ruby/st.h" +#include "ruby/ruby.h" #endif #include @@ -135,6 +133,9 @@ new_size(int size) if (newsize > size) return primes[i]; } /* Ran out of polynomials */ +#ifndef NOT_RUBY + rb_raise(rb_eRuntimeError, "st_table too big"); +#endif return -1; /* should raise exception */ #endif }