diff options
author | Shugo Maeda <shugo@ruby-lang.org> | 2022-02-18 19:47:08 +0900 |
---|---|---|
committer | Shugo Maeda <shugo@ruby-lang.org> | 2022-02-18 22:13:45 +0900 |
commit | cda5aee74e298cca9ffaa42fdc99e8de2e05fb0e (patch) | |
tree | 0e4d971cc26b64e3dc54025b0899761efe54b9dd /re.c | |
parent | e9a2b30744a62268c66d6c17730ed96486d9783c (diff) |
LONG2NUM() should be used for rmatch_offset::{beg,end}
https://github.com/ruby/ruby/pull/5518#discussion_r809645406
Diffstat (limited to 're.c')
-rw-r--r-- | re.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1230,8 +1230,8 @@ match_offset(VALUE match, VALUE n) return rb_assoc_new(Qnil, Qnil); update_char_offset(match); - return rb_assoc_new(INT2FIX(RMATCH(match)->rmatch->char_offset[i].beg), - INT2FIX(RMATCH(match)->rmatch->char_offset[i].end)); + return rb_assoc_new(LONG2NUM(RMATCH(match)->rmatch->char_offset[i].beg), + LONG2NUM(RMATCH(match)->rmatch->char_offset[i].end)); } @@ -1265,7 +1265,7 @@ match_begin(VALUE match, VALUE n) return Qnil; update_char_offset(match); - return INT2FIX(RMATCH(match)->rmatch->char_offset[i].beg); + return LONG2NUM(RMATCH(match)->rmatch->char_offset[i].beg); } @@ -1299,7 +1299,7 @@ match_end(VALUE match, VALUE n) return Qnil; update_char_offset(match); - return INT2FIX(RMATCH(match)->rmatch->char_offset[i].end); + return LONG2NUM(RMATCH(match)->rmatch->char_offset[i].end); } /* |