iseq.c: flatten TS_NUM operand conditions

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61883 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-01-17 06:23:57 +00:00
Родитель edb8b498f9
Коммит 640c3dbfa1
1 изменённых файлов: 14 добавлений и 11 удалений

25
iseq.c
Просмотреть файл

@ -1534,21 +1534,24 @@ rb_insn_operand_intern(const rb_iseq_t *iseq,
break;
case TS_NUM: /* ULONG */
{
const char *type_str;
if (insn == BIN(branchiftype) && (type_str = rb_type_str((enum ruby_value_type)op)) != NULL) {
ret = rb_str_new_cstr(type_str);
if (insn == BIN(defined) && op_no == 0) {
enum defined_type deftype = (enum defined_type)op;
if (deftype == DEFINED_FUNC) {
ret = rb_fstring_cstr("func"); break;
}
else if (insn == BIN(defined) && op_no == 0 &&
((enum defined_type)op == DEFINED_FUNC ? (ret = rb_fstring_cstr("func"), 1) :
(enum defined_type)op == DEFINED_REF ? (ret = rb_fstring_cstr("ref"), 1) :
(ret = rb_iseq_defined_string((enum defined_type)op)) != 0)) {
/* ok */
if (deftype == DEFINED_REF) {
ret = rb_fstring_cstr("ref"); break;
}
else {
ret = rb_sprintf("%"PRIuVALUE, op);
ret = rb_iseq_defined_string((enum defined_type)op);
if (ret) break;
}
else if (insn == BIN(branchiftype) && op_no == 0) {
const char *type_str = rb_type_str((enum ruby_value_type)op);
if (type_str) {
ret = rb_str_new_cstr(type_str); break;
}
}
ret = rb_sprintf("%"PRIuVALUE, op);
break;
case TS_LINDEX:{