Skip to content
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

Three or more calls with cleanups fail #1113

Open
smeenai opened this issue Nov 13, 2024 · 0 comments
Open

Three or more calls with cleanups fail #1113

smeenai opened this issue Nov 13, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@smeenai
Copy link
Collaborator

smeenai commented Nov 13, 2024

As shown in https://godbolt.org/z/hG7ch1db3, the following code:

struct has_cleanup {
  ~has_cleanup();
};
void may_throw();
void func() {
  has_cleanup cleanup;
  may_throw();
  may_throw();
  may_throw();
}

Results in an error:

loc("<source>":5:6): error: empty block: expect at least a terminator

What's interesting is that it works fine with two calls to may_throw; it's the third call (and any subsequent ones) that cause the issue.

https://godbolt.org/z/T3veaWWfv shows the emitted CIR that fails verification, and it seems like the middle call is failing to get the proper cleanup and catch blocks.

@bcardosolopes bcardosolopes self-assigned this Nov 13, 2024
@seven-mile seven-mile added the bug Something isn't working label Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants