* gc.c (ruby_xmalloc2): change check for integer overflow.

[ruby-dev:27399]

* gc.c (ruby_xrealloc2): ditto.

* eval.c (exec_under): avoid accessing ruby_frame->prev.
  [ruby-dev:27948]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2005-12-06 07:52:18 +00:00
parent 445d6076d8
commit 088fb2a36e
8 changed files with 54 additions and 30 deletions

8
st.c
View file

@ -18,9 +18,9 @@
#define xrealloc ruby_xrealloc
#define xfree ruby_xfree
void *xmalloc(long);
void *xcalloc(long, long);
void *xrealloc(void *, long);
void *xmalloc(size_t);
void *xcalloc(size_t, size_t);
void *xrealloc(void *, size_t);
void xfree(void *);
#endif
#endif
@ -65,7 +65,7 @@ static struct st_hash_type type_strhash = {
static void rehash(st_table *);
#define alloc(type) (type*)xmalloc((unsigned)sizeof(type))
#define alloc(type) (type*)xmalloc((size_t)sizeof(type))
#define Calloc(n,s) (char*)xcalloc((n),(s))
#define EQUAL(table,x,y) ((x)==(y) || (*table->type->compare)((x),(y)) == 0)