Closed Itay2805 closed 1 year ago
After more inspection I think I understand more, the first instruction is a call that gets inlined, that causes the first instruction to then get removed from the insn list (since the call itself is no longer needed), then at a later stage the head_func_insn
(which now has its prev and next being NULL) is used to insert another thing at the start, which fails because the instruction is no longer linked.
Thank you for reporting this and provide the test cases. I'll try to fix the problem on this week.
Your analysis is right. After some tries, I create a code which reproduces the bug.
I've pushed the fix https://github.com/vnmakarov/mir/commit/c476b61dbe86b1d9ea36d142b978b28c0b2ec21d into master and v_0_x branch.
Thank you again for reporting this.
Tested and it works great! Thanks!
I have noticed that I get a strange assert (
wrong insert_before for MIR_insn_t
) in the following code in mir.c inside theprocess_inlines
function:In my test code I have a function whose first instruction is a
call
, which from what I can tell gets inlined into the first function, that causes thehead_func_insn
to no longer actually point to the first instruction (func->insns->head
), which makes for the assert to eventually fire.The first function:
The second function: