src: add assert_noexcept()

This commit is contained in:
Markus F.X.J. Oberhumer
2023-07-08 12:06:27 +02:00
parent 1d71dd3851
commit 682a1e97e4
12 changed files with 248 additions and 167 deletions
+15 -2
View File
@@ -41,7 +41,7 @@
#endif
static const char *argv0 = "";
const char *progname = "";
const char *progname = "upx";
static acc_getopt_t mfx_getopt;
#define mfx_optarg mfx_getopt.optarg
@@ -1317,10 +1317,23 @@ int __acc_cdecl_main main(int argc, char *argv[]) {
// srand((int) time(nullptr));
srand((int) clock());
// info: calling upx_main() here violates implicit "noexcept", so we need a try block
#if 0
int r = upx_main(argc, argv);
#else
int r = EXIT_INTERNAL;
try {
r = upx_main(argc, argv);
} catch (const Throwable &e) {
printErr("unknown", e);
std::terminate();
} catch (...) {
std::terminate();
}
#endif
#if 0 && defined(__GLIBC__)
//malloc_stats();
// malloc_stats();
#endif
return r;
}