aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-26 07:28:23 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-26 07:28:23 +0000
commite8c15027524a36d815a2c8ca3d6774cb2b2e4a3f (patch)
tree7f6d0a269e559695c9ab8ef7cd154a3d3d77e729 /include
parente0aa236f918a5bfb2ac292687f6fafd7d37d92a6 (diff)
downloadruby-e8c15027524a36d815a2c8ca3d6774cb2b2e4a3f.tar.gz
attempt to fix rb_alloc_tmp_buffer2 for ALLOCV_N
This is a confusing function to my arithmetic-challenged mind, but nobu seems alright with this. Anyways this lets me use large values of elsize without segfaulting, and "make exam" passes. * include/ruby/ruby.h (rb_alloc_tmp_buffer2): attempt to fix [ruby-core:81388] [ruby-core:81391] [Bug #13595] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r--include/ruby/ruby.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 0b277dce19..97cfe1f7c7 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -1611,7 +1611,7 @@ static inline void *
rb_alloc_tmp_buffer2(volatile VALUE *store, long count, size_t elsize)
{
size_t cnt = (size_t)count;
- if (elsize % sizeof(VALUE) == 0) {
+ if (elsize == sizeof(VALUE)) {
if (RB_UNLIKELY(cnt > LONG_MAX / sizeof(VALUE))) {
ruby_malloc_size_overflow(cnt, elsize);
}