[PATCH] D16176: Introduce stats and stats_client libraries.
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 14 16:27:01 PST 2016
pcc added inline comments.
================
Comment at: lib/sanitizer_common/sanitizer_flags.cc:51
@@ -50,1 +50,3 @@
+// %p = pid
+void SubstituteForFlagValue(const char *s, char *out, uptr out_size) {
char *out_end = out + out_size;
----------------
I don't think we can use `std::string` here.
================
Comment at: lib/sanitizer_common/sanitizer_flags.cc:98
@@ -71,3 +97,3 @@
char *buf = (char *)MmapOrDie(kMaxPathLength, "FlagHandlerInclude");
- SubstituteBinaryName(value, buf, kMaxPathLength);
+ SubstituteForFlagValue(value, buf, kMaxPathLength);
bool res = parser_->ParseFile(buf, ignore_missing_);
----------------
`kMaxPathLength` is 4096, which is probably enough (we use it in a bunch of other places elsewhere). I don't think this code matters enough to worry about using a variable-size buffer.
I've added a CHECK to the above function.
http://reviews.llvm.org/D16176
More information about the llvm-commits
mailing list