Project

General

Profile

Bug #1272 » variable.patch

cfis (Charlie Savage), 03/12/2009 12:56 PM

View differences:

variable.c (working copy)
iv_index_tbl = ROBJECT_IV_INDEX_TBL(obj);
if (!iv_index_tbl) break;
if (!st_lookup(iv_index_tbl, id, &index)) break;
if (len <= index) break;
if (len <= (long)index) break;
val = ptr[index];
if (val != Qundef)
return val;
......
ivar_extended = 1;
}
len = ROBJECT_NUMIV(obj);
if (len <= index) {
if (len <= (long)index) {
VALUE *ptr = ROBJECT_IVPTR(obj);
if (index < ROBJECT_EMBED_LEN_MAX) {
RBASIC(obj)->flags |= ROBJECT_EMBED;
......
VALUE *newptr;
long newsize = (index+1) + (index+1)/4; /* (index+1)*1.25 */
if (!ivar_extended &&
iv_index_tbl->num_entries < newsize) {
(long)(iv_index_tbl->num_entries) < newsize) {
newsize = iv_index_tbl->num_entries;
}
if (RBASIC(obj)->flags & ROBJECT_EMBED) {
......
iv_index_tbl = ROBJECT_IV_INDEX_TBL(obj);
if (!iv_index_tbl) break;
if (!st_lookup(iv_index_tbl, id, &index)) break;
if (ROBJECT_NUMIV(obj) <= index) break;
if (ROBJECT_NUMIV(obj) <= (long)index) break;
val = ROBJECT_IVPTR(obj)[index];
if (val != Qundef)
return Qtrue;
......
iv_index_tbl = ROBJECT_IV_INDEX_TBL(obj);
if (!iv_index_tbl) break;
if (!st_lookup(iv_index_tbl, id, &index)) break;
if (ROBJECT_NUMIV(obj) <= index) break;
if (ROBJECT_NUMIV(obj) <= (long)index) break;
val = ROBJECT_IVPTR(obj)[index];
if (val != Qundef) {
ROBJECT_IVPTR(obj)[index] = Qundef;
(6-6/6)