diff --git a/libraries/libstratosphere/source/result/result_on_assertion.cpp b/libraries/libstratosphere/source/result/result_on_assertion.cpp index 7705c56..6d4337e 100644 --- a/libraries/libstratosphere/source/result/result_on_assertion.cpp +++ b/libraries/libstratosphere/source/result/result_on_assertion.cpp @@ -15,25 +15,12 @@ */ #include -namespace ams::result { - - extern bool CallFatalOnResultAssertion; - -} - namespace ams::result::impl { NORETURN WEAK_SYMBOL void OnResultAbort(const char *file, int line, const char *func, const char *expr, Result result) { - /* Assert that we should call fatal on result assertion. */ - /* If we shouldn't fatal, this will abort(); */ - /* If we should, we'll continue onwards. */ - if (!ams::result::CallFatalOnResultAssertion) { - ::ams::diag::AbortImpl(file, line, func, expr, result.GetValue(), "Result Abort: %203d-%04d", result.GetModule(), result.GetDescription()); - } - - /* TODO: ams::fatal:: */ - fatalThrow(result.GetValue()); + ::ams::diag::AbortImpl(file, line, func, expr, result.GetValue(), "Result Abort: %203d-%04d", result.GetModule(), result.GetDescription()); AMS_INFINITE_LOOP(); + __builtin_unreachable(); } NORETURN WEAK_SYMBOL void OnResultAbort(Result result) { @@ -41,16 +28,9 @@ } NORETURN WEAK_SYMBOL void OnResultAssertion(const char *file, int line, const char *func, const char *expr, Result result) { - /* Assert that we should call fatal on result assertion. */ - /* If we shouldn't fatal, this will assert(); */ - /* If we should, we'll continue onwards. */ - if (!ams::result::CallFatalOnResultAssertion) { - ::ams::diag::AssertionFailureImpl(file, line, func, expr, result.GetValue(), "Result Assertion: %203d-%04d", result.GetModule(), result.GetDescription()); - } - - /* TODO: ams::fatal:: */ - fatalThrow(result.GetValue()); + ::ams::diag::AssertionFailureImpl(file, line, func, expr, result.GetValue(), "Result Assertion: %203d-%04d", result.GetModule(), result.GetDescription()); AMS_INFINITE_LOOP(); + __builtin_unreachable(); } NORETURN WEAK_SYMBOL void OnResultAssertion(Result result) { diff --git a/stratosphere/ams_mitm/source/amsmitm_main.cpp b/stratosphere/ams_mitm/source/amsmitm_main.cpp index ca06e71..6f27571 100644 --- a/stratosphere/ams_mitm/source/amsmitm_main.cpp +++ b/stratosphere/ams_mitm/source/amsmitm_main.cpp @@ -47,12 +47,6 @@ ncm::ProgramId CurrentProgramId = ncm::AtmosphereProgramId::Mitm; - namespace result { - - bool CallFatalOnResultAssertion = false; - - } - /* Override. */ void ExceptionHandler(FatalErrorContext *ctx) { /* We're bpc-mitm (or ams_mitm, anyway), so manually reboot to fatal error. */ diff --git a/stratosphere/boot/source/boot_main.cpp b/stratosphere/boot/source/boot_main.cpp index 2bf22a8..c7a2cb6 100644 --- a/stratosphere/boot/source/boot_main.cpp +++ b/stratosphere/boot/source/boot_main.cpp @@ -63,12 +63,6 @@ boot::RebootForFatalError(ctx); } - namespace result { - - bool CallFatalOnResultAssertion = false; - - } - } using namespace ams; diff --git a/stratosphere/boot2/source/boot2_main.cpp b/stratosphere/boot2/source/boot2_main.cpp index 8694531..8c2efe2 100644 --- a/stratosphere/boot2/source/boot2_main.cpp +++ b/stratosphere/boot2/source/boot2_main.cpp @@ -43,12 +43,6 @@ ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Boot2; - namespace result { - - bool CallFatalOnResultAssertion = false; - - } - } using namespace ams; diff --git a/stratosphere/creport/source/creport_main.cpp b/stratosphere/creport/source/creport_main.cpp index 57fa0db..847da6c 100644 --- a/stratosphere/creport/source/creport_main.cpp +++ b/stratosphere/creport/source/creport_main.cpp @@ -46,12 +46,6 @@ ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Creport; - namespace result { - - bool CallFatalOnResultAssertion = true; - - } - } using namespace ams; diff --git a/stratosphere/dmnt/source/dmnt_main.cpp b/stratosphere/dmnt/source/dmnt_main.cpp index cf21b59..bfa05f9 100644 --- a/stratosphere/dmnt/source/dmnt_main.cpp +++ b/stratosphere/dmnt/source/dmnt_main.cpp @@ -41,12 +41,6 @@ ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Dmnt; - namespace result { - - bool CallFatalOnResultAssertion = false; - - } - } using namespace ams; diff --git a/stratosphere/eclct.stub/source/eclct_stub.cpp b/stratosphere/eclct.stub/source/eclct_stub.cpp index fe9e522..172e308 100644 --- a/stratosphere/eclct.stub/source/eclct_stub.cpp +++ b/stratosphere/eclct.stub/source/eclct_stub.cpp @@ -38,12 +38,6 @@ ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Eclct; - namespace result { - - bool CallFatalOnResultAssertion = false; - - } - } using namespace ams; diff --git a/stratosphere/erpt/source/erpt_main.cpp b/stratosphere/erpt/source/erpt_main.cpp index 5f8a722..2a0597b 100644 --- a/stratosphere/erpt/source/erpt_main.cpp +++ b/stratosphere/erpt/source/erpt_main.cpp @@ -43,12 +43,6 @@ ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Erpt; - namespace result { - - bool CallFatalOnResultAssertion = false; - - } - } using namespace ams; diff --git a/stratosphere/fatal/source/fatal_main.cpp b/stratosphere/fatal/source/fatal_main.cpp index 40c6397..cb2a32a 100644 --- a/stratosphere/fatal/source/fatal_main.cpp +++ b/stratosphere/fatal/source/fatal_main.cpp @@ -50,12 +50,6 @@ ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Fatal; - namespace result { - - bool CallFatalOnResultAssertion = false; - - } - } using namespace ams; diff --git a/stratosphere/jpegdec/source/jpegdec_main.cpp b/stratosphere/jpegdec/source/jpegdec_main.cpp index 1936a56..560e240 100644 --- a/stratosphere/jpegdec/source/jpegdec_main.cpp +++ b/stratosphere/jpegdec/source/jpegdec_main.cpp @@ -39,12 +39,6 @@ namespace ams { ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::JpegDec; - namespace result { - - bool CallFatalOnResultAssertion = true; - - } - } using namespace ams; diff --git a/stratosphere/loader/source/ldr_main.cpp b/stratosphere/loader/source/ldr_main.cpp index 284ce33..ba7b9b2 100644 --- a/stratosphere/loader/source/ldr_main.cpp +++ b/stratosphere/loader/source/ldr_main.cpp @@ -45,12 +45,6 @@ ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Loader; - namespace result { - - bool CallFatalOnResultAssertion = false; - - } - } using namespace ams; diff --git a/stratosphere/ncm/source/ncm_main.cpp b/stratosphere/ncm/source/ncm_main.cpp index 39a6e2c..0b31c0b 100644 --- a/stratosphere/ncm/source/ncm_main.cpp +++ b/stratosphere/ncm/source/ncm_main.cpp @@ -43,12 +43,6 @@ ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Ncm; - namespace result { - - bool CallFatalOnResultAssertion = false; - - } - } using namespace ams; diff --git a/stratosphere/pgl/source/pgl_main.cpp b/stratosphere/pgl/source/pgl_main.cpp index 1126d82..eab2d42 100644 --- a/stratosphere/pgl/source/pgl_main.cpp +++ b/stratosphere/pgl/source/pgl_main.cpp @@ -43,12 +43,6 @@ ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Pgl; - namespace result { - - bool CallFatalOnResultAssertion = false; - - } - } using namespace ams; diff --git a/stratosphere/pm/source/pm_main.cpp b/stratosphere/pm/source/pm_main.cpp index 11bf6db..caabc85 100644 --- a/stratosphere/pm/source/pm_main.cpp +++ b/stratosphere/pm/source/pm_main.cpp @@ -48,12 +48,6 @@ ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Pm; - namespace result { - - bool CallFatalOnResultAssertion = false; - - } - } using namespace ams; diff --git a/stratosphere/ro/source/ro_main.cpp b/stratosphere/ro/source/ro_main.cpp index 3cd4b90..d49e284 100644 --- a/stratosphere/ro/source/ro_main.cpp +++ b/stratosphere/ro/source/ro_main.cpp @@ -40,12 +40,6 @@ ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Ro; - namespace result { - - bool CallFatalOnResultAssertion = true; - - } - } using namespace ams; diff --git a/stratosphere/sm/source/sm_main.cpp b/stratosphere/sm/source/sm_main.cpp index 14c8ae7..16070d4 100644 --- a/stratosphere/sm/source/sm_main.cpp +++ b/stratosphere/sm/source/sm_main.cpp @@ -47,12 +47,6 @@ ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Sm; - namespace result { - - bool CallFatalOnResultAssertion = false; - - } - } using namespace ams; diff --git a/stratosphere/spl/source/spl_main.cpp b/stratosphere/spl/source/spl_main.cpp index e24a35d..1fe05c1 100644 --- a/stratosphere/spl/source/spl_main.cpp +++ b/stratosphere/spl/source/spl_main.cpp @@ -53,12 +53,6 @@ ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Spl; - namespace result { - - bool CallFatalOnResultAssertion = false; - - } - } using namespace ams;