aboutsummaryrefslogtreecommitdiffstats
path: root/iseq.c
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-08 00:38:40 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-08 00:38:40 +0000
commit115163421a2cc91e7296d18599dee757043235d1 (patch)
treedeac92aa778a2cdde4de5be021d92b0329bda4fa /iseq.c
parent7fbd93497a56a0d075d381dff4a984d00ca251ec (diff)
downloadruby-115163421a2cc91e7296d18599dee757043235d1.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.c20
1 files changed, 7 insertions, 13 deletions
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("<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,