mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
EasyLogging++: new anti-UB test and propagating exception
This commit is contained in:
parent
ed506006d2
commit
b2c59af84d
2 changed files with 8 additions and 0 deletions
1
external/easylogging++/easylogging++.h
vendored
1
external/easylogging++/easylogging++.h
vendored
|
@ -2026,6 +2026,7 @@ class TypedConfigurations : public base::threading::ThreadSafe {
|
||||||
ELPP_INTERNAL_ERROR("Unable to get configuration [" << confName << "] for level ["
|
ELPP_INTERNAL_ERROR("Unable to get configuration [" << confName << "] for level ["
|
||||||
<< LevelHelper::convertToString(level) << "]"
|
<< LevelHelper::convertToString(level) << "]"
|
||||||
<< std::endl << "Please ensure you have properly configured logger.", false);
|
<< std::endl << "Please ensure you have properly configured logger.", false);
|
||||||
|
throw; // The exception has to be rethrown, to abort a branch leading to UB.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return it->second;
|
return it->second;
|
||||||
|
|
|
@ -208,3 +208,10 @@ TEST(logging, operator_equals_segfault)
|
||||||
el::Logger log2("id2", nullptr);
|
el::Logger log2("id2", nullptr);
|
||||||
log2 = log1;
|
log2 = log1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(logging, empty_configurations_throws)
|
||||||
|
{
|
||||||
|
el::Logger log1("id1", nullptr);
|
||||||
|
const el::Configurations cfg;
|
||||||
|
EXPECT_ANY_THROW(log1.configure(cfg));
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue