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)"
```
20240527T050036Z.fail.html.gz

According to Launchable, the first failure was on Apr 30.
This is just when 528c4501f4 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.
This commit is contained in:
Yusuke Endoh 2024-05-31 17:30:21 +09:00
parent 392ee05843
commit a15e4d405b
5 changed files with 28 additions and 109 deletions

View file

@ -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;
}