1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* iseq.c (rb_iseq_compile_with_option): move variable initialization

code to avoid maybe-uninitialized warnings by gcc 4.8.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
shugo 2016-01-08 00:38:40 +00:00
parent 7fbd93497a
commit 115163421a
2 changed files with 12 additions and 13 deletions

View file

@ -1,3 +1,8 @@
Fri Jan 8 09:33:59 2016 Shugo Maeda <shugo@ruby-lang.org>
* iseq.c (rb_iseq_compile_with_option): move variable initialization
code to avoid maybe-uninitialized warnings by gcc 4.8.
Fri Jan 8 00:03:22 2016 Shugo Maeda <shugo@ruby-lang.org>
* enum.c (enum_min, enum_max): do the same optimization as r53454.

20
iseq.c
View file

@ -605,28 +605,22 @@ rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE absolute_path, VALUE li
rb_iseq_t *iseq = NULL;
const rb_iseq_t *const parent = base_block ? base_block->iseq : NULL;
rb_compile_option_t option;
VALUE label;
const enum iseq_type type = parent ? ISEQ_TYPE_EVAL : ISEQ_TYPE_TOP;
int ln = NUM2INT(line);
NODE *(*parse)(VALUE vparser, VALUE fname, VALUE file, int start) =
(RB_TYPE_P(src, T_FILE) ?
rb_parser_compile_file_path :
(StringValue(src), rb_parser_compile_string_path));
StringValueCStr(file);
make_compile_option(&option, opt);
if (parent) {
label = parent->body->location.label;
}
else {
label = rb_fstring_cstr("<compiled>");
}
th->base_block = base_block;
TH_PUSH_TAG(th);
if ((state = EXEC_TAG()) == 0) {
VALUE label = parent ? parent->body->location.label :
rb_fstring_cstr("<compiled>");
int ln = NUM2INT(line);
NODE *(*parse)(VALUE vparser, VALUE fname, VALUE file, int start) =
(RB_TYPE_P(src, T_FILE) ?
rb_parser_compile_file_path :
(StringValue(src), rb_parser_compile_string_path));
NODE *node = (*parse)(rb_parser_new(), file, src, ln);
if (node) { /* TODO: check err */
iseq = rb_iseq_new_with_opt(node, label, file, absolute_path, line,