diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-01-08 00:38:40 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-01-08 00:38:40 +0000 |
commit | a38517d54cb71e74fa20d5bb5ebd91087fe50677 (patch) | |
tree | deac92aa778a2cdde4de5be021d92b0329bda4fa /iseq.c | |
parent | 09e609218fa21a6e126beb67837361a7458dabcc (diff) | |
download | ruby-a38517d54cb71e74fa20d5bb5ebd91087fe50677.tar.gz |
* 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
Diffstat (limited to 'iseq.c')
-rw-r--r-- | iseq.c | 20 |
1 files changed, 7 insertions, 13 deletions
@@ -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, |