Skip to content

'Assertion !cx.terminated failed' involving nested rets #894

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

Closed
jruderman opened this issue Sep 10, 2011 · 2 comments
Closed

'Assertion !cx.terminated failed' involving nested rets #894

jruderman opened this issue Sep 10, 2011 · 2 comments

Comments

@jruderman
Copy link
Contributor

fn f() -> int { ret (ret 2) + 3; }
fn main() { }

Results in an assertion in a function called "Br":

upcall fail 'Assertion !cx.terminated failed', ../src/comp/middle/trans_build.rs:34

Same error message as in #893, but a very different testcase.

@marijnh
Copy link
Contributor

marijnh commented Sep 13, 2011

Fixing this will involve either inserting checks with early-return paths after each and every call to trans_expr and trans_lval, or adding some machinery to the builder to simply ignore extra code added to terminated blocks.

@msullivan
Copy link
Contributor

This looks a lot like all of other bottom returning !cx.terminated bugs that tjc was fixing. Is it different in some way?

bors pushed a commit to rust-lang-ci/rust that referenced this issue Oct 26, 2020
coastalwhite pushed a commit to coastalwhite/rust that referenced this issue Aug 5, 2023
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
* Document and move vtable metadata stuff into a module

* Move vtable restrictions linking into cargo-kani

* move library/kani_metadata to src/kani_metadata
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

No branches or pull requests

3 participants