4 ms·
What about throwing an exception from the finally clause?
by o11c 11mo ago
What about throwing an exception from the finally clause?
- messe 11mo agoThis loops, if that's what you're asking: while (true) { try { try { return; } finally { throw new Exception(); } } catch { } }
- ziml77 11mo agoYes that is the one exception (heh) to the rule unfortunately. You can throw from anywhere so it must support unwinding from any point. So if you were really intent on abusing the finally you could wrap the try-finally in a try-catch and then throw from the finally and put your continue in the catch.