parse.y: replace strtoul() by mrb_int_read().

This commit is contained in:
Yukihiro "Matz" Matsumoto
2021-07-24 19:12:29 +09:00
parent 5c804cf68f
commit 8de8521cb6
2 changed files with 993 additions and 995 deletions
+1 -2
View File
@@ -13,7 +13,6 @@
#include <ctype.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <mruby.h>
#include <mruby/compile.h>
@@ -6264,7 +6263,7 @@ parser_yylex(parser_state *p)
if (last_state == EXPR_FNAME) goto gvar;
tokfix(p);
{
unsigned long n = strtoul(tok(p), NULL, 10);
unsigned long n = mrb_int_read(tok(p), NULL, NULL);
if (n > INT_MAX) {
yyerror(p, "capture group index must be <= " MRB_STRINGIZE(INT_MAX));
return 0;
File diff suppressed because it is too large Load Diff