mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-24 06:41:48 +00:00
Fixed ASAN false positive.
Change-Id: I79d9b2cddc61df5919bc4a93627fba2aa69e5d49 Tested: on Linux.
This commit is contained in:
@@ -135,9 +135,8 @@ inline CheckedError atot(const char *s, Parser &parser, T *val) {
|
|||||||
int64_t i = StringToInt(s);
|
int64_t i = StringToInt(s);
|
||||||
const int64_t min = flatbuffers::numeric_limits<T>::min();
|
const int64_t min = flatbuffers::numeric_limits<T>::min();
|
||||||
const int64_t max = flatbuffers::numeric_limits<T>::max();
|
const int64_t max = flatbuffers::numeric_limits<T>::max();
|
||||||
ECHECK(parser.CheckInRange(i, min, max));
|
*val = (T)i; // Assign this first to make ASAN happy.
|
||||||
*val = (T)i;
|
return parser.CheckInRange(i, min, max);
|
||||||
return NoError();
|
|
||||||
}
|
}
|
||||||
template<>
|
template<>
|
||||||
inline CheckedError atot<uint64_t>(const char *s, Parser &parser,
|
inline CheckedError atot<uint64_t>(const char *s, Parser &parser,
|
||||||
|
|||||||
Reference in New Issue
Block a user