ruby: fix vector[length+50] = 0 segfault

develop
jj 2012-09-05 20:39:13 +02:00
parent afbace8af6
commit e09b98216f
1 changed files with 1 additions and 1 deletions

@ -476,7 +476,7 @@ module DFHack
def []=(idx, v)
idx += length if idx < 0
if idx >= length
insert_at(idx, 0)
insert_at(length, 0) while idx >= length
elsif idx < 0
raise 'index out of bounds'
end