[PATCH] D54527: Add new interceptor for strtonum(3)

Kamil Rytarowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 7 13:19:12 PST 2018


krytarowski marked 2 inline comments as done.
krytarowski added inline comments.


================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:7735
+  char *real_endptr;
+  long long ret = (long long)REAL(strtoimax)(nptr, &real_endptr, 10);
+  StrtolFixAndCheck(ctx, nptr, nullptr, real_endptr, 10);
----------------
vitalybuka wrote:
> why not strtoll, it returns the same type as interceptor and it's already used in strtonum implementation?
> 
It doesn't build, as strtoll isn't a valid interceptor for all sanitizers.


================
Comment at: test/sanitizer_common/TestCases/NetBSD/strtonum.cc:44
+  l = strtonum("1000.0", 1000, 1001, &errstr);
+  if (!errstr)
+    abort();
----------------
vitalybuka wrote:
> asserts?
I will switch to asserts.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54527/new/

https://reviews.llvm.org/D54527





More information about the llvm-commits mailing list