[compiler-rt] [scudo] change allocation buffer size with env var (PR #71703)

Christopher Ferris via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 13 13:57:14 PST 2023


================
@@ -136,8 +143,17 @@ bool FlagParser::runHandler(const char *Name, const char *Value) {
       break;
     case FlagType::FT_int:
       char *ValueEnd;
-      *reinterpret_cast<int *>(Flags[I].Var) =
-          static_cast<int>(strtol(Value, &ValueEnd, 10));
+      long V = strtol(Value, &ValueEnd, 10);
+      static_assert(INT_MAX <= LONG_MAX);
----------------
cferris1000 wrote:

But doesn't the standard say this? It would have to be a non-standards compliant compiler where this failed.

It doesn't really hurt to have this though.

https://github.com/llvm/llvm-project/pull/71703


More information about the llvm-commits mailing list