mjit_worker.c: don't refer to freed value
remove_from_list() frees node, but after that node->next could be used git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4ae20f046e
commit
67e2373f06
@ -499,13 +499,14 @@ mjit_valid_class_serial_p(rb_serial_t class_serial)
|
|||||||
static struct rb_mjit_unit_node *
|
static struct rb_mjit_unit_node *
|
||||||
get_from_list(struct rb_mjit_unit_list *list)
|
get_from_list(struct rb_mjit_unit_list *list)
|
||||||
{
|
{
|
||||||
struct rb_mjit_unit_node *node, *best = NULL;
|
struct rb_mjit_unit_node *node, *next, *best = NULL;
|
||||||
|
|
||||||
if (list->head == NULL)
|
if (list->head == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* Find iseq with max total_calls */
|
/* Find iseq with max total_calls */
|
||||||
for (node = list->head; node != NULL; node = node ? node->next : NULL) {
|
for (node = list->head; node != NULL; node = next) {
|
||||||
|
next = node->next;
|
||||||
if (node->unit->iseq == NULL) { /* ISeq is GCed. */
|
if (node->unit->iseq == NULL) { /* ISeq is GCed. */
|
||||||
free_unit(node->unit);
|
free_unit(node->unit);
|
||||||
remove_from_list(node, list);
|
remove_from_list(node, list);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user