mirror of
https://github.com/oxen-io/oxen-core.git
synced 2023-12-14 02:22:56 +01:00
Merge pull request #973 from Doy-lee/Gcc5.5Fix
Fix GCC 5.5 not being smart about evaluating dead branches
This commit is contained in:
commit
0e690e5394
1 changed files with 3 additions and 1 deletions
|
@ -158,7 +158,9 @@ struct bt_deserialize<T, std::enable_if_t<std::is_integral<T>::value>> {
|
|||
throw bt_deserialize_invalid("Found too-large value " + std::to_string(read.first.u64) + " when deserializing just before input location " + std::to_string(is.tellg()));
|
||||
val = static_cast<T>(read.first.u64);
|
||||
} else {
|
||||
if (sizeof(T) < sizeof(int64_t) && (read.first.i64 < smin || read.first.i64 > smax))
|
||||
bool oob = read.first.i64 < smin;
|
||||
oob |= read.first.i64 > smax;
|
||||
if (sizeof(T) < sizeof(int64_t) && oob)
|
||||
throw bt_deserialize_invalid("Found out-of-range value " + std::to_string(read.first.i64) + " when deserializing just before input location " + std::to_string(is.tellg()));
|
||||
val = static_cast<T>(read.first.i64);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue