mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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:
parent
edb8b498f9
commit
640c3dbfa1
1 changed files with 14 additions and 11 deletions
25
iseq.c
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:{
|
||||
|
|
Loading…
Reference in a new issue