-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[mono][interpreter] Throw when basic blocks after branch are not created #79246
Conversation
Tagging subscribers to this area: @BrzVlad Issue DetailsIf last BB is dead, runtime/src/mono/mono/mini/method-to-ir.c Lines 11969 to 11970 in a83c661
Fix for #54396
|
@BrzVlad not sure if there is an existing attribute that could be used. |
There shouldn't be a problem if the last bblock is dead in a method. The problem in the test case seems to be that |
New blocks are created when branch/jump instructions are encountered (i.e.
runtime/src/mono/mono/mini/method-to-ir.c Lines 4950 to 4952 in a83c661
Var |
I don't understand what Seems to me that you keep trying to fix a separate issue. I think what you are trying to do is done by |
After offline sync with Vlad, we agreed to check how it is implemented in coreclr as the current implementation in mono jit doesn't cover all cases. |
The fix proposed in this PR doesn't cover all cases. Closing this PR in favour of #80136. |
New blocks are created when branch/jump instructions are encountered (i.e.
ret
,br
,throw
). In such cases, if a new block is not created before the end of the instruction stream, IL code is invalid andInvalidProgramException
should be thrown. Similar approach in Mono JIT:runtime/src/mono/mono/mini/method-to-ir.c
Lines 11969 to 11970 in a83c661
Fix for #54396