On 3/28/14, 7:03 PM, Joshua Cranmer 🐧 wrote:
I included MOZ_ASSUME_UNREACHABLE_MARKER because that macro is the
compiler-specific "optimize me" intrinsic, which I believe was the
whole point of the original MOZ_ASSUME_UNREACHABLE.

AFAIU, MOZ_ASSUME_UNREACHABLE_MARKER crashes on all Gecko platforms,
but I included MOZ_CRASH to ensure the behavior was consistent for all
platforms.

No, MOZ_ASSUME_UNREACHABLE_MARKER tells the compiler that this code and
everything after it can't be reached, so it need do anything. Clang will
delete the code after this branch and decide to not emit any control
flow. It may crash, but this is in the same vein that reading an
uninitialized variable may crash: it can certainly do a lot of wrong and
potentially exploitable things first.

So what is an example of an appropriate use of MOZ_ASSUME_UNREACHABLE in Gecko today? If we can identify a good example, then perhaps we can create an easier to use solution. If we have no good examples, then we should probably remove this tricky macro.


chris
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to