Project

General

Profile

fix_stackerror.patch

phasis68 (Heesob Park), 12/05/2013 11:23 PM

View differences:

hash.c.new
122 122
    }
123 123
    else if (BUILTIN_TYPE(a) == T_STRING) {
124 124
	hnum = rb_str_hash(a);
125
    }
126
    else {
127
        hval = rb_hash(a);
128
	hnum = FIX2LONG(hval);
125
    } else {
126
#if SIZEOF_LONG_LONG == SIZEOF_VOIDP    
127
        if (BUILTIN_TYPE(a) == T_BIGNUM) {
128
            int sign;
129
            unsigned long ul;
130
            sign = rb_integer_pack(a, &ul, 1, sizeof(ul), 0,
131
                    INTEGER_PACK_NATIVE_BYTE_ORDER);
132
            ul &= (1UL << (sizeof(long)*CHAR_BIT-1)) - 1;
133
            hnum = (sign < 0) ? LONG2FIX(-(long)ul) : LONG2FIX((long)ul);
134
        } else {
135
#endif	
136
            hval = rb_hash(a);
137
	    hnum = FIX2LONG(hval);
138
	}
129 139
    }
130 140
    hnum <<= 1;
131 141
    return (st_index_t)RSHIFT(hnum, 1);