aboutsummaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-08 14:33:11 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-08 14:33:11 +0000
commit6ee61d4bb9dac3fb3ed3bfb83014baed0a27a2ff (patch)
treeccfba3c14f3a42c8d7c255a7b2f802f45988647f /compile.c
parent6a105387ce4ed959bbc5952ad563de9a4bce1aee (diff)
downloadruby-6ee61d4bb9dac3fb3ed3bfb83014baed0a27a2ff.tar.gz
check loading object index range
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/compile.c b/compile.c
index 5ba4af476a..ce69b00729 100644
--- a/compile.c
+++ b/compile.c
@@ -7979,6 +7979,9 @@ ibf_load_object(const struct ibf_load *load, VALUE object_index)
if (object_index == 0) {
return Qnil;
}
+ else if (object_index >= load->header->object_list_size) {
+ rb_raise(rb_eIndexError, "object index out of range: %"PRIdVALUE, object_index);
+ }
else {
VALUE obj = rb_ary_entry(load->obj_list, (long)object_index);
if (obj == Qnil) { /* TODO: avoid multiple Qnil load */