aboutsummaryrefslogtreecommitdiffstats
path: root/ruby_parser.c
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2024-05-31 17:30:21 +0900
committerYusuke Endoh <mame@ruby-lang.org>2024-05-31 18:24:43 +0900
commita15e4d405ba6cafbe2f63921bd771b1241049841 (patch)
tree1cc195d626360da1d2b28d9b15f7990c3dd4d28b /ruby_parser.c
parent392ee058432910ef89abaff7e2e19d142f32638c (diff)
downloadruby-a15e4d405ba6cafbe2f63921bd771b1241049841.tar.gz
Revert 528c4501f46fbe1e06028d673a777ef124d29829
Recently, `TestRubyLiteral#test_float` fails randomly. ``` 1) Error: TestRubyLiteral#test_float: ArgumentError: SyntaxError#path changed: "(eval at /home/chkbuild/chkbuild/tmp/build/20240527T050036Z/ruby/test/ruby/test_literal.rb:642)"->"(eval at /home/chkbuild/chkbuild/tmp/build/20240527T050036Z/ruby/test/ruby/test_literal.rb:642)" ``` https://rubyci.s3.amazonaws.com/s390x/ruby-master/log/20240527T050036Z.fail.html.gz According to Launchable, the first failure was on Apr 30. This is just when 528c4501f46fbe1e06028d673a777ef124d29829 was committed. I don't know if the change is really the cause, but I want to revert it once to see if the random failure disappears.
Diffstat (limited to 'ruby_parser.c')
-rw-r--r--ruby_parser.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/ruby_parser.c b/ruby_parser.c
index 98541fc597..931c07d988 100644
--- a/ruby_parser.c
+++ b/ruby_parser.c
@@ -168,12 +168,6 @@ enc_mbcput(unsigned int c, void *buf, parser_encoding *enc)
return rb_enc_mbcput(c, buf, enc);
}
-static int
-enc_mbclen(const char *p, const char *e, parser_encoding *enc)
-{
- return rb_enc_mbclen(p, e, enc);
-}
-
static parser_encoding *
enc_from_index(int idx)
{
@@ -419,7 +413,6 @@ static const rb_parser_config_t rb_global_parser_config = {
.ascii8bit_encoding = ascii8bit_encoding,
.enc_codelen = enc_codelen,
.enc_mbcput = enc_mbcput,
- .enc_mbclen = enc_mbclen,
.enc_find_index = rb_enc_find_index,
.enc_from_index = enc_from_index,
.enc_isspace = enc_isspace,
@@ -664,19 +657,7 @@ static void parser_aset_script_lines_for(VALUE path, rb_parser_ary_t *lines);
static rb_ast_t*
parser_compile(rb_parser_t *p, rb_parser_lex_gets_func *gets, VALUE fname, rb_parser_input_data input, int line)
{
- rb_ast_t *ast;
- const char *ptr = 0;
- long len = 0;
- rb_encoding *enc = 0;
-
- if (!NIL_P(fname)) {
- StringValueCStr(fname);
- ptr = RSTRING_PTR(fname);
- len = RSTRING_LEN(fname);
- enc = rb_enc_get(fname);
- }
-
- ast = rb_parser_compile(p, gets, ptr, len, enc, input, line);
+ rb_ast_t *ast = rb_parser_compile(p, gets, fname, input, line);
parser_aset_script_lines_for(fname, ast->body.script_lines);
return ast;
}