[PATCH] D53821: [ELF][PPC64]Workaround bogus Visual Studio build warning

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 29 10:06:57 PDT 2018


jhenderson updated this revision to Diff 171530.
jhenderson edited the summary of this revision.
jhenderson removed a reviewer: espindola.
jhenderson added a comment.
Herald added a reviewer: espindola.

Use numeric_limits instead of literal.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D53821

Files:
  ELF/Arch/PPC64.cpp


Index: ELF/Arch/PPC64.cpp
===================================================================
--- ELF/Arch/PPC64.cpp
+++ ELF/Arch/PPC64.cpp
@@ -850,7 +850,8 @@
   int32_t StackFrameSize = (HiImm * 65536) + LoImm;
   // Check that the adjusted size doesn't overflow what we can represent with 2
   // instructions.
-  if (StackFrameSize < -2147483648 + Config->SplitStackAdjustSize) {
+  if (StackFrameSize <
+      std::numeric_limits<int32_t>::min() + Config->SplitStackAdjustSize) {
     error(getErrorLocation(Loc) + "split-stack prologue adjustment overflows");
     return false;
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53821.171530.patch
Type: text/x-patch
Size: 590 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181029/59266ecf/attachment.bin>


More information about the llvm-commits mailing list