Karl Tomlinson writes: > Jason Orendorff writes: > >> If the code is truly unreachable, it doesn't matter what we replace it >> with. The question is what to do when the impossible occurs. To me, >> letting control flow past such a place is just as scary as undefined >> behavior. > > That depends on the particular code. Often enough, letting > control flow past is relatively harmless compared to a crash. > >> So I think our replacement for MOZ_ASSUME_UNREACHABLE should >> crash even in non-debug builds. This suggests MOZ_CRASH.
Jason and I spoke on irc and realised that we were talking about 2 slightly different things. I apologize for taking a bit of a tangent to this particular sub thread. Given the history of MOZ_ASSUME_UNREACHABLE in JS code and the intention to remove MOZ_ASSUME_UNREACHABLE, MOZ_CRASH is the appropriate replacement for those existing use cases. However, I would like to discourage use of MOZ_CRASH in future code unless failure to match cases in a switch is really more scary than crashing. _______________________________________________ dev-platform mailing list [email protected] https://lists.mozilla.org/listinfo/dev-platform

