src: minor cleanups

This commit is contained in:
Markus F.X.J. Oberhumer
2023-08-21 22:41:42 +02:00
parent dd928cf956
commit dd1838a7eb
10 changed files with 50 additions and 25 deletions
+12 -7
View File
@@ -205,13 +205,18 @@ void MemBuffer::dealloc() noexcept {
debug_set(debug.last_return_address_dealloc, upx_return_address());
#if DEBUG || 1
// info: calling checkState() here violates "noexcept", so we need a try block
try {
checkState();
} catch (const Throwable &e) {
printErr("unknown", e);
std::terminate();
} catch (...) {
std::terminate();
bool shall_check = true;
// bool shall_check = (std::uncaught_exceptions() == 0); // only if not unwinding
// TODO later: add a priority() method to class Throwable
if (shall_check) {
try {
checkState();
} catch (const Throwable &e) {
printErr("unknown", e);
std::terminate();
} catch (...) {
std::terminate();
}
}
#endif
stats.global_dealloc_counter += 1;