mirror of
https://github.com/ruby/ruby.git
synced 2025-09-18 10:03:59 +02:00
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
1 changed files with 1 additions and 1 deletions
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…
Add table
Add a link
Reference in a new issue