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

return in a try block breaks Exception_Depth() #53

Open
To1ne opened this issue Sep 3, 2013 · 3 comments
Open

return in a try block breaks Exception_Depth() #53

To1ne opened this issue Sep 3, 2013 · 3 comments

Comments

@To1ne
Copy link
Contributor

To1ne commented Sep 3, 2013

For example.

bool IsItOne(int i) {
  try {
    if (1 == i) return true;
  } catch (e) {
    ;
  }
  return false;
}
void Function(void) {
  IsItOne(1);
  Exception_Depth(); // should be zero
}
@To1ne
Copy link
Contributor Author

To1ne commented Sep 3, 2013

A possible solution might be to use a "smart object" on the stack, that will Exception_Dec() when it goes out of scope.

@orangeduck
Copy link
Owner

This is a nasty one. Unfortunately such a smart object isn't possible in C but there may be other ways. Thanks, I'll have a think about it.

@orangeduck
Copy link
Owner

Until I can think of a better solution I've simply added a warning to the website.

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

2 participants