[PATCH] D67263: [DwarfExpression] Disallow some rewrites to avoid undefined behavior

Jonas Devlieghere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 6 09:00:46 PDT 2019


JDevlieghere added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp:284
+    uint64_t Offset = Op->getArg(0);
+    if (Offset <= (uint64_t)INT_MAX) {
+      SignedOffset = (int)Offset;
----------------
We should use C++ style casts and `std::numeric_limits`. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D67263





More information about the llvm-commits mailing list