summaryrefslogtreecommitdiffhomepage
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/main.c b/main.c
index d1bb463..99bd3c8 100644
--- a/main.c
+++ b/main.c
@@ -107,10 +107,12 @@ static void dump(struct ut_opcode *op, int level) {
for (prev = NULL, cur = op; cur; prev = cur, cur = cur->sibling) {
dump_node(cur);
- for (i = 0; i < sizeof(cur->operand) / sizeof(cur->operand[0]); i++) {
- if (cur->operand[i]) {
- dump(cur->operand[i], level + 1);
- printf("n%p -> n%p [label=\"op%d\"];\n", cur, cur->operand[i], i + 1);
+ if (cur->type < __T_MAX) {
+ for (i = 0; i < sizeof(cur->operand) / sizeof(cur->operand[0]); i++) {
+ if (cur->operand[i]) {
+ dump(cur->operand[i], level + 1);
+ printf("n%p -> n%p [label=\"op%d\"];\n", cur, cur->operand[i], i + 1);
+ }
}
}