From e5614fbcb05b1f9e6dbd8fd70848c834105f6a40 Mon Sep 17 00:00:00 2001 From: mame Date: Tue, 5 Dec 2017 09:45:03 +0000 Subject: [PATCH] iseq.c (iseq_load, iseq_data_to_ary): Fix a type error (for clang) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- iseq.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/iseq.c b/iseq.c index e0f3bc394e..6dd4addb45 100644 --- a/iseq.c +++ b/iseq.c @@ -617,10 +617,10 @@ iseq_load(VALUE data, const rb_iseq_t *parent, VALUE opt) code_range = rb_hash_aref(misc, ID2SYM(rb_intern("code_range"))); if (RB_TYPE_P(code_range, T_ARRAY) && RARRAY_LEN(code_range) == 4) { - tmp_loc.first_loc.lineno = NUM2LONG(rb_ary_entry(code_range, 0)); - tmp_loc.first_loc.column = NUM2LONG(rb_ary_entry(code_range, 1)); - tmp_loc.last_loc.lineno = NUM2LONG(rb_ary_entry(code_range, 2)); - tmp_loc.last_loc.column = NUM2LONG(rb_ary_entry(code_range, 3)); + tmp_loc.first_loc.lineno = NUM2INT(rb_ary_entry(code_range, 0)); + tmp_loc.first_loc.column = NUM2INT(rb_ary_entry(code_range, 1)); + tmp_loc.last_loc.lineno = NUM2INT(rb_ary_entry(code_range, 2)); + tmp_loc.last_loc.column = NUM2INT(rb_ary_entry(code_range, 3)); } make_compile_option(&option, opt); @@ -2182,10 +2182,10 @@ iseq_data_to_ary(const rb_iseq_t *iseq) rb_hash_aset(misc, ID2SYM(rb_intern("stack_max")), INT2FIX(iseq->body->stack_max)); rb_hash_aset(misc, ID2SYM(rb_intern("code_range")), rb_ary_new_from_args(4, - LONG2FIX(iseq->body->location.code_range.first_loc.lineno), - LONG2FIX(iseq->body->location.code_range.first_loc.column), - LONG2FIX(iseq->body->location.code_range.last_loc.lineno), - LONG2FIX(iseq->body->location.code_range.last_loc.column))); + INT2FIX(iseq->body->location.code_range.first_loc.lineno), + INT2FIX(iseq->body->location.code_range.first_loc.column), + INT2FIX(iseq->body->location.code_range.last_loc.lineno), + INT2FIX(iseq->body->location.code_range.last_loc.column))); /* * [:magic, :major_version, :minor_version, :format_type, :misc,