objc-act.c (hash_init): Assume xmalloc always succeeds, also use memset to clear the hash tables.
* objc/objc-act.c (hash_init): Assume xmalloc always succeeds, also use memset to clear the hash tables. (hash_enter): Assume xmalloc always succeeds. (hash_add_attr): Ditto. (continue_class): Ditto. From-SVN: r43472
This commit is contained in:
parent
5f2d6cfa81
commit
f5e6aae050
|
@ -1,3 +1,11 @@
|
||||||
|
2001-06-20 Stan Shebs <shebs@apple.com>
|
||||||
|
|
||||||
|
* objc/objc-act.c (hash_init): Assume xmalloc always succeeds,
|
||||||
|
also use memset to clear the hash tables.
|
||||||
|
(hash_enter): Assume xmalloc always succeeds.
|
||||||
|
(hash_add_attr): Ditto.
|
||||||
|
(continue_class): Ditto.
|
||||||
|
|
||||||
2001-06-20 Michael Meissner <meissner@redhat.com>
|
2001-06-20 Michael Meissner <meissner@redhat.com>
|
||||||
|
|
||||||
* builtins.c (predict.h): Include.
|
* builtins.c (predict.h): Include.
|
||||||
|
|
|
@ -5447,21 +5447,11 @@ build_ivar_reference (id)
|
||||||
static void
|
static void
|
||||||
hash_init ()
|
hash_init ()
|
||||||
{
|
{
|
||||||
nst_method_hash_list = (hash *)xmalloc (SIZEHASHTABLE * sizeof (hash));
|
nst_method_hash_list = (hash *) xmalloc (SIZEHASHTABLE * sizeof (hash));
|
||||||
cls_method_hash_list = (hash *)xmalloc (SIZEHASHTABLE * sizeof (hash));
|
cls_method_hash_list = (hash *) xmalloc (SIZEHASHTABLE * sizeof (hash));
|
||||||
|
|
||||||
if (!nst_method_hash_list || !cls_method_hash_list)
|
memset (nst_method_hash_list, 0, SIZEHASHTABLE * sizeof (hash));
|
||||||
perror ("unable to allocate space in objc-act.c");
|
memset (cls_method_hash_list, 0, SIZEHASHTABLE * sizeof (hash));
|
||||||
else
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < SIZEHASHTABLE; i++)
|
|
||||||
{
|
|
||||||
nst_method_hash_list[i] = 0;
|
|
||||||
cls_method_hash_list[i] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* WARNING!!!! hash_enter is called with a method, and will peek
|
/* WARNING!!!! hash_enter is called with a method, and will peek
|
||||||
|
@ -5484,8 +5474,6 @@ hash_enter (hashlist, method)
|
||||||
hash_alloc_index = 0;
|
hash_alloc_index = 0;
|
||||||
hash_alloc_list = (hash) xmalloc (sizeof (struct hashed_entry)
|
hash_alloc_list = (hash) xmalloc (sizeof (struct hashed_entry)
|
||||||
* HASH_ALLOC_LIST_SIZE);
|
* HASH_ALLOC_LIST_SIZE);
|
||||||
if (! hash_alloc_list)
|
|
||||||
perror ("unable to allocate in objc-act.c");
|
|
||||||
}
|
}
|
||||||
obj = &hash_alloc_list[hash_alloc_index++];
|
obj = &hash_alloc_list[hash_alloc_index++];
|
||||||
obj->list = 0;
|
obj->list = 0;
|
||||||
|
@ -5528,8 +5516,6 @@ hash_add_attr (entry, value)
|
||||||
attr_alloc_index = 0;
|
attr_alloc_index = 0;
|
||||||
attr_alloc_list = (attr) xmalloc (sizeof (struct hashed_attribute)
|
attr_alloc_list = (attr) xmalloc (sizeof (struct hashed_attribute)
|
||||||
* ATTR_ALLOC_LIST_SIZE);
|
* ATTR_ALLOC_LIST_SIZE);
|
||||||
if (! attr_alloc_list)
|
|
||||||
perror ("unable to allocate in objc-act.c");
|
|
||||||
}
|
}
|
||||||
obj = &attr_alloc_list[attr_alloc_index++];
|
obj = &attr_alloc_list[attr_alloc_index++];
|
||||||
obj->next = entry->list;
|
obj->next = entry->list;
|
||||||
|
@ -6309,9 +6295,7 @@ continue_class (class)
|
||||||
if (!objc_class_template)
|
if (!objc_class_template)
|
||||||
build_class_template ();
|
build_class_template ();
|
||||||
|
|
||||||
if (!(imp_entry
|
imp_entry = (struct imp_entry *) xmalloc (sizeof (struct imp_entry));
|
||||||
= (struct imp_entry *) xmalloc (sizeof (struct imp_entry))))
|
|
||||||
perror ("unable to allocate in objc-act.c");
|
|
||||||
|
|
||||||
imp_entry->next = imp_list;
|
imp_entry->next = imp_list;
|
||||||
imp_entry->imp_context = class;
|
imp_entry->imp_context = class;
|
||||||
|
|
Loading…
Reference in New Issue