Skip to content

Remove UNREACHABLE() from resolveAddressBits #1348

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

Merged
merged 2 commits into from
Dec 4, 2024

Conversation

nspin
Copy link
Member

@nspin nspin commented Nov 6, 2024

The binary verification tools do not support __builtin_unreachable, and resolveAddressBits is in scope for binary verification.

The binary verification tools do not support __builtin_unreachable.

Signed-off-by: Nick Spinale <[email protected]>
@@ -190,6 +190,4 @@ resolveAddressBits_ret_t resolveAddressBits(cap_t nodeCap, cptr_t capptr, word_t
return ret;
}
}

UNREACHABLE();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we keep this in the code and just change the define for a verification run to become nothing? It might still be useful to see compiler warnings if this such places can be reached.

Copy link
Member

@lsf37 lsf37 Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that we prove we don't reach this point (the semantics doesn't allow us to fall off the end of a C function), I don't think that is really necessary for resolveAddressBits.

In general I would not mind a conditional macro definition for situations where UNREACHABLE is used in debug code or other parts that are not in scope for verification, but it's perfectly fine to merge this as is.

@kent-mcleod kent-mcleod requested a review from mbrcknl November 9, 2024 08:01
@lsf37 lsf37 merged commit 24156aa into seL4:master Dec 4, 2024
36 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants