summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-03 23:05:02 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-03 23:05:02 +0000
commitaf597321e5feb8937f410b44846c031ac29c700d (patch)
treebc7503d945a191e5775b21016fc17f6b28f1a201 /compile.c
parent6bc72d25bc2c829c05346fb71e3e85a30bf57bac (diff)
compile.c: fix disasm dump
* compile.c (DECL_ANCHOR): initialize as anchor type, which is not a valid iseq element. * compile.c (BADINSN_DUMP): dump from the first element, excluding the anchor itself. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/compile.c b/compile.c
index 425d875fd1..0d6ffaaa62 100644
--- a/compile.c
+++ b/compile.c
@@ -36,6 +36,7 @@
typedef struct iseq_link_element {
enum {
+ ISEQ_ELEMENT_ANCHOR,
ISEQ_ELEMENT_LABEL,
ISEQ_ELEMENT_INSN,
ISEQ_ELEMENT_ADJUST,
@@ -438,7 +439,7 @@ do { \
/* leave name uninitialized so that compiler warn if INIT_ANCHOR is
* missing */
#define DECL_ANCHOR(name) \
- LINK_ANCHOR name[1] = {{{0,},}}
+ LINK_ANCHOR name[1] = {{{ISEQ_ELEMENT_ANCHOR,},}}
#define INIT_ANCHOR(name) \
(name->last = &name->anchor)
@@ -1712,7 +1713,7 @@ get_ivar_ic_value(rb_iseq_t *iseq,ID id)
}
#define BADINSN_DUMP(anchor, list, dest) \
- dump_disasm_list_with_cursor(&anchor->anchor, list, dest)
+ dump_disasm_list_with_cursor(FIRST_ELEMENT(anchor), list, dest)
#define BADINSN_ERROR \
(xfree(generated_iseq), \
@@ -1923,6 +1924,7 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *const anchor)
}
break;
}
+ default: break;
}
list = list->next;
}
@@ -2242,6 +2244,7 @@ get_destination_insn(INSN *iobj)
events |= trace->event;
}
break;
+ default: break;
}
list = list->next;
}