* ruby.c (load_file_internal): use original C string as the filename
for parser. reported by whiteleaf at [ruby-list:49085] [ruby-dev:46738] [Bug #7562] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e90ccd3beb
commit
e446378ad0
@ -1,3 +1,10 @@
|
|||||||
|
Wed Dec 19 23:52:16 2012 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* ruby.c (load_file_internal): use original C string as the filename
|
||||||
|
for parser.
|
||||||
|
reported by whiteleaf at [ruby-list:49085] [ruby-dev:46738]
|
||||||
|
[Bug #7562]
|
||||||
|
|
||||||
Wed Dec 19 23:36:12 2012 Naohisa Goto <ngotogenome@gmail.com>
|
Wed Dec 19 23:36:12 2012 Naohisa Goto <ngotogenome@gmail.com>
|
||||||
|
|
||||||
* marshal.c (marshal_dump, marshal_load): fix SEGV during make rdoc
|
* marshal.c (marshal_dump, marshal_load): fix SEGV during make rdoc
|
||||||
|
5
ruby.c
5
ruby.c
@ -1569,6 +1569,7 @@ load_file_internal(VALUE arg)
|
|||||||
VALUE parser = argp->parser;
|
VALUE parser = argp->parser;
|
||||||
VALUE fname_v = rb_str_encode_ospath(argp->fname);
|
VALUE fname_v = rb_str_encode_ospath(argp->fname);
|
||||||
const char *fname = StringValueCStr(fname_v);
|
const char *fname = StringValueCStr(fname_v);
|
||||||
|
const char *orig_fname = StringValueCStr(argp->fname);
|
||||||
int script = argp->script;
|
int script = argp->script;
|
||||||
struct cmdline_options *opt = argp->opt;
|
struct cmdline_options *opt = argp->opt;
|
||||||
VALUE f;
|
VALUE f;
|
||||||
@ -1702,10 +1703,10 @@ load_file_internal(VALUE arg)
|
|||||||
if (NIL_P(f)) {
|
if (NIL_P(f)) {
|
||||||
f = rb_str_new(0, 0);
|
f = rb_str_new(0, 0);
|
||||||
rb_enc_associate(f, enc);
|
rb_enc_associate(f, enc);
|
||||||
return (VALUE)rb_parser_compile_string(parser, fname, f, line_start);
|
return (VALUE)rb_parser_compile_string(parser, orig_fname, f, line_start);
|
||||||
}
|
}
|
||||||
rb_funcall(f, set_encoding, 2, rb_enc_from_encoding(enc), rb_str_new_cstr("-"));
|
rb_funcall(f, set_encoding, 2, rb_enc_from_encoding(enc), rb_str_new_cstr("-"));
|
||||||
tree = rb_parser_compile_file(parser, fname, f, line_start);
|
tree = rb_parser_compile_file(parser, orig_fname, f, line_start);
|
||||||
rb_funcall(f, set_encoding, 1, rb_parser_encoding(parser));
|
rb_funcall(f, set_encoding, 1, rb_parser_encoding(parser));
|
||||||
if (script && tree && rb_parser_end_seen_p(parser)) {
|
if (script && tree && rb_parser_end_seen_p(parser)) {
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user