Fix off-by-one with RubyVM::Shape.exhaust_shapes
Previously, the method left one shape available (MAX_SHAPE_ID) when called without arguments.
This commit is contained in:
parent
0e59d91eed
commit
341321f115
2
shape.c
2
shape.c
@ -1062,7 +1062,7 @@ rb_shape_exhaust(int argc, VALUE *argv, VALUE self)
|
||||
{
|
||||
rb_check_arity(argc, 0, 1);
|
||||
int offset = argc == 1 ? NUM2INT(argv[0]) : 0;
|
||||
GET_SHAPE_TREE()->next_shape_id = MAX_SHAPE_ID - offset;
|
||||
GET_SHAPE_TREE()->next_shape_id = MAX_SHAPE_ID - offset + 1;
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user