aboutsummaryrefslogtreecommitdiffstats
path: root/shape.c
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2023-11-22 11:35:42 -0500
committerAlan Wu <XrXr@users.noreply.github.com>2023-11-22 12:17:58 -0500
commit341321f11596dfef5e9af13fa1fad797fbfcdf67 (patch)
tree2c35992933a8058c02cdf11f9fd81231df3df5c9 /shape.c
parent0e59d91eeddcff4a28add1ce7796ee9cd9ae9e10 (diff)
downloadruby-341321f11596dfef5e9af13fa1fad797fbfcdf67.tar.gz
Fix off-by-one with RubyVM::Shape.exhaust_shapes
Previously, the method left one shape available (MAX_SHAPE_ID) when called without arguments.
Diffstat (limited to 'shape.c')
-rw-r--r--shape.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/shape.c b/shape.c
index de57551fcf..6d6235dd3d 100644
--- a/shape.c
+++ b/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;
}