From 115163421a2cc91e7296d18599dee757043235d1 Mon Sep 17 00:00:00 2001 From: shugo Date: Fri, 8 Jan 2016 00:38:40 +0000 Subject: * 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 --- iseq.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'iseq.c') diff --git a/iseq.c b/iseq.c index da5fce65ff..03cc99f452 100644 --- a/iseq.c +++ b/iseq.c @@ -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(""); - } - th->base_block = base_block; TH_PUSH_TAG(th); if ((state = EXEC_TAG()) == 0) { + VALUE label = parent ? parent->body->location.label : + rb_fstring_cstr(""); + 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, -- cgit v1.2.3