-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
Dear developers,
I am playing with JIT, compiling small codes, registering and unregistering frame tables.
Usually, when something goes wrong, it is because I messed with the runtime, but this time, it seems there is a possible bug in the function caml_unregister_frametable:
Lines 208 to 229 in 679b500
| void caml_unregister_frametable(intnat *table) { | |
| intnat len, j; | |
| link *lnk; | |
| link *previous = frametables; | |
| frame_descr * d; | |
| len = *table; | |
| d = (frame_descr *)(table + 1); | |
| for (j = 0; j < len; j++) { | |
| remove_entry(d); | |
| d = next_frame_descr(d); | |
| } | |
| iter_list(frametables,lnk) { | |
| if(lnk->data == table) { | |
| previous->next = lnk->next; | |
| caml_stat_free(lnk); | |
| break; | |
| } | |
| previous = lnk; | |
| } | |
| } |
For me, it does not take into account that the root of the list (frametables) can be the one we "unregister".
Thus, I would make the following changes at lines 221-228:
if (frametables->data == table) {
lnk = frametables;
frametables = frametables->next;
caml_stat_free(lnk);
} else {
iter_list(frametables->next,lnk) {
if(lnk->data == table) {
previous->next = lnk->next;
caml_stat_free(lnk);
break;
}
previous = lnk;
}
}Regards,
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels