[PATCH] D45418: [SimplifyLibcalls] Atoi, strtol replacements

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 16 12:45:26 PDT 2018


efriedma added inline comments.


================
Comment at: lib/Transforms/Utils/SimplifyLibCalls.cpp:1723
+    // check base, valid one is between 2 and 32
+    if (Base < 2 || Base > 32)
+      // handle special zero base
----------------
Where did 32 come from?


================
Comment at: lib/Transforms/Utils/SimplifyLibCalls.cpp:1734
+
+    if (*End != '\0')
+      return nullptr;
----------------
This is a use-after-free (Str.str() allocates a temporary std::string).


https://reviews.llvm.org/D45418





More information about the llvm-commits mailing list