[PATCH] D61342: [sanitizer_common] Added 64-bit signed flag parser.
Mitch Phillips via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 30 14:19:38 PDT 2019
hctim created this revision.
hctim added reviewers: vlad.tsyrklevich, eugenis.
Herald added subscribers: llvm-commits, Sanitizers, kubamracek.
Herald added projects: Sanitizers, LLVM.
Adds a 64-bit signed flag parser for GWP-ASan's use.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D61342
Files:
compiler-rt/lib/sanitizer_common/sanitizer_flag_parser.h
Index: compiler-rt/lib/sanitizer_common/sanitizer_flag_parser.h
===================================================================
--- compiler-rt/lib/sanitizer_common/sanitizer_flag_parser.h
+++ compiler-rt/lib/sanitizer_common/sanitizer_flag_parser.h
@@ -99,6 +99,15 @@
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 {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61342.197442.patch
Type: text/x-patch
Size: 643 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190430/0ee8c70a/attachment.bin>
More information about the llvm-commits
mailing list