Cello
Cello copied to clipboard
return in a `try` block breaks `Exception_Depth()`
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
}
A possible solution might be to use a "smart object" on the stack, that will Exception_Dec()
when it goes out of scope.
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.
Until I can think of a better solution I've simply added a warning to the website.