callback to count number of instructions in uc_emu_start() should be executed first. fix #727

This commit is contained in:
Nguyen Anh Quynh
2017-06-16 13:22:38 +08:00
parent 8f2d6cd70f
commit fe466d003a
4 changed files with 62 additions and 7 deletions

22
list.c
View File

@ -22,6 +22,28 @@ void list_clear(struct list *list)
list->tail = NULL;
}
// insert a new item at the begin of the list.
// returns generated linked list node, or NULL on failure
void *list_insert(struct list *list, void *data)
{
struct list_item *item = malloc(sizeof(struct list_item));
if (item == NULL) {
return NULL;
}
item->data = data;
item->next = list->head;
if (list->tail == NULL) {
list->tail = item;
}
list->head = item;
return item;
}
// append a new item at the end of the list.
// returns generated linked list node, or NULL on failure
void *list_append(struct list *list, void *data)
{