diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2023-11-22 11:35:42 -0500 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2023-11-22 12:17:58 -0500 |
commit | 341321f11596dfef5e9af13fa1fad797fbfcdf67 (patch) | |
tree | 2c35992933a8058c02cdf11f9fd81231df3df5c9 /shape.c | |
parent | 0e59d91eeddcff4a28add1ce7796ee9cd9ae9e10 (diff) | |
download | ruby-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; } |