Skip to content

jit: incorrect linked list connection in memory pool #513

Closed
@vacantron

Description

@vacantron

list_for_each_entry_safe (entry, safe, &delete_target->list, list) {

Both entry and safe is the pointer to structure chain_entry_t, but the base pointer delete_target->list points to the struct list in structure block_t. Thus, the container of the list member is definitely incorrect in the iteration.

The following statements are also similar to the one above.

rv32emu/src/emulate.c

Lines 922 to 924 in f31bc84

chain_entry_t *new_entry = mpool_alloc(rv->chain_entry_mp);
new_entry->block = prev;
list_add(&new_entry->list, &block->list);

rv32emu/src/emulate.c

Lines 929 to 931 in f31bc84

chain_entry_t *new_entry = mpool_alloc(rv->chain_entry_mp);
new_entry->block = prev;
list_add(&new_entry->list, &block->list);

rv32emu/src/emulate.c

Lines 942 to 944 in f31bc84

chain_entry_t *new_entry = mpool_alloc(rv->chain_entry_mp);
new_entry->block = prev;
list_add(&new_entry->list, &block->list);

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions