[sanitizer_common] Added 64-bit signed flag parser.

Summary: Adds a 64-bit signed flag parser for GWP-ASan's use.

Reviewers: vlad.tsyrklevich, eugenis

Subscribers: kubamracek, #sanitizers, llvm-commits, vitalybuka, morehouse, pcc, kcc

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D61342

llvm-svn: 359631
This commit is contained in:
Mitch Phillips 2019-04-30 23:07:10 +00:00
parent 0b0d13a704
commit 84ea3f2a48
1 changed files with 9 additions and 0 deletions

View File

@ -99,6 +99,15 @@ inline bool FlagHandler<uptr>::Parse(const char *value) {
return ok;
}
template <>
inline bool FlagHandler<s64>::Parse(const char *value) {
const char *value_end;
*t_ = internal_simple_strtoll(value, &value_end, 10);
bool ok = *value_end == 0;
if (!ok) Printf("ERROR: Invalid value for s64 option: '%s'\n", value);
return ok;
}
class FlagParser {
static const int kMaxFlags = 200;
struct Flag {