Project

General

Profile

Bug #15625 ยป bug-15625.patch

nobu (Nobuyoshi Nakada), 03/04/2019 11:52 AM

View differences:

variable.c
68 68
    VALUE klass;
69 69
    VALUE path;
70 70
    VALUE track;
71
    VALUE checked;
71 72
    struct fc_result *prev;
72 73
};
73 74

  
......
114 115
	if (!RCLASS_CONST_TBL(value)) return ID_TABLE_CONTINUE;
115 116
	else {
116 117
	    struct fc_result arg;
117
	    struct fc_result *list;
118 118

  
119
	    list = res;
120
	    while (list) {
121
		if (list->track == value) return ID_TABLE_CONTINUE;
122
		list = list->prev;
123
	    }
119
            if (rb_hash_lookup2(res->checked, value, Qfalse))
120
                return ID_TABLE_CONTINUE;
124 121

  
125 122
	    arg.name = key;
126 123
	    arg.preferred = res->preferred;
127 124
	    arg.path = 0;
128 125
	    arg.klass = res->klass;
129 126
	    arg.track = value;
127
            arg.checked = res->checked;
130 128
	    arg.prev = res;
129
            rb_hash_aset(arg.checked, value, Qtrue);
131 130
	    rb_id_table_foreach(RCLASS_CONST_TBL(value), fc_i, &arg);
132 131
	    if (arg.path) {
133 132
		res->path = arg.path;
......
155 154
    arg.path = 0;
156 155
    arg.klass = klass;
157 156
    arg.track = rb_cObject;
157
    arg.checked = rb_ident_hash_new();
158 158
    arg.prev = 0;
159 159
    if (RCLASS_CONST_TBL(rb_cObject)) {
160
        rb_hash_aset(arg.checked, rb_cObject, Qtrue)
160 161
	rb_id_table_foreach(RCLASS_CONST_TBL(rb_cObject), fc_i, &arg);
161 162
    }
162 163
    if (arg.path) {